From 77397399c235ea174aadd9077f21c858024273ac Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 18:34:22 +0000 Subject: [PATCH] SDK regeneration --- .gradle/8.14.3/checksums/checksums.lock | Bin 17 -> 17 bytes .gradle/8.14.3/checksums/md5-checksums.bin | Bin 21897 -> 21897 bytes .gradle/8.14.3/checksums/sha1-checksums.bin | Bin 25679 -> 25679 bytes .../executionHistory/executionHistory.bin | Bin 64263 -> 64148 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 17 bytes .gradle/8.14.3/fileHashes/fileHashes.bin | Bin 35447 -> 35447 bytes .gradle/8.14.3/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .../buildOutputCleanup.lock | Bin 17 -> 17 bytes .gradle/buildOutputCleanup/cache.properties | 2 +- README.md | 28 ++-- build.gradle | 6 +- ...eamApiClient.java => AsyncBaseClient.java} | 8 +- .../pipedream/api/AsyncBaseClientBuilder.java | 24 ++-- ...ipedreamApiClient.java => BaseClient.java} | 8 +- .../com/pipedream/api/BaseClientBuilder.java | 24 ++-- ...ption.java => BaseClientApiException.java} | 8 +- ...xception.java => BaseClientException.java} | 6 +- ...ponse.java => BaseClientHttpResponse.java} | 4 +- .../com/pipedream/api/core/ClientOptions.java | 2 +- .../accounts/AsyncRawAccountsClient.java | 85 ++++++----- .../resources/accounts/RawAccountsClient.java | 65 +++++---- .../requests/CreateAccountRequest.java | 96 +++++++++---- .../actions/AsyncRawActionsClient.java | 78 +++++------ .../resources/actions/RawActionsClient.java | 58 ++++---- .../AsyncRawAppCategoriesClient.java | 34 ++--- .../appcategories/RawAppCategoriesClient.java | 26 ++-- .../resources/apps/AsyncRawAppsClient.java | 36 ++--- .../api/resources/apps/RawAppsClient.java | 28 ++-- .../components/AsyncRawComponentsClient.java | 64 ++++----- .../components/RawComponentsClient.java | 48 +++---- .../AsyncRawDeployedTriggersClient.java | 132 +++++++++--------- .../RawDeployedTriggersClient.java | 96 ++++++------- .../AsyncRawOauthTokensClient.java | 22 +-- .../oauthtokens/RawOauthTokensClient.java | 18 +-- .../projects/AsyncRawProjectsClient.java | 21 ++- .../resources/projects/RawProjectsClient.java | 16 +-- .../resources/proxy/AsyncRawProxyClient.java | 77 +++++----- .../api/resources/proxy/RawProxyClient.java | 56 ++++---- .../tokens/AsyncRawTokensClient.java | 38 ++--- .../api/resources/tokens/RawTokensClient.java | 30 ++-- .../triggers/AsyncRawTriggersClient.java | 81 ++++++----- .../resources/triggers/RawTriggersClient.java | 61 ++++---- .../resources/users/AsyncRawUsersClient.java | 20 +-- .../api/resources/users/RawUsersClient.java | 16 +-- reference.md | 12 +- sample-app/src/main/java/sample/App.java | 2 +- ...eamApiClient.java => AsyncBaseClient.java} | 8 +- .../pipedream/api/AsyncBaseClientBuilder.java | 24 ++-- ...ipedreamApiClient.java => BaseClient.java} | 8 +- .../com/pipedream/api/BaseClientBuilder.java | 24 ++-- ...ption.java => BaseClientApiException.java} | 8 +- ...xception.java => BaseClientException.java} | 6 +- ...ponse.java => BaseClientHttpResponse.java} | 4 +- .../com/pipedream/api/core/ClientOptions.java | 2 +- .../accounts/AsyncRawAccountsClient.java | 85 ++++++----- .../resources/accounts/RawAccountsClient.java | 65 +++++---- .../requests/CreateAccountRequest.java | 96 +++++++++---- .../actions/AsyncRawActionsClient.java | 78 +++++------ .../resources/actions/RawActionsClient.java | 58 ++++---- .../AsyncRawAppCategoriesClient.java | 34 ++--- .../appcategories/RawAppCategoriesClient.java | 26 ++-- .../resources/apps/AsyncRawAppsClient.java | 36 ++--- .../api/resources/apps/RawAppsClient.java | 28 ++-- .../components/AsyncRawComponentsClient.java | 64 ++++----- .../components/RawComponentsClient.java | 48 +++---- .../AsyncRawDeployedTriggersClient.java | 132 +++++++++--------- .../RawDeployedTriggersClient.java | 96 ++++++------- .../AsyncRawOauthTokensClient.java | 22 +-- .../oauthtokens/RawOauthTokensClient.java | 18 +-- .../projects/AsyncRawProjectsClient.java | 21 ++- .../resources/projects/RawProjectsClient.java | 16 +-- .../resources/proxy/AsyncRawProxyClient.java | 77 +++++----- .../api/resources/proxy/RawProxyClient.java | 56 ++++---- .../tokens/AsyncRawTokensClient.java | 38 ++--- .../api/resources/tokens/RawTokensClient.java | 30 ++-- .../triggers/AsyncRawTriggersClient.java | 81 ++++++----- .../resources/triggers/RawTriggersClient.java | 61 ++++---- .../resources/users/AsyncRawUsersClient.java | 20 +-- .../api/resources/users/RawUsersClient.java | 16 +-- 79 files changed, 1445 insertions(+), 1377 deletions(-) rename build/spotless/spotlessJava/src/main/java/com/pipedream/api/{AsyncPipedreamApiClient.java => AsyncBaseClient.java} (95%) rename src/main/java/com/pipedream/api/AsyncPipedreamApiClientBuilder.java => build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java (74%) rename build/spotless/spotlessJava/src/main/java/com/pipedream/api/{PipedreamApiClient.java => BaseClient.java} (95%) rename src/main/java/com/pipedream/api/PipedreamApiClientBuilder.java => build/spotless/spotlessJava/src/main/java/com/pipedream/api/BaseClientBuilder.java (75%) rename build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/{PipedreamApiApiException.java => BaseClientApiException.java} (80%) rename build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/{PipedreamApiException.java => BaseClientException.java} (58%) rename build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/{PipedreamApiHttpResponse.java => BaseClientHttpResponse.java} (87%) rename src/main/java/com/pipedream/api/{AsyncPipedreamApiClient.java => AsyncBaseClient.java} (95%) rename build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncPipedreamApiClientBuilder.java => src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java (74%) rename src/main/java/com/pipedream/api/{PipedreamApiClient.java => BaseClient.java} (95%) rename build/spotless/spotlessJava/src/main/java/com/pipedream/api/PipedreamApiClientBuilder.java => src/main/java/com/pipedream/api/BaseClientBuilder.java (75%) rename src/main/java/com/pipedream/api/core/{PipedreamApiApiException.java => BaseClientApiException.java} (80%) rename src/main/java/com/pipedream/api/core/{PipedreamApiException.java => BaseClientException.java} (58%) rename src/main/java/com/pipedream/api/core/{PipedreamApiHttpResponse.java => BaseClientHttpResponse.java} (87%) diff --git a/.gradle/8.14.3/checksums/checksums.lock b/.gradle/8.14.3/checksums/checksums.lock index 3559036ba86a08dfcf92f96460a6243ed276e111..2a723b7cb34983c7a3195b740f3641993750d949 100644 GIT binary patch literal 17 UcmZRUdv_zmTQ2Mo0|Z-Yceja34R$ezJ%}lotlfLJHJwDr6zM_sAiWeltSA{F zBi5iVKEx6Ui4hVNJp_deF%c@kkRGaskRc1iz(zzw*!}&^M)Z65@j2)FJ?Grtx#@Y9 zo@Y>bDBU$asyOr~` z|8DQb$t&;nh!cxrRkE@KHl;k9M8;udSv++3EZSataO9a6*ITS?7SkLOoqiYN!>P@`%Ma{=DDmJW=CZllm}z)@OpF zgnI(y9NrR?@kfAj9BPnzoCS;pB{XWy2c2t5fLiXaK_b|0s!9M5HbuvB(8nzivef6% zsR_#s2Ty$tVvi3SB(N>o0@|tK$=|W$azuc1~<=9I+ zAti~AVcycSf`*8IEp!WL_2UwOf(HaitP|Y8zH{8H>F^VbB0-Qst_rIJMeGuk&>0m~ zDO?nw_hFhq#R^F!{Hl7q1Hzm{d_cmZ0lrc#g+(*CNGx%Ip%H&U>ZIBll2XLMs zfHXlDUJ*=To1h3KCSfMV*JhMxIfp)>BgWSjQV=y&HYC(3Qfqs0A;$lgQAyOl!2%_U YR delta 999 zcmY+BUr19?9LGD$@?Z3C!nQl-D$!AcT@1n}!-vG~b~l?&e2^*PgNzU#OnlHNA3}z# zL0?Abc4rYWM5MwXXvmQAU*$tcMD#F3#6T=eLL$QMIlqnSK3qP(@A;nZ_uO;C(=0sA zo?bDtE;N`MSp*TY%tDyc-;>xer zt6#r3@a~X!0#2+-CKku0lwwVYSWRpXkF73)@*W?oDHg@eaue%Cto*LQTZt-Lhoqj* zNBM`>Uq$W&6S=5)Xg1j*=T|#J&y*MPfFnAVb8!9R;6iClwqv*Nn(&4@p z;{wJVcuO#Z-vTC_kQMHk7(Is$#xq-Pqm(su#-?~hm(Yyqv!^rB*^4Aa}HH1?@9Ea zNtLkX;fGE1VcWw?6N9knYDg7oB}Vk&KrPcNG$RFE`iij1J2fi_C%(h(6^Ga$;rK74 zg(I;=g0UTbFYnZ%81nKO?Ga`OMv*1h#wnkKppO@8-!S0gADYaSo_-07k9QI6&{qK}ja~_UYtfPK^h@~kBAd&U{%19 z69)t>sPT(kS#%3nx`h})Kb8nu@RPs^XLHURY?d(9%)d;}n%9RxF)U^g)rZgdVK48m zYT+A~JJCikhA=@t(gYdo2v{kEJs{zFfd8VETDly|6y^f_ww5y_l)Ql>z;A1%7Jl8% iT7|ukRvoV~_Mg3|9%oy*eK`Y9tLx<7pyFPAi|Y@g&Rm}W diff --git a/.gradle/8.14.3/checksums/sha1-checksums.bin b/.gradle/8.14.3/checksums/sha1-checksums.bin index 54c347be9e8b048cde17003b07c1302a0fef09cf..649f7ed95d0193bcd868701341bee5d8d8d1e6d3 100644 GIT binary patch delta 4397 zcmZXWd0bT26~`eih>9RomIpX9FeD%%hzkZv5vgUFjoBDrV1{AP#3CU?4T9ic2^ynl zlOu^rT+kXdh+xoAUZ|JBclSz&+pJIlpt4_ui$W z&Ay|}zG1efCF^8O`OZ6zcHB?e(_#K+m0i@aO2PR>$dzj;|C@K7F)qBZ4|zhJjkmuH zI<{-bh+He6{3AQX1eN=2o=a+Mye%$F)T~=>!2(Sq71oQp1f{F~Gsrh?w()T3kx!k%x=r0@1IIQp5}GNCe&HyZIx~c zMnSO~e7%Gg(6(=}_f6L#G`*n7Rh0`m4+ri02DxS;<)40aKDy3tN+)u?1Ld2;o^N&k z@M#h9G@Xs-ts7kKIrRwg>_wDUf981R9Ywd}XcW>zq0~z_ci+vr(lGs3o(NNq(Cq!Y zvt%XN)R1?Z{sWrw9)tPwBAn z;i1TOx9~l@$x+JxCET|^wCoE#a#JhiEfJDPm(>jdtYy-Now#a`l^3X#HqnzdUy|gFMFzD!n}{&#Bt}&~M??apUg=xN*MY{)>aiKqO=YsxD>_3h+O zEO|ci^x@$fRzpjL!>nX1&_~mPn{OX>UR>L84!I=P#vy-F>G_N@cU+x1@c zKIFz_P~{Wq6+zYR3GWPsM0D2iZnMD2R~Xonx9Gua!Mvb~irdBGkE5D30Fx#QEsvj-#7OIz)wBWupA~ zuIgKbyELuH6DugUZ=C9X$1(qVGS=*{a98gi|BhU1rF_Dhr>ce|*%y#2 z@+fz12s>+Zs^LEt>D83Gc)9ysd#+xz8w)beQNh(tzCP{c!Mn)iRW`mfuqMm(Oa4t! zU83Br*R7`HS7mB5(q8ghIVCr zF{L2xM$jo&# zH+Jsrwa2%<^p?2VDR-5L5iP;MR~BQ zR%bV#|0f`=lDepNYY|)f|5E>Zgk&vWwCM;fBME4%FSp0{r#U7c{ZVsNl$rBhJRqm(k))dm1@ct zkJ}VfKB~l0j6&9Nn{Y8Y;od{bPUM!J@rFYs52Jc#oA zie_tCtuhbulQJoP?{c+UJy&*BOQGVZ&6;lZH><%?Z^Ct5+8CrnEk!-i|ZBZf6n5+ z+i4j%R~-Ty$WP`>$bf<7WYWhk0y^2iq~wEAB?FI8iGqnrvNpdJXzh9eDwM>@ zZv`|eiIZO|^x@zE2vmgl3qXs52xw6;kgp=X{v_b!6=21I1wzyev}ic_Cj6jbz^vth z2Vl`Mus4OQ%71`sJz{1q6lut+crYq05*{kuV5QoFg<`z8?5|IQCM}tu*cl$M9*t^Z z$Oav3t0>M;jGJ!X)(3GKlIm}T0=D-SEomoygKOuyss@ZHoKY}TrZ5n%=G0tH9jUqt zgV-h*M67Dna4LRp9U`sZ#5s#2Ac}SF!&-l?);>`P7gNYW#As$G>xMiX*D4gMbqs{y zMED0@t^|8juR*Ae97e!6&S>=QGT6;20cyCSBYPWQ0f$sFNRmKwD#=YUa=CT}1E|wT zkE9i_Dvg2AG_o&AE_p`Q+xWpJbiYBLy+ z=sBw%*qF}1t#mH93(whLKMi93H?5zmk%Yo@Jp)HEh=XlnXF6z zvD|REA`ItRj*q$BS MBto*suz$n<3;(=h3IG5A delta 4464 zcmZXWdstM}8pcII0z_0qU;{FE36*1bNg<7!9+hzzW?=4I28IF6kjRini8!NKl8vPJ zNr+s8l)QxpMIR$mG!q7IgCYl%5INu>A`cpQQ1f#3+TUK2KJkao`hM^GUG|=}*4AvY zGMlWb=erq}e{s3_R;OYZ_m?#H1^>4pov9pYb4QCjJdE;}l^LM4r$^`4;=2RpZ|tU5Z>jmU82nX7zvKCR@FOf-Id1TZfOGa&`n;U$P?@+uj;H{eZ=e!$;?>8 z5!)-idA}K#peJ#Fda6g?URCMyK?w5bD;EC8p?BLRxOeefNBPm=x}KF6@=qZb=UVt? zk3$2io8pnn+AZ8PZp7;E>I`Wp#GRzVF~{v8o$d#9$TfMCpO`ySdTO2NDc>N9@{?y$ zcHR{S?LwZkhw|^LGLGd4`o2T1T0{BwOV4W-jBPbC9oN4`uJES(yw}z7HVWEOgWSC zrWpmJHU7Vrpg$(X!dC|$Gi-e4+IW7V$rfSX+`1!^as!ZSXH$M{P2ZGl@>{{kbq$o? zJo?csR=;+|yIImkOP-`^}l{2S3IH zX)on>ZmsmMP5m$exg>z{u0ZDdrJH_sK`wg>ay$iw-s#=W&2d@P2*rcc{PU6>pHpS302`6?Ox5sNK+sHHGZ z6Yq^&wGh(01crytYe%isI`a2{s)L#z`Q4q|JhYO(Ds|5&fBbQ@X{fK^GyaKWls~_* z{lM9rupP)n^C%ytX-*i%WQ{?tw_M%BORSSdMb_B8hk`~0E)xX?yA|md{b#lD_oud$ zR6}MStC5RRDStD4gUR=DSwC{cIm!dZ{_UJ` z>nPQ?$hFNDUj1x-Q|K(adK40C;hDh4pe(VQ+FezSET)*6gQQ_=?G3wokc(O=5AIUE zQ5=4a-@l3>%ER_&6%IRp;P2>{=TN>(Yd7wROHmSXb-#t5aD$C!M&?7B&$LjXul1cD z(@jtKW);*VTsAm={Qaq^$RjUNE>g~P>Kp#e1iq*NT6_d!A~(-_%V=HvKOUX{n@K)S z3rlu}?sVh#Wzs6}nj|pD3qq=U7YQ@bsCS@M<=2f)pIF;|h+H;;a^-GQP}6k}{(G-b zP_8N+^_lptEq~caohVm#v{oxCnp&}rE|zjl?dxBENjddBmgL+Mcqf4rc`wRJB4 zRI2@yzZ>8^X?;QNW~{$Fp7KHiv*hQfSI0_j!#ZfLGw8$403;9JBF0$dDe=Zn! zAtYsX`$5$5R|1l>+X$ywn!22`V6a$3g5t@LAR-oaQ9u`$L<~5J+(r?KlaI893(IE^ z;ETX(12l_fkUW2|ir@;=Kmc8&;o=nRjhI7{_-k>~VQ>|bq!MpfA|^>ClObEoz+eQK zrNkGU*q}hn1^#f94FV#`7$y8?-F^ksVu5t%#RBWVE0Te$mvn9k@>I_#T3^-xn0Xhj8=dY9jFDaRzG#9H)y#_53@*+z4Z;4_Tgh@&H(!G!_ z<%*C619eiaPd~J?L5P+M1|U|;fG&yzWzLWj#lS<(R^|$0*`N>=71TtLN@cmwhl?8U zj^;=&D7eKQTR0cZKzcMO#RWv(qlY0*E_Z;LG6sqiWcG3qH@kIoFFc5H27%m_wU+B) zp_~Du+|7Xv@EWuU2CdSMh#8QlWMH9^OJ9eNUS0`z<>b-Jd0_T}R@qCyMza9sA;{)Z zh8qW9P(fZ!`6lpT3p%UFxNP9BVjxGxRX3vb<}UD1aK-S&j@wuPi{)G{z#4W^vx3Vl zgnk7B=j2?lA39h?k4i2WSfxhBD`xij_vlDau?!?S283Mm3K68J$h)eLKruT-2ltE> zDtyM{3t+E`G_9zCYiPR!wrb+9KMX-?vYYGq-K^C@ubO!4Tfs%cSvo;P7aKJUoL7_f z^_|eEW*|>Z9=E;|8+n>xi-t??gp-)l4fnW3gCAtZk#g+fa2x|Jv7`zc%#LNCGlmOf z5W*@4V@Syc8J3KD587kN8*IoxFfkHzF{B5ddlCy7pfr{%PZkW^Lz)40*p!s!yT3FB zA*KZA;v`cBxW;qD2;x5%43x%`flPJS-!2ViYDxc6-1p7#WOh>>48${VSo^Z|wNTz_ zYUYke7k6G*>ofMeWYQp?4K^i^B8|4NCxHPm4ak9Wr9oICnXNGZ91{6%H^ND3Uz1F{9i8l19$#{yOp?OzS z-j1*CKJ#mw!tRc3i=f4XquN)qfy6^9oN^GW{iEcl{I7t4Q{oqtvw-xLv9|3RSp#EEb_?PSJg zc=)Ka*w<=*+F`+6ZmGZYXYS?Ywu|NI=IY|f`qH0mo3gamt@3vLBq7dyXAgz{>rdos zMVti>m#;&8Nt1KVk|GWq z#4_Qcqa^2*qa81C7uufG=lHwm@X$)PsFnE?ZH-Zl;Zb#CmFmM%x68C*iAbrdl*gYO zZeEos7FP0rX}NMx+f5Lfx=V6$-0gYDVCt?WGgbM9?RQIc4mPG~5EXD)>~gMW$X$T5 z!%KmO^m}GuI`DgJt5CPop>+ogBZ(5&=^_U^{FcD0J|5%_OBEkhvkf5}7Q~;o?`;@y z?@#%&j|9io_bDIkTKTtXA3`H;P23xkUFGmyCJacFhqRxCA>V057BP&DnlSL1~$(lXT@#G!rk4L>HK` z6vreuR?C3#Zvy>ejXh7g9Qpc~avx|4tpYr%KFb$VS>UjX9h)+59Qiwb5!_ZHlKoG^6-LKxVfANJr&&s-80WbDer-l{bv^pu`!oNn?D>GueVZ#4~_w;$*3G=4&Gksid zp#pK~tM~8KH6HofKMhy-!JhpraA#H64|nh3>IqVmpd+pxEF$@9-oK7e3N2Zd_qXud zXZ-UX%-N-Eew7qojFbIGMTms2d4C>zU#8*Ynjwwg19eWhV&P>G4uSf$+@wt2zmD~< z(P!V7FWv*Feo7%WX%zZr8Wqtzw@qXLMJ=;CeAaXvo6q=Td-P!$4tsx>6 z@lh4`(vIam!1kUsL?S)~B`LI~L%Z`Qg6KX;He2#4Pj{W2Lk2igw;B}w2f>PZ6)=ur zM?Di1mLLd1k!}nH^~%({rMTL486p{K+snZDdJ+ty5TrF|fxI#Vn;XJAAn0sbC6n|Nn;;*mUssi}U+$&l z#|J4dwCh$T9fMJC*MTmi!Q+mtFSra-r50|1|+s=3X&)D{G6=2Zro?44fH z+bFc)BHhbt6=Ea<>(x@NAJPxhyugM_)~LVapWwdJHQ$_CXr1g3lj5;Lp-l_vVkVON z6*d9>FhePXfY#7IAU+$Q`-~Z$<1ka=g#&-V~CQP>sg*ZqWkG7_wWG z=xyKWnWXQHkPXxJwlJI2DvEfC$GZ+YTV&{pZyt1s?e>r%7sDMQ{8jCPYq1sq#acH~ zYq~{eP|eU*eef1Td8-=8e2rkdl|fVQ{UvfuTj&wxIGduYPmeT0 znYM31Csy~j>4Ahd2w>Z4MoVZ=oK3M`;;xlNwU*x1Ws^u?Gh=kn=1FN=u6`o^;4}Cz zb#n=?+6|)Tz39C-+# zK(`<%28DK&zJ#O0yTdF_`d1sjYisA;aSdIEV1B1DHK!H3vlNLW*m{lu$u1I%p%7f% z^^In38`geRL|vV&>1upZ^7Gv=a~}`;Ig|Y;lrKfu(pxo_-xV#iPNVKXA&lzU0>)4Z zZ0b^%$yDWQ%@Q~lxl?4zn7;6V-lh&*t2cxPEy(zJ8EEv51aY0nZ24{#-6&#fC3vj& z^OiKL+^TmzzKcj;Gh<=II}>V27v=yp^bKtlEe=I4knr<6lKPn&UQi*@xM8hsIZ*lz zm9y&JL|s6DCS^JLIJ1hDfCb&FKw&r1-gd78{TLWMnjohKfklr#=*1A+V*t{75tQ{X zXnx7*{6?PZW5n*~ZNGL#DjE*L3K%xMhgc{)XAiqyf_i=WU<9kKeJkje4vGV3M1$%6 z&P}oFGasrI4&WM%@Ot0s?VVhH%}-p~W$SC{;d-2P#LM$9f1prkAB&eh8gj@8E3Rdx zDtWqy$Gpec_a)G>&i~jPt)mz^Lb-nJbuYMj1cON6zD55i>v!^RH7`99 zWT)PrJ35=B6)n6n$n(u0u2~-r&-W`EoEyRy!4gEw|IC$E?d&=jvC-$g@7Aobvg3jE zT>En;*xRoMVusN@%MWOP8VoxJG(qGD0`|ZfP>JEzfQDx1D6ZeV7TtjLiH8?-49AF; z*(2W!ThKI7$ZBYqn(JM0);O;4)#1>(QYiFZnO?hXR;BMuXOwKS@zqlHp#FeoXOO>;1aWeNa_~`bt>dZ|+Xh z^&L!KO((&O{7LMexJ00bSw2?^z8EB_1Ke1$EZT31Ig)5QDOj$TbPR9ph!HqwqH1Qb zyl9HsyeE_%(gmN<1+*Ia2HgIDAaY2XI*EYIoY5w(!0k8XVc!r5a;K5DIJ7~g0|A@) zQ4;rOU!!7{_+XWz_m+h)C+bVMXLtqu2bU!WHcES>O(vVAwz)dCUYWuE>+r&`8mL1I z|1&H@S2w>dzNmFHdywHjqoc$(aefw?QsLOJvStyN%lXj&0ycLhUMVj#&4_R7h$7`^ zDCB5r>J_=EJw76hIw@izBN+;5;5_WHq$}0h`&i0!>Bq zZArLflmxR_lO0t7g$oGGMpuDZ4DO@qAp0YNE2C?`2!`6xwbY_Tod3X|xC*s@mw-xR z3Sbb0;Fd9M!1;vW6aw~V1UJTXK_v#caY^`bOb)~cJj55epc})UaV98WBZwGhQs)q` znIXRDXfl4F0N;<3;OVaqr!P)uQZJsxQs61HH(dY2fV(D0P>VwF*aQ>A1|mqE(4p2M zK%Wa5#AT>iDhsEPDL4peLX&#n5eCyqZ4exc;N+wxD8`VBASwhw>m(CA!5}`R3fSim z7*DBz`xsoOw812Xj43o1p$J}0X;9k{pmSLs9ZnaXNTbt>hZI`Ede#}-CqhdIOI-0= z%z12xqobDFo-p9v4rHfQ~k7XN44;LH743 z1cj#!KuS0Q^JznB0|IouOXCyqnKaCpCaF;oIP_S7h=W9x1bj1%CJlw)`)Ossjzl0f zqXh~uY?;vp-55^I7=kNN2=2_NfCdbmGiu=C1q7nA8lVot##wC;8I8bmRufcW$edk6 zT|~fUhT4*dowYEKO>7%9MWD7=^ByrP?(8%4^|WzVWBQYThmsYG9UC zT_z@s_>Y*{cW*DeK?(9=d3s%}lYtF$x?ma)DLQWi@?#KepH~5G82sjss!nb0=fCW* l=Xm(#xMF9)025Tp_Z%$w5OUqOXcM$KV<+5+|HqXt{a>{GNV5O{ delta 4909 zcmaKwc|4Ts`^V?WO*NGs6GnDP$Zil?DD9ks%IV}-l9|d9(^wMOLW`7+n~=4ljU1W| zX%iJ?$-eLV60%Fe_kQN|`@NiR=Y0Q|m-l?G>vP@9bKlo9FX5A17pJ(=jrS_LxZ2pA zKI3@S?HI#>N!Oq|+c-NiogC=Sr*K##(5`cE&xB_3F~M_nD{hCfz4j(90a0Hos-c9T zF$nmAfMsX}rl%298ES)?83eeIknl;mz1wk54_nr88xI;ogQo7LrEaV4PWN~5}%lVx8kOaV#k{1FB&`?OU=y3!zh!EKS+@G=l$$e zKeyxXbgqi>c9*kGwkCE=2A##QIklZ>XW(eZaB@|)w{f@O!l&oVmTx}f5Ne^Mm@<)Z zz6R!&^7H**fiDttHGfe5DzwAR&XLYweXsWcr$y>))8BlK9;BCEb=w-2UHzwewMQ+n zckr|=4O-b!C|vj-1}U|VjUDez?$n79tG{spmV5F;RXR7@%660o=4Y!AU(^<_0xe{h zhb@EYYUk|qeQeFXDs1lBL6xX^-VHk1-f`HU(A0)1{y$wM#3Ym#r~G$So>Qz3H*MZ& zJA67KQuN5P8+%Mt75GOB%+1#LVWxXsU6}_ME=*@97smIQrW*SRcT8P| zs1mLF59i_UkFj{urt#8AV}^(Dg*kx)#w3wHRu`G2QK#fE98vbgAvM)H|4;Gp7G+O(cVHCh&^_VYTW!yR9BU?Ze)cw&4Kd#h zkk^ln4`o_~Y(4A~m#VO=gWi=H26G+w!@O5P3qO8#mfr8{=Kv4LH}kX$R6M`m z`nB98C+}_S#4ElS{;P&pl5@tFKfk2(?YntpmY1z^)s&2TTZKMzejqn{($WdUJLFrl zuSfoZQ7BsBRzi$QpZSC4nz=iijj%k<_&HHBY~ARmOYlNI#epKhtalA-rgl4I<&{F~ zJL_O+j1=4zJBydPxPNAr^V*X7Cvw6L^4wyZ#NEIsCrn4Q*{i*O3h@59nJ51&340Eu zoJGSDd0=t85L8d-$7^1`?=$qOe7j85^}}r8l2FtK#KRKT!gnPq@OA7ec6=fW;FY1= zKKeOXpZdsAD_Ea?J;atw-h@&5M%ioJSAH8CtQK{cil%mAPvPi&X?Donqg)hmL&tdo z*5`|FCWLp7`#tSKN2xq*11x>bo3ttZtW7X<|BI|8p%V z$kv&~z@ULFr?ne%nxf11F<p^6-vx5A4^&->|-MEgk!w56h5!p2rfNCE9$RP0PhJ9s@DMX z1enyTfXB}f1k@{mK?0uCON0Cu2pa1*_)a76r$KJCd_xOg`Y1j6Wr?i{g*zEs!=e_i zVo@(A;m&5}{F4*h_EU1lqz%srMHjpzs+3D&2|rr?eo`Jp*^Jgbuilj9dN(v;CT6*Y z-z&m8BLqbowt%O~I znJ!CyS8)gI`%T}{IDM5zFADh68ja9ST)w#9q9_(0dv!GJDAg;r5lLy??}K`K(tH#Q zXSUj(N}PtJjVk2iw}ho!5FI%yH!759qJVBBLCvOhRA(&$ zPFs_6m$RgdHuUE7cQsF;fIlr2Zf&JfGp}n&9&loq4&?RMTX;)$3B#|_=G+;c)|p?RAwcvOm_QEf89{Od2j4!i%x z()Wsp;fi}^hlhYp-!V`8B>b7qOffcB-Z@W6V00FunYS?Y~;<6NMYNsd%R1(s8DYPE}r5$zoIbK;; z_PVp^Gds+Yl#ZwHFkYD{7iE^(FZ>oL3`IM3lXE$iQ5u#6%dSX^k?=$N?Bs6pB)`%* zLMbfsD{6w(M9qOqOR!kDHADm!bWlJc(qMDP2CAqc@0kko8=9WKcnIp-vrN)zh~!Bq z+_?jMMhuU3ZX@5XCB#`->=yj}x+HwxNdY}bf-Rl;_(J{@g8$7YsiWu$jNylfbhwR+O$a1wFdAkVpP9kg)`KG*VoYgoC}@5dpj#N~SkP z-RhfH-tnlBs8}zBE;BPq5c2j=$PFB6Vi|T5N=2_lkEtFGAKV60dR4(k6o;+7l0qk@=wn(% z{k6(GmPS2xwY)X0gz=B7klH5$g4$4)exHcYVS{b4`52z9aAYT6$WtIuiUR($z*Eqr zPZI>UqpZ|EMUY28Q=c-JC4jeI39vg5==CdtK?0on(Svw=4V#-MvDYQ>go%$_=YrAw zGQw7^Ppncdx$H7Yx%BexW!J-bokaPEo6+*(lLg^$KZQKTk%m`e5perme$-c81tj>^ z7CwKgzq35AjBl6i{Vu{&4>t{Hflr9x=>c_+)Q#ZYz!s4T1pc&}tI&Q-;f!BmoYoKZ zF5D35NbkA`=Lh74s0Oh$BlEt_$IBJhT)UxrxT%N8FO7nFpOipIFRH@)Brdd>J9WQS z)&A9mt!Iv@v_E`Uj{^R*ELV81KbU-lyB7>^nLO%lI!A&5GfZ)Mx>-!P- z)4mC!Y3SX1(xZC)NKsGG5_7n7@HOdzn+t>Gg0BD3bRo1pMP0ISdHWH`c^x-aT3 z{!gXh%g+?@D~@ylpyi5X3!$rL$x`#`S#dMN#^S?do*^^l{3zkM=Zq54vW1|`2n7@% z32q+IAP0{Tu_9;m+H86z3L{YLBa&bWip7i*v4V4`Ppx_(0>LN+bRr1~kJ7-S2?VC2 z+Ta@jS4Wk>n@I#Yqw3^I1nAe91hUP)5`lta6!3To#T3WXKraC{V;UfG8bS1!CiqA| z#h5B@&=t%Y!ZgK8|k$@m~>q z8&?Ho1gK6ZfCU1qCltZsSp=aIYUC~i{Brc1e}?Y0qF|}5~oziEeQN+Ra~g})nXykkoCuR`P?7#Qql%imKPoK zz%{=r^md)r25$&3n3e_O1UOA^1o!MhZEPRsIfj_}^q^kgkbUC6|c4@t5b6FYu+e)gw>CsoPfMU3T0+OBxO>_CrC?WUb8 zzAopVKZvBMhGz@HMNc}DZl`zo#j)g|!HgN`4@4uy&gg>pAOsCFvY?m%?ytw?P3;0> pf{i}9iUg-lo26(SKqW3kPCg4NmN%b2F+Db|`)nie|EWhI{{eIjP2B(h diff --git a/.gradle/8.14.3/executionHistory/executionHistory.lock b/.gradle/8.14.3/executionHistory/executionHistory.lock index 803f780f8dde8379afc6e668f28c29ab837c67d6..22f60fb19afc9ae6815fdf56a9c81d02db7130d5 100644 GIT binary patch literal 17 UcmZQpxbG`i`8V%80|c-G05FXN8vpwDB`DifI@z<}fqrEp)K>-G}G*$MU;BpPuLYUibC=Ue|R$_jBL(Q%|{SPr2%s zV+6@lj1~O!KiX73$I#4^%;da%jFU^=vvKHjXjS5 zD_4UXmwavioVVyxQMw8RR;dz=h5@T%5{Xko-B=RmA_m5-Zpa$%sfIffOvan_pERjy zaOH#rR{zU!#MoJ{)=pYIpWEjTK*PpQf5g1zlB&B-+!ou1aGMT^Jpv}$OI%Peu~brl z;kFj~bMvZR*yldvUeWQewOxn`+d$Le|7qK#>^vZxYt0oss`1R$LjpM2`RQv8?fj-~ zhLrbgoP#Vo3;k<4drr>$?g_Vf^`OGeLsHbxZr7qJd4@WN`nkX(`~2~!IZqeU6wnRAq$ zZ|38_Mjnmg(LCYpGEWkK3YUcjS&!Yit-pOci}%QF8roe74b(@s&S*sBJUas14`Bxf zyKs?#8A%vmVBuugdkQ9dJdV^PE8C8)JCOc+h|S5eLe>CZs$wNj z;H~F4_0cWQyAT{BVD@|?`r|5s=96q&o}WWAu^!~sH#p6#9okUx?o3#DF~4F2c-iR? zLIu~=j7GB;)$P{6C~pB8-b}ZS{*Z;<8Ed-s_z!oTD|H%9$`fTgr4D~iRoe}R`BL*4 zC0l-dsr4WxX7kEPyM)=IPYCysbYQGEOS>Ar-YkQq$mJj!4GeUo;UTwt3$Hjq7Sng; z?&y6>E*waj^k!?!-bzt1R!rCcei2e*`3SwphMC8DMwZmb%EtV|eV#vn=K>m}V=gin zcy5n64!m%e19uqu2nhBuBBP-EiHm9G2mdkj{Ei2&Q$HLVjjDu8E_|Ygz7aql^0ii)s-1nnVy86(^+`5`!pB&C-a%g?kWOml4QPJC)V(m3gHI5{!4vFeKzRx+40ODL zWQiav)b_vWVQqeW!8d0dLT*$~BFRx?I(IP52pSF|t1Q z{>ThYOWA9C0Lz!sqWVswjDuhB!%~_{-!AT}dH&s8O#gP8cB-VbSX0Aho3XCe46fcs za-z-X1K05@|zy;klfS?Tch?P~SlAgKBND_}TUE zT|wv4!|lG>Q|LvGMD+3W#&L#DGwPT`?>uf$JMgZAX-ndLHM`g`hL8R}xkfYfx+w86 zXAG@^;R^bAdP6a71${g(4I$^i5>*_i;K~a2f|ZG+=6A!C`P^7nvEOy_yk?XhICk4x zELJ?bxah+zlodCljxeO{c_s~A`r)jOt!uB1!%%WGUve+MM_ zQhc$JF5NG`C&dafpM~R7!fyphbT<`f9$oU=CQ;O#Go0-4mW!6aI*iTb2M7uiWEEvD z7xeQ-PJFd$`<&lvFSv19|42^Ly8**=DGr6vK>fBj&8YqQP=*O6xAp2U^Kj%?i=3L! zJEvV=aBANRw5JNP+JGIWs>3fAesRE})a1!f2j1Bu=eoID5xk1l`06Z*R?&2N-r@uU zy<_l{TlQg8IP2O9Uk+{{mxFU?V4&9s55wum^gQFj@BKs0B~na|pb7W7!ZU&?1R*0r z@NZeTGuZt7_I<*`S6yFw2l?@wUWtPmZbT#oJ=YDc=W6QT{Nlay_^!~RDd`a+!d+HM$$m96qwDyRwQ$<7Y8}`3O6~>qMM6 zEh{!568q9fDcib@9hPvH^;ts8CemVx3|aEK-ew{8?qe=0qL#K?;Dqx#v) zc^c&xzKrzGt=Q8)lZ9_xM%FUg44uejP{M&`&u32Wx|IBCqgvOzn;VHHNw{^{V@6Oh zAT#n`3@Z|3;#tM2^P6QKugd)?-}mCCk2xjSg;R7);TS_kxHY7YoTX_AD;rSC!14rg zj;5BdmFSKk6S6h*6(=5nT+ z4nMizZ*)lBlQZ7vb!OkK@m>>@eCKZsq4Sh9wcX@0sOEIrzb6(3x5XZjZf-7#%;&p* zYw#6DP?79M{bDI%*>jQ{;rW~Uu|y8RvbOm zw{p+ytNdi$8ce4sX`1omGAIvwvz2*EW7~`Le%xOA<9F4o`9OvoK^D^utHdz|Ry@W% z4&;!=({WoN4z_MB6!CPh^ADjmo+gvC3bz=@`ww*2P)mUV?hNF5Ac29rA*f*>`zhMi zP`#o_EJ+o~H6*N;!ZLx@o_mEHX$34wprc-3gqQ>>r?`OK3>2+G3j^74kR;Ns4Hw{; zNaeCma5?u=^m76^iBvAfgb)SPCsH|uBQ7w`dOy5opg0G%Nlax6mNQUv9c4*WuHY{& zXK(}-aZ=n#qH@{qlXJEJ{k2psUxM*#8F>Ip7|3kHCI$)vaf)}nhYk(`V3ACnbNa9- znUyc$0gMFPi&X7znkDXYhWAOmgC=9)i7C4$%gRUO|2m;6 z;Ctg>J{cog_{dE74DsveL?e%L$2uA>Vi_*36J#3~pE&LN=E~(VW9gOTId!3&7QTnm zrtV?iXeJqSKv!A7K0}Z-FTALn?mY6Dt#w>zkjbHZks-dXUT%oWpn<~f0~s_>+5w#7 z;0}5+Xc=kZVy^l8-7?JlHeNm)Klb@~`Tm`%c^XH!dYZUqj%Y$yCRI;2MoFe1yW-V5 z{&Du1ZTA-xD3p8a$SI4ieyQR%IVvCLnRjd=l$kV_n2E5;q9FDdIc5up&oUzU#Qw>v zRaJjCAHB-yldgU8m(8h}Gr{p%KklG@s~hJk1hhf)dU(jYT41c86FfzWD`*#@ zY?0LO?9kk*lYJ4rmG))2V+zRTM5|7|#(n0}Z-YUT!_@lT{g4v(l#{8R2RfUh#b=g6 zJxO!+Mx%mOk-PwR6*Q;JsW8kD{6CHx66|i8SlzwLqv}q4R67rpv6rz_bZg0dP#~Lm zwMGN>5r>`%iXI0`jV{i}6o*UO99cQzNIe;CTtZzz#!qSo6=zW5FIW)Vq_b@D1kp0s%?Cjr>HJh5QI96FE#gTc(su$;<_DLixl;V?II>u|` z5T8ryi93vH2I6h-3%7JaV?CXWahg2L(AV!)^V^#|t!(Gu=cYp!y*H|t}Y%^USly-1(ANP(6i0>^wBDKZGb`E;<7enx4&AS+$@ zfn&gpA19yn-geM9YUWK&OCtLsZ3aKEUG{c9`KM6p+G*UVzXcANQs@;($vG!!2{&rk zll!2QHjS^;`j7v{L&v{Rt-d&AhIndOD=yzZw7DxftbI^Y=t39n&Z$SkYj$3VgvFsZw(7ki({DIu)25cJWjjn;K zRU<}WwXwCN82QG5qtCKlVuLH>pGb3Pn~j6N znOtI*S8R4%B3Y7`I+*143B^M~^*Zkj#QuQG=AuARp5;()HQhz$dWV+`I>(Jm<%l0) zsyq0bwz!d@uH5Ekjq@YCbrUc8E5h%qaoY@I7@Idsf}m|-EeXQ}i)_gU6kC|0ho!UL z;C2(E%-`!qijsTaWEm*&#d%9-Njo&Gyb)z(gk4q>CA0G?t!}AG&f@5(KuIvPM_Ws_ zW5VcM-5;-CULCcxgA0V|qjvNM-5iZ1wQE)PxXq;mrDLomSMoH*rb#5-SZ!l1F+skK zscts<=L84665Sk7Y!fKSf~9SMYE%<8*vfFlHV6~#CQ8hZYUh<#YqvsAT{wB(2ur40 z5pYfoTNyapjvL%khEELK^nkUCkTz*=(%;5q?d}EV%6BSizvI;V`{cO z)g_yW#)uqBJnhIwZO`YF9+8S`+k&o)3vZk^;KtG9T9HCCAw$xNVwWMLzKAO@4;P^C zYC!)vh~ciZ>WH1lCf0avy^Rgr`Va*i%s~qWK`?W(nn(x{T({>^a#c#+rv9Gf(+@MP zw{++U@olZ51|sXxuHkg=Ms0bHC9Y2INey^XN#ty zaqcWp;y;`rm;m!xf(|%8pC%YH5X}rk#=&#}yNRLX`4MDIrvlbb@LjR^@-#ij#VKzaE#To9dC7I-|13)g&@SZ(h9kZkqfr z=YHAwzw6yn?q2RSGVWT(byaf6Fot;8jG2s#fFWu`0*3>v>GCwAGC=T|>v;1_Tc^31 zdwO`$-Afxcah5`l=c1KBu1dEuYy9%2Q)LJ27v+Xt2^hUiU#$HDXY>w)OW+VvjzXOq z)YoG2T&an^MZ=ALr>{JewoMB^{nsrqIeMGP&??2zK)UAf9^9a|pInvV-il3VjxNy& zR(bKR;HQ~A$ZL$%CvNB7$H`Gl*E~K94&Tx>SFA@Q2ix%r2dOCemhM!A2@lh|@bfT( zTsAGf5WjbQv~%vAD(!W<#RUoH3_DLu2%?!P0=Pl*(dQB#%bnc!7|gmWoBp%Mn}(fE zqJ#x!jHtn$AeyP-5N-qsvK5avdL9}Zez+{!LT}j)#WL<4tIEBnMnYpD^^P@w^+H-# ztP_Gb7!7b>MhX;Uk#400XEhoO{5J+4J9F%%ObmO93)zIBn+Yl2VR$gxl!cfdEXYy= zvj3DH8rBi&AEmx4{Hpl+N@(UZombFLlHy=6J>C+!P{66RXbBd4zOdaGU=(t9Mb}I} zo5FA8?mS|`4Nleki(Hj%V&>J^$ziK3R=NgW9JV$pbs}fP(Vm2il?L!%M2n57T$)6VYgtya&FWx{u#`u-Bq${C4$IYaY;5(6{B3`sJH z@dyi}D-)@W?F=M_p_qbv)m`Z3APl3HT7?qJO)jR=t|UfUV)<-8gVuK%OWTGmG;>>S zw3UZ{Oy4?W=y{VrN(o;)F)dm*=!ofydruN3Z$7Y#GwyF9ErH+@u*muJ{Ocwiz2E$% zE3EJ$RnT+gk+}N*)-D%+8o0C1j?s!7txat=w`Y$K85u0TiX?~hUv%}$4N1F93$FYf z{tT3FBCRsDJf4O^KGh3v8K}s{;0QWZQ4HS*dPqGI8;qV|pBL0vS5#kD;6JqWk5HqK zq4OQY49EjWN6#eu7(p|r(7{zvyz|u#3sb|aA9ya> zhsagwb|eK^&eL1xXIY=Mdf@{nQ}Jc+K*kwb`ACz~>_4U95EK2d9Tg089)Wf=4b$Ze zM+QDFM+^g<8raLg`-v!xrtj14$6Svz$uTRX_%eo`U>{pak1Akh3|)v%H3*NPav%C& zCk6Q`I=ICw?bjhuP>aMHV-!^Gy_Cy2o`<)G6zK{o_hAMh3dmJZx%Vq^jdD(QEI|h+ ze}rW$Q!zv!11hojF_y}8o#1kMIWUcq;&CjMYtJN&vjE*VD%V+qp>d3yhItg6Y;(l- z40KCzo=vG7L^B7^VH!_;K3ZaCJS$%eU?8A+i4?ozS^1Z6nz?-%gcl5SreHtpq5NGTH9}Y zA@%7GAxaxHF+2Hy2*894CG;eDZ|T?914fE~6B>pjD}`P7!2kcWxKFll0tICTOKNIEIp= zh(0Gz#NNa$3t=fVP}Ni*g$8;Pjw>AehV~R%M#~$n-jjBCN@c|LHPP>X{p{sQQ%nB3 zt?v}f)!&HSX1{U-FQ@8n?qI`mK^9PTG9YJdtdm#H+VlIf;(WPx3w;@rVSE@x%)3qx zEz4;x&$VHeNcpRrRB0Qhl+UUE*vfpOLi}F&+P7LRPWg&Qcz&J* zP!UQ{m`d}heSpSPL6+9_EZA##)@f7sA$0{WYAQu<+F6oec7*h$QjA+cSF9bwncAjZ@jo~)x+QYdDwmNh2C7oeWo2J zSEVX^r%c>&RibyseBM<3^?#_7mXO}F*PfhVy9)Vfw2I~#s7j+bwVr@}y5M7B<<|Sa z1Lsk>XV2{mKekW&hSo|JfevlD2ugv*Ur*mQy5T~uSEQ?Kyz$8mJW%UOMo{Tvjns77 zQMUSUgL>NM67ObJ-|qJNUa#7B;#k2uawC^`b%rx^l2DyabA43@%?v@d?cuEQG}j4z z*B`r*;1FJ@%e|ZXive#U#!HI18Fa;8t$;j(R`)_3dpO9%T@IX~v661hdYTX!z3Fdi zO0^k$m38r_gO~i%z8~PGd0_S|9;)7r5mX$F$JAD+Sr=qLz#eR|^yFOe!qP zt~6XMdW-$y$S+XJyq^w6H}RH_TynBzZ=AVS)9AocCBwuo8qdg$qQj#d_L)?>#sI;Y zbVJn8R}C4aKIEIN6eluifi-hblu4_2CbmF&blsJzSfDa;UE;ziFLjKThc$HFB9ATI z3eUv49f~k!6^-;X1pce&Vl_QP_9{W9K3!u|rp}P!_7Pk5)OT5Z!)Z-NSr#gK<;a~Q z#iLbho!#+v745{DqWP?b_2+3+?CO3ywa*rP+w~I9K?S|UPVAM~S7~d0&Y0yAHf&pu zeHZNKeR2JE`VI13geKkq9%B{Rod2&>>|RYfv4-n7yPDSV(g#f(n84&aW?2Vs1{$9u zlLI;O`P4PkG0^0Q{%fdn<3YGF(4>J>23{26_!_}ypoLE29ly;s$#a(Vo3vEn#nWoE z;%SA%E2TwxItPs-uD17Fb+1pVe@$LJbb%=OS{wOU1>X5|I_*FtFGj@ z9I05b~&SO5S3 diff --git a/.gradle/buildOutputCleanup/cache.properties b/.gradle/buildOutputCleanup/cache.properties index 8480c0b..13396eb 100644 --- a/.gradle/buildOutputCleanup/cache.properties +++ b/.gradle/buildOutputCleanup/cache.properties @@ -1,2 +1,2 @@ -#Thu Jul 17 23:24:55 UTC 2025 +#Fri Jul 18 18:33:27 UTC 2025 gradle.version=8.14.3 diff --git a/README.md b/README.md index dc0abff..e32dd19 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Add the dependency in your `pom.xml` file: com.pipedream pipedream - 0.0.202 + 0.0.217 ``` @@ -36,12 +36,12 @@ Instantiate and use the client with the following: ```java package com.example.usage; -import com.pipedream.api.PipedreamApiClient; +import com.pipedream.api.BaseClient; import com.pipedream.api.resources.accounts.requests.CreateAccountRequest; public class Example { public static void main(String[] args) { - PipedreamApiClient client = PipedreamApiClient + BaseClient client = BaseClient .builder() .clientId("") .clientSecret("") @@ -52,6 +52,8 @@ public class Example { CreateAccountRequest .builder() .appSlug("app_slug") + .cfmapJson("cfmap_json") + .connectToken("connect_token") .build() ); } @@ -63,10 +65,10 @@ public class Example { This SDK allows you to configure different environments for API requests. ```java -import com.pipedream.api.PipedreamApiClient; +import com.pipedream.api.BaseClient; import com.pipedream.api.core.Environment; -PipedreamApiClient client = PipedreamApiClient +BaseClient client = BaseClient .builder() .environment(Environment.Prod) .build(); @@ -77,9 +79,9 @@ PipedreamApiClient client = PipedreamApiClient You can set a custom base URL when constructing the client. ```java -import com.pipedream.api.PipedreamApiClient; +import com.pipedream.api.BaseClient; -PipedreamApiClient client = PipedreamApiClient +BaseClient client = BaseClient .builder() .url("https://example.com") .build(); @@ -107,12 +109,12 @@ This SDK is built to work with any instance of `OkHttpClient`. By default, if no However, you can pass your own client like so: ```java -import com.pipedream.api.PipedreamApiClient; +import com.pipedream.api.BaseClient; import okhttp3.OkHttpClient; OkHttpClient customClient = ...; -PipedreamApiClient client = PipedreamApiClient +BaseClient client = BaseClient .builder() .httpClient(customClient) .build(); @@ -133,9 +135,9 @@ A request is deemed retryable when any of the following HTTP status codes is ret Use the `maxRetries` client option to configure this behavior. ```java -import com.pipedream.api.PipedreamApiClient; +import com.pipedream.api.BaseClient; -PipedreamApiClient client = PipedreamApiClient +BaseClient client = BaseClient .builder() .maxRetries(1) .build(); @@ -146,11 +148,11 @@ PipedreamApiClient client = PipedreamApiClient The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level. ```java -import com.pipedream.api.PipedreamApiClient; +import com.pipedream.api.BaseClient; import com.pipedream.api.core.RequestOptions; // Client level -PipedreamApiClient client = PipedreamApiClient +BaseClient client = BaseClient .builder() .timeout(10) .build(); diff --git a/build.gradle b/build.gradle index 75c5832..94f59bc 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ dependencies { api 'com.fasterxml.jackson.core:jackson-databind:2.17.2' api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2' api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2' - api 'org.apache.commons:commons-text:1.11.0' + api 'org.apache.commons:commons-text:1.13.1' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2' } @@ -47,7 +47,7 @@ java { group = 'com.pipedream' -version = '0.0.202' +version = '0.0.217' jar { dependsOn(":generatePomFileForMavenPublication") @@ -78,7 +78,7 @@ publishing { maven(MavenPublication) { groupId = 'com.pipedream' artifactId = 'pipedream' - version = '0.0.202' + version = '0.0.217' from components.java pom { name = 'pipedream' diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncPipedreamApiClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClient.java similarity index 95% rename from build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncPipedreamApiClient.java rename to build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClient.java index ee61fa8..39ecdab 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncPipedreamApiClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClient.java @@ -19,7 +19,7 @@ import com.pipedream.api.resources.users.AsyncUsersClient; import java.util.function.Supplier; -public class AsyncPipedreamApiClient { +public class AsyncBaseClient { protected final ClientOptions clientOptions; protected final Supplier appCategoriesClient; @@ -46,7 +46,7 @@ public class AsyncPipedreamApiClient { protected final Supplier oauthTokensClient; - public AsyncPipedreamApiClient(ClientOptions clientOptions) { + public AsyncBaseClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.appCategoriesClient = Suppliers.memoize(() -> new AsyncAppCategoriesClient(clientOptions)); this.appsClient = Suppliers.memoize(() -> new AsyncAppsClient(clientOptions)); @@ -110,7 +110,7 @@ public AsyncOauthTokensClient oauthTokens() { return this.oauthTokensClient.get(); } - public static AsyncPipedreamApiClientBuilder builder() { - return new AsyncPipedreamApiClientBuilder(); + public static AsyncBaseClientBuilder builder() { + return new AsyncBaseClientBuilder(); } } diff --git a/src/main/java/com/pipedream/api/AsyncPipedreamApiClientBuilder.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java similarity index 74% rename from src/main/java/com/pipedream/api/AsyncPipedreamApiClientBuilder.java rename to build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java index 0ebee7b..5759e8b 100644 --- a/src/main/java/com/pipedream/api/AsyncPipedreamApiClientBuilder.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java @@ -9,7 +9,7 @@ import com.pipedream.api.resources.oauthtokens.OauthTokensClient; import okhttp3.OkHttpClient; -public final class AsyncPipedreamApiClientBuilder { +public final class AsyncBaseClientBuilder { private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder(); private String clientId = System.getenv("PIPEDREAM_CLIENT_ID"); @@ -24,7 +24,7 @@ public final class AsyncPipedreamApiClientBuilder { * Sets clientId. * Defaults to the PIPEDREAM_CLIENT_ID environment variable. */ - public AsyncPipedreamApiClientBuilder clientId(String clientId) { + public AsyncBaseClientBuilder clientId(String clientId) { this.clientId = clientId; return this; } @@ -33,7 +33,7 @@ public AsyncPipedreamApiClientBuilder clientId(String clientId) { * Sets clientSecret. * Defaults to the PIPEDREAM_CLIENT_SECRET environment variable. */ - public AsyncPipedreamApiClientBuilder clientSecret(String clientSecret) { + public AsyncBaseClientBuilder clientSecret(String clientSecret) { this.clientSecret = clientSecret; return this; } @@ -41,17 +41,17 @@ public AsyncPipedreamApiClientBuilder clientSecret(String clientSecret) { /** * Sets projectEnvironment */ - public AsyncPipedreamApiClientBuilder projectEnvironment(String projectEnvironment) { + public AsyncBaseClientBuilder projectEnvironment(String projectEnvironment) { this.projectEnvironment = projectEnvironment; return this; } - public AsyncPipedreamApiClientBuilder environment(Environment environment) { + public AsyncBaseClientBuilder environment(Environment environment) { this.environment = environment; return this; } - public AsyncPipedreamApiClientBuilder url(String url) { + public AsyncBaseClientBuilder url(String url) { this.environment = Environment.custom(url); return this; } @@ -59,7 +59,7 @@ public AsyncPipedreamApiClientBuilder url(String url) { /** * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. */ - public AsyncPipedreamApiClientBuilder timeout(int timeout) { + public AsyncBaseClientBuilder timeout(int timeout) { this.clientOptionsBuilder.timeout(timeout); return this; } @@ -67,7 +67,7 @@ public AsyncPipedreamApiClientBuilder timeout(int timeout) { /** * Sets the maximum number of retries for the client. Defaults to 2 retries. */ - public AsyncPipedreamApiClientBuilder maxRetries(int maxRetries) { + public AsyncBaseClientBuilder maxRetries(int maxRetries) { this.clientOptionsBuilder.maxRetries(maxRetries); return this; } @@ -75,17 +75,17 @@ public AsyncPipedreamApiClientBuilder maxRetries(int maxRetries) { /** * Sets the underlying OkHttp client */ - public AsyncPipedreamApiClientBuilder httpClient(OkHttpClient httpClient) { + public AsyncBaseClientBuilder httpClient(OkHttpClient httpClient) { this.clientOptionsBuilder.httpClient(httpClient); return this; } - public AsyncPipedreamApiClientBuilder projectId(String projectId) { + public AsyncBaseClientBuilder projectId(String projectId) { clientOptionsBuilder.projectId(projectId); return this; } - public AsyncPipedreamApiClient build() { + public AsyncBaseClient build() { OauthTokensClient authClient = new OauthTokensClient( ClientOptions.builder().environment(this.environment).build()); OAuthTokenSupplier oAuthTokenSupplier = new OAuthTokenSupplier(clientId, clientSecret, authClient); @@ -94,6 +94,6 @@ public AsyncPipedreamApiClient build() { this.clientOptionsBuilder.addHeader("x-pd-environment", this.projectEnvironment); } clientOptionsBuilder.environment(this.environment); - return new AsyncPipedreamApiClient(clientOptionsBuilder.build()); + return new AsyncBaseClient(clientOptionsBuilder.build()); } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/PipedreamApiClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/BaseClient.java similarity index 95% rename from build/spotless/spotlessJava/src/main/java/com/pipedream/api/PipedreamApiClient.java rename to build/spotless/spotlessJava/src/main/java/com/pipedream/api/BaseClient.java index fbe892b..69e5677 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/PipedreamApiClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/BaseClient.java @@ -19,7 +19,7 @@ import com.pipedream.api.resources.users.UsersClient; import java.util.function.Supplier; -public class PipedreamApiClient { +public class BaseClient { protected final ClientOptions clientOptions; protected final Supplier appCategoriesClient; @@ -46,7 +46,7 @@ public class PipedreamApiClient { protected final Supplier oauthTokensClient; - public PipedreamApiClient(ClientOptions clientOptions) { + public BaseClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.appCategoriesClient = Suppliers.memoize(() -> new AppCategoriesClient(clientOptions)); this.appsClient = Suppliers.memoize(() -> new AppsClient(clientOptions)); @@ -110,7 +110,7 @@ public OauthTokensClient oauthTokens() { return this.oauthTokensClient.get(); } - public static PipedreamApiClientBuilder builder() { - return new PipedreamApiClientBuilder(); + public static BaseClientBuilder builder() { + return new BaseClientBuilder(); } } diff --git a/src/main/java/com/pipedream/api/PipedreamApiClientBuilder.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/BaseClientBuilder.java similarity index 75% rename from src/main/java/com/pipedream/api/PipedreamApiClientBuilder.java rename to build/spotless/spotlessJava/src/main/java/com/pipedream/api/BaseClientBuilder.java index 9983f98..59ed177 100644 --- a/src/main/java/com/pipedream/api/PipedreamApiClientBuilder.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/BaseClientBuilder.java @@ -9,7 +9,7 @@ import com.pipedream.api.resources.oauthtokens.OauthTokensClient; import okhttp3.OkHttpClient; -public final class PipedreamApiClientBuilder { +public final class BaseClientBuilder { private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder(); private String clientId = System.getenv("PIPEDREAM_CLIENT_ID"); @@ -24,7 +24,7 @@ public final class PipedreamApiClientBuilder { * Sets clientId. * Defaults to the PIPEDREAM_CLIENT_ID environment variable. */ - public PipedreamApiClientBuilder clientId(String clientId) { + public BaseClientBuilder clientId(String clientId) { this.clientId = clientId; return this; } @@ -33,7 +33,7 @@ public PipedreamApiClientBuilder clientId(String clientId) { * Sets clientSecret. * Defaults to the PIPEDREAM_CLIENT_SECRET environment variable. */ - public PipedreamApiClientBuilder clientSecret(String clientSecret) { + public BaseClientBuilder clientSecret(String clientSecret) { this.clientSecret = clientSecret; return this; } @@ -41,17 +41,17 @@ public PipedreamApiClientBuilder clientSecret(String clientSecret) { /** * Sets projectEnvironment */ - public PipedreamApiClientBuilder projectEnvironment(String projectEnvironment) { + public BaseClientBuilder projectEnvironment(String projectEnvironment) { this.projectEnvironment = projectEnvironment; return this; } - public PipedreamApiClientBuilder environment(Environment environment) { + public BaseClientBuilder environment(Environment environment) { this.environment = environment; return this; } - public PipedreamApiClientBuilder url(String url) { + public BaseClientBuilder url(String url) { this.environment = Environment.custom(url); return this; } @@ -59,7 +59,7 @@ public PipedreamApiClientBuilder url(String url) { /** * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. */ - public PipedreamApiClientBuilder timeout(int timeout) { + public BaseClientBuilder timeout(int timeout) { this.clientOptionsBuilder.timeout(timeout); return this; } @@ -67,7 +67,7 @@ public PipedreamApiClientBuilder timeout(int timeout) { /** * Sets the maximum number of retries for the client. Defaults to 2 retries. */ - public PipedreamApiClientBuilder maxRetries(int maxRetries) { + public BaseClientBuilder maxRetries(int maxRetries) { this.clientOptionsBuilder.maxRetries(maxRetries); return this; } @@ -75,17 +75,17 @@ public PipedreamApiClientBuilder maxRetries(int maxRetries) { /** * Sets the underlying OkHttp client */ - public PipedreamApiClientBuilder httpClient(OkHttpClient httpClient) { + public BaseClientBuilder httpClient(OkHttpClient httpClient) { this.clientOptionsBuilder.httpClient(httpClient); return this; } - public PipedreamApiClientBuilder projectId(String projectId) { + public BaseClientBuilder projectId(String projectId) { clientOptionsBuilder.projectId(projectId); return this; } - public PipedreamApiClient build() { + public BaseClient build() { OauthTokensClient authClient = new OauthTokensClient( ClientOptions.builder().environment(this.environment).build()); OAuthTokenSupplier oAuthTokenSupplier = new OAuthTokenSupplier(clientId, clientSecret, authClient); @@ -94,6 +94,6 @@ public PipedreamApiClient build() { this.clientOptionsBuilder.addHeader("x-pd-environment", this.projectEnvironment); } clientOptionsBuilder.environment(this.environment); - return new PipedreamApiClient(clientOptionsBuilder.build()); + return new BaseClient(clientOptionsBuilder.build()); } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/PipedreamApiApiException.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientApiException.java similarity index 80% rename from build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/PipedreamApiApiException.java rename to build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientApiException.java index d4d2e56..a2680b0 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/PipedreamApiApiException.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientApiException.java @@ -12,7 +12,7 @@ /** * This exception type will be thrown for any non-2XX API responses. */ -public class PipedreamApiApiException extends PipedreamApiException { +public class BaseClientApiException extends BaseClientException { /** * The error code of the response that triggered the exception. */ @@ -25,14 +25,14 @@ public class PipedreamApiApiException extends PipedreamApiException { private final Map> headers; - public PipedreamApiApiException(String message, int statusCode, Object body) { + public BaseClientApiException(String message, int statusCode, Object body) { super(message); this.statusCode = statusCode; this.body = body; this.headers = new HashMap<>(); } - public PipedreamApiApiException(String message, int statusCode, Object body, Response rawResponse) { + public BaseClientApiException(String message, int statusCode, Object body, Response rawResponse) { super(message); this.statusCode = statusCode; this.body = body; @@ -67,7 +67,7 @@ public Map> headers() { @java.lang.Override public String toString() { - return "PipedreamApiApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + return "BaseClientApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + body + "}"; } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/PipedreamApiException.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientException.java similarity index 58% rename from build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/PipedreamApiException.java rename to build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientException.java index 866b47e..e034e68 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/PipedreamApiException.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientException.java @@ -6,12 +6,12 @@ /** * This class serves as the base exception for all errors in the SDK. */ -public class PipedreamApiException extends RuntimeException { - public PipedreamApiException(String message) { +public class BaseClientException extends RuntimeException { + public BaseClientException(String message) { super(message); } - public PipedreamApiException(String message, Exception e) { + public BaseClientException(String message, Exception e) { super(message, e); } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/PipedreamApiHttpResponse.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientHttpResponse.java similarity index 87% rename from build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/PipedreamApiHttpResponse.java rename to build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientHttpResponse.java index 59f2804..68376ae 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/PipedreamApiHttpResponse.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/BaseClientHttpResponse.java @@ -9,13 +9,13 @@ import java.util.Map; import okhttp3.Response; -public final class PipedreamApiHttpResponse { +public final class BaseClientHttpResponse { private final T body; private final Map> headers; - public PipedreamApiHttpResponse(T body, Response rawResponse) { + public BaseClientHttpResponse(T body, Response rawResponse) { this.body = body; Map> headers = new HashMap<>(); diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ClientOptions.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ClientOptions.java index 5424c0d..7eac9d9 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ClientOptions.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/core/ClientOptions.java @@ -37,7 +37,7 @@ private ClientOptions( { put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.pipedream.fern:api-sdk"); - put("X-Fern-SDK-Version", "0.0.202"); + put("X-Fern-SDK-Version", "0.0.217"); } }); this.headerSuppliers = headerSuppliers; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java index 82dc947..59601c1 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.accounts; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -42,15 +42,15 @@ public AsyncRawAccountsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list() { + public CompletableFuture>> list() { return list(AccountsListRequest.builder().build()); } - public CompletableFuture>> list(AccountsListRequest request) { + public CompletableFuture>> list(AccountsListRequest request) { return list(request, null); } - public CompletableFuture>> list( + public CompletableFuture>> list( AccountsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -98,7 +98,7 @@ public CompletableFuture>> if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -113,7 +113,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO .after(startingAfter) .build(); List result = parsedResponse.getData(); - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( new SyncPagingIterable(startingAfter.isPresent(), result, () -> { try { return list(nextRequest, requestOptions) @@ -127,30 +127,30 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> create(CreateAccountRequest request) { + public CompletableFuture> create(CreateAccountRequest request) { return create(request, null); } - public CompletableFuture> create( + public CompletableFuture> create( CreateAccountRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -171,9 +171,8 @@ public CompletableFuture> create( } Map properties = new HashMap<>(); properties.put("app_slug", request.getAppSlug()); - if (request.getCfmapJson().isPresent()) { - properties.put("cfmap_json", request.getCfmapJson()); - } + properties.put("cfmap_json", request.getCfmapJson()); + properties.put("connect_token", request.getConnectToken()); if (request.getName().isPresent()) { properties.put("name", request.getName()); } @@ -195,46 +194,46 @@ public CompletableFuture> create( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> retrieve(String accountId) { + public CompletableFuture> retrieve(String accountId) { return retrieve(accountId, AccountsRetrieveRequest.builder().build()); } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String accountId, AccountsRetrieveRequest request) { return retrieve(accountId, request, null); } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String accountId, AccountsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -259,41 +258,41 @@ public CompletableFuture> retrieve( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> delete(String accountId) { + public CompletableFuture> delete(String accountId) { return delete(accountId, null); } - public CompletableFuture> delete(String accountId, RequestOptions requestOptions) { + public CompletableFuture> delete(String accountId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -310,40 +309,40 @@ public CompletableFuture> delete(String accountId if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>(null, response)); + future.complete(new BaseClientHttpResponse<>(null, response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> deleteByApp(String appId) { + public CompletableFuture> deleteByApp(String appId) { return deleteByApp(appId, null); } - public CompletableFuture> deleteByApp(String appId, RequestOptions requestOptions) { + public CompletableFuture> deleteByApp(String appId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -361,30 +360,30 @@ public CompletableFuture> deleteByApp(String appI if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>(null, response)); + future.complete(new BaseClientHttpResponse<>(null, response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java index ad4652d..e90fe31 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.accounts; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -37,15 +37,15 @@ public RawAccountsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> list() { + public BaseClientHttpResponse> list() { return list(AccountsListRequest.builder().build()); } - public PipedreamApiHttpResponse> list(AccountsListRequest request) { + public BaseClientHttpResponse> list(AccountsListRequest request) { return list(request, null); } - public PipedreamApiHttpResponse> list( + public BaseClientHttpResponse> list( AccountsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -104,28 +104,28 @@ public PipedreamApiHttpResponse> list( .after(startingAfter) .build(); List result = parsedResponse.getData(); - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( new SyncPagingIterable( startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) .body()), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse create(CreateAccountRequest request) { + public BaseClientHttpResponse create(CreateAccountRequest request) { return create(request, null); } - public PipedreamApiHttpResponse create(CreateAccountRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse create(CreateAccountRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -145,9 +145,8 @@ public PipedreamApiHttpResponse create(CreateAccountRequest request, Re } Map properties = new HashMap<>(); properties.put("app_slug", request.getAppSlug()); - if (request.getCfmapJson().isPresent()) { - properties.put("cfmap_json", request.getCfmapJson()); - } + properties.put("cfmap_json", request.getCfmapJson()); + properties.put("connect_token", request.getConnectToken()); if (request.getName().isPresent()) { properties.put("name", request.getName()); } @@ -172,29 +171,29 @@ public PipedreamApiHttpResponse create(CreateAccountRequest request, Re try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse retrieve(String accountId) { + public BaseClientHttpResponse retrieve(String accountId) { return retrieve(accountId, AccountsRetrieveRequest.builder().build()); } - public PipedreamApiHttpResponse retrieve(String accountId, AccountsRetrieveRequest request) { + public BaseClientHttpResponse retrieve(String accountId, AccountsRetrieveRequest request) { return retrieve(accountId, request, null); } - public PipedreamApiHttpResponse retrieve( + public BaseClientHttpResponse retrieve( String accountId, AccountsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -222,25 +221,25 @@ public PipedreamApiHttpResponse retrieve( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse delete(String accountId) { + public BaseClientHttpResponse delete(String accountId) { return delete(accountId, null); } - public PipedreamApiHttpResponse delete(String accountId, RequestOptions requestOptions) { + public BaseClientHttpResponse delete(String accountId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -260,24 +259,24 @@ public PipedreamApiHttpResponse delete(String accountId, RequestOptions re try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>(null, response); + return new BaseClientHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse deleteByApp(String appId) { + public BaseClientHttpResponse deleteByApp(String appId) { return deleteByApp(appId, null); } - public PipedreamApiHttpResponse deleteByApp(String appId, RequestOptions requestOptions) { + public BaseClientHttpResponse deleteByApp(String appId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -298,16 +297,16 @@ public PipedreamApiHttpResponse deleteByApp(String appId, RequestOptions r try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>(null, response); + return new BaseClientHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountRequest.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountRequest.java index fe25bb8..aeec52a 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountRequest.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountRequest.java @@ -29,7 +29,9 @@ public final class CreateAccountRequest { private final String appSlug; - private final Optional cfmapJson; + private final String cfmapJson; + + private final String connectToken; private final Optional name; @@ -40,7 +42,8 @@ private CreateAccountRequest( Optional externalUserId, Optional oauthAppId, String appSlug, - Optional cfmapJson, + String cfmapJson, + String connectToken, Optional name, Map additionalProperties) { this.appId = appId; @@ -48,6 +51,7 @@ private CreateAccountRequest( this.oauthAppId = oauthAppId; this.appSlug = appSlug; this.cfmapJson = cfmapJson; + this.connectToken = connectToken; this.name = name; this.additionalProperties = additionalProperties; } @@ -85,10 +89,18 @@ public String getAppSlug() { * @return JSON string containing the custom fields mapping */ @JsonProperty("cfmap_json") - public Optional getCfmapJson() { + public String getCfmapJson() { return cfmapJson; } + /** + * @return The connect token for authentication + */ + @JsonProperty("connect_token") + public String getConnectToken() { + return connectToken; + } + /** * @return Optional name for the account */ @@ -114,12 +126,20 @@ private boolean equalTo(CreateAccountRequest other) { && oauthAppId.equals(other.oauthAppId) && appSlug.equals(other.appSlug) && cfmapJson.equals(other.cfmapJson) + && connectToken.equals(other.connectToken) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.appId, this.externalUserId, this.oauthAppId, this.appSlug, this.cfmapJson, this.name); + return Objects.hash( + this.appId, + this.externalUserId, + this.oauthAppId, + this.appSlug, + this.cfmapJson, + this.connectToken, + this.name); } @java.lang.Override @@ -135,11 +155,25 @@ public interface AppSlugStage { /** *

The app slug for the account

*/ - _FinalStage appSlug(@NotNull String appSlug); + CfmapJsonStage appSlug(@NotNull String appSlug); Builder from(CreateAccountRequest other); } + public interface CfmapJsonStage { + /** + *

JSON string containing the custom fields mapping

+ */ + ConnectTokenStage cfmapJson(@NotNull String cfmapJson); + } + + public interface ConnectTokenStage { + /** + *

The connect token for authentication

+ */ + _FinalStage connectToken(@NotNull String connectToken); + } + public interface _FinalStage { CreateAccountRequest build(); @@ -161,13 +195,6 @@ public interface _FinalStage { _FinalStage oauthAppId(String oauthAppId); - /** - *

JSON string containing the custom fields mapping

- */ - _FinalStage cfmapJson(Optional cfmapJson); - - _FinalStage cfmapJson(String cfmapJson); - /** *

Optional name for the account

*/ @@ -177,12 +204,14 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AppSlugStage, _FinalStage { + public static final class Builder implements AppSlugStage, CfmapJsonStage, ConnectTokenStage, _FinalStage { private String appSlug; - private Optional name = Optional.empty(); + private String cfmapJson; - private Optional cfmapJson = Optional.empty(); + private String connectToken; + + private Optional name = Optional.empty(); private Optional oauthAppId = Optional.empty(); @@ -202,6 +231,7 @@ public Builder from(CreateAccountRequest other) { oauthAppId(other.getOauthAppId()); appSlug(other.getAppSlug()); cfmapJson(other.getCfmapJson()); + connectToken(other.getConnectToken()); name(other.getName()); return this; } @@ -213,48 +243,52 @@ public Builder from(CreateAccountRequest other) { */ @java.lang.Override @JsonSetter("app_slug") - public _FinalStage appSlug(@NotNull String appSlug) { + public CfmapJsonStage appSlug(@NotNull String appSlug) { this.appSlug = Objects.requireNonNull(appSlug, "appSlug must not be null"); return this; } /** - *

Optional name for the account

+ *

JSON string containing the custom fields mapping

+ *

JSON string containing the custom fields mapping

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage name(String name) { - this.name = Optional.ofNullable(name); + @JsonSetter("cfmap_json") + public ConnectTokenStage cfmapJson(@NotNull String cfmapJson) { + this.cfmapJson = Objects.requireNonNull(cfmapJson, "cfmapJson must not be null"); return this; } /** - *

Optional name for the account

+ *

The connect token for authentication

+ *

The connect token for authentication

+ * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public _FinalStage name(Optional name) { - this.name = name; + @JsonSetter("connect_token") + public _FinalStage connectToken(@NotNull String connectToken) { + this.connectToken = Objects.requireNonNull(connectToken, "connectToken must not be null"); return this; } /** - *

JSON string containing the custom fields mapping

+ *

Optional name for the account

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage cfmapJson(String cfmapJson) { - this.cfmapJson = Optional.ofNullable(cfmapJson); + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); return this; } /** - *

JSON string containing the custom fields mapping

+ *

Optional name for the account

*/ @java.lang.Override - @JsonSetter(value = "cfmap_json", nulls = Nulls.SKIP) - public _FinalStage cfmapJson(Optional cfmapJson) { - this.cfmapJson = cfmapJson; + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; return this; } @@ -314,7 +348,7 @@ public _FinalStage appId(Optional appId) { @java.lang.Override public CreateAccountRequest build() { return new CreateAccountRequest( - appId, externalUserId, oauthAppId, appSlug, cfmapJson, name, additionalProperties); + appId, externalUserId, oauthAppId, appSlug, cfmapJson, connectToken, name, additionalProperties); } } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java index 9686990..8b1ab94 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.actions; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -47,15 +47,15 @@ public AsyncRawActionsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list() { + public CompletableFuture>> list() { return list(ActionsListRequest.builder().build()); } - public CompletableFuture>> list(ActionsListRequest request) { + public CompletableFuture>> list(ActionsListRequest request) { return list(request, null); } - public CompletableFuture>> list( + public CompletableFuture>> list( ActionsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -90,7 +90,7 @@ public CompletableFuture> if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -105,7 +105,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO .after(startingAfter) .build(); List result = parsedResponse.getData(); - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( new SyncPagingIterable(startingAfter.isPresent(), result, () -> { try { return list(nextRequest, requestOptions) @@ -119,30 +119,30 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> retrieve(String componentId) { + public CompletableFuture> retrieve(String componentId) { return retrieve(componentId, null); } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String componentId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -161,7 +161,7 @@ public CompletableFuture> retrieve( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -169,35 +169,35 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { GetComponentResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - future.complete(new PipedreamApiHttpResponse<>(parsedResponse.getData(), response)); + future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> configureProp( + public CompletableFuture> configureProp( ActionsConfigurePropRequest request) { return configureProp(request, null); } - public CompletableFuture> configureProp( + public CompletableFuture> configureProp( ActionsConfigurePropRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -226,43 +226,43 @@ public CompletableFuture> config if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> reloadProps( + public CompletableFuture> reloadProps( ActionsReloadPropsRequest request) { return reloadProps(request, null); } - public CompletableFuture> reloadProps( + public CompletableFuture> reloadProps( ActionsReloadPropsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -291,42 +291,42 @@ public CompletableFuture> reloadPr if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> run(RunActionOpts request) { + public CompletableFuture> run(RunActionOpts request) { return run(request, null); } - public CompletableFuture> run( + public CompletableFuture> run( RunActionOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -364,32 +364,32 @@ public CompletableFuture> run( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RunActionResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java index eee1aa6..1dbf30b 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.actions; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -42,15 +42,15 @@ public RawActionsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> list() { + public BaseClientHttpResponse> list() { return list(ActionsListRequest.builder().build()); } - public PipedreamApiHttpResponse> list(ActionsListRequest request) { + public BaseClientHttpResponse> list(ActionsListRequest request) { return list(request, null); } - public PipedreamApiHttpResponse> list( + public BaseClientHttpResponse> list( ActionsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -96,28 +96,28 @@ public PipedreamApiHttpResponse> list( .after(startingAfter) .build(); List result = parsedResponse.getData(); - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( new SyncPagingIterable( startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) .body()), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse retrieve(String componentId) { + public BaseClientHttpResponse retrieve(String componentId) { return retrieve(componentId, null); } - public PipedreamApiHttpResponse retrieve(String componentId, RequestOptions requestOptions) { + public BaseClientHttpResponse retrieve(String componentId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -140,24 +140,24 @@ public PipedreamApiHttpResponse retrieve(String componentId, RequestO if (response.isSuccessful()) { GetComponentResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - return new PipedreamApiHttpResponse<>(parsedResponse.getData(), response); + return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse configureProp(ActionsConfigurePropRequest request) { + public BaseClientHttpResponse configureProp(ActionsConfigurePropRequest request) { return configureProp(request, null); } - public PipedreamApiHttpResponse configureProp( + public BaseClientHttpResponse configureProp( ActionsConfigurePropRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -189,26 +189,26 @@ public PipedreamApiHttpResponse configureProp( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse reloadProps(ActionsReloadPropsRequest request) { + public BaseClientHttpResponse reloadProps(ActionsReloadPropsRequest request) { return reloadProps(request, null); } - public PipedreamApiHttpResponse reloadProps( + public BaseClientHttpResponse reloadProps( ActionsReloadPropsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -240,26 +240,26 @@ public PipedreamApiHttpResponse reloadProps( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse run(RunActionOpts request) { + public BaseClientHttpResponse run(RunActionOpts request) { return run(request, null); } - public PipedreamApiHttpResponse run(RunActionOpts request, RequestOptions requestOptions) { + public BaseClientHttpResponse run(RunActionOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -299,17 +299,17 @@ public PipedreamApiHttpResponse run(RunActionOpts request, Re try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RunActionResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java index c7a7bf5..ebaf619 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java @@ -4,11 +4,11 @@ package com.pipedream.api.resources.appcategories; import com.fasterxml.jackson.core.type.TypeReference; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.types.AppCategory; import java.io.IOException; @@ -31,11 +31,11 @@ public AsyncRawAppCategoriesClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list() { + public CompletableFuture>> list() { return list(null); } - public CompletableFuture>> list(RequestOptions requestOptions) { + public CompletableFuture>> list(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/app_categories") @@ -50,43 +50,43 @@ public CompletableFuture>> list(Reque if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> retrieve(String id) { + public CompletableFuture> retrieve(String id) { return retrieve(id, null); } - public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/app_categories") @@ -102,32 +102,32 @@ public CompletableFuture> retrieve(String if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AppCategory.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java index 497bd77..9fb1c24 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java @@ -4,11 +4,11 @@ package com.pipedream.api.resources.appcategories; import com.fasterxml.jackson.core.type.TypeReference; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.types.AppCategory; import java.io.IOException; @@ -27,11 +27,11 @@ public RawAppCategoriesClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> list() { + public BaseClientHttpResponse> list() { return list(null); } - public PipedreamApiHttpResponse> list(RequestOptions requestOptions) { + public BaseClientHttpResponse> list(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/app_categories") @@ -49,27 +49,27 @@ public PipedreamApiHttpResponse> list(RequestOptions requestOp try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse retrieve(String id) { + public BaseClientHttpResponse retrieve(String id) { return retrieve(id, null); } - public PipedreamApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + public BaseClientHttpResponse retrieve(String id, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/app_categories") @@ -88,17 +88,17 @@ public PipedreamApiHttpResponse retrieve(String id, RequestOptions try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AppCategory.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java index 42967c0..bd53d7d 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java @@ -3,11 +3,11 @@ */ package com.pipedream.api.resources.apps; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -37,15 +37,15 @@ public AsyncRawAppsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list() { + public CompletableFuture>> list() { return list(AppsListRequest.builder().build()); } - public CompletableFuture>> list(AppsListRequest request) { + public CompletableFuture>> list(AppsListRequest request) { return list(request, null); } - public CompletableFuture>> list( + public CompletableFuture>> list( AppsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -87,7 +87,7 @@ public CompletableFuture>> list if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -102,7 +102,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO .after(startingAfter) .build(); List result = parsedResponse.getData(); - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( new SyncPagingIterable(startingAfter.isPresent(), result, () -> { try { return list(nextRequest, requestOptions) @@ -116,30 +116,30 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> retrieve(String appId) { + public CompletableFuture> retrieve(String appId) { return retrieve(appId, null); } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String appId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -156,32 +156,32 @@ public CompletableFuture> retrieve( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetAppResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java index 37619d9..8b4a892 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java @@ -3,11 +3,11 @@ */ package com.pipedream.api.resources.apps; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -32,15 +32,15 @@ public RawAppsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> list() { + public BaseClientHttpResponse> list() { return list(AppsListRequest.builder().build()); } - public PipedreamApiHttpResponse> list(AppsListRequest request) { + public BaseClientHttpResponse> list(AppsListRequest request) { return list(request, null); } - public PipedreamApiHttpResponse> list( + public BaseClientHttpResponse> list( AppsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -93,28 +93,28 @@ public PipedreamApiHttpResponse> list( .after(startingAfter) .build(); List result = parsedResponse.getData(); - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( new SyncPagingIterable( startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) .body()), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse retrieve(String appId) { + public BaseClientHttpResponse retrieve(String appId) { return retrieve(appId, null); } - public PipedreamApiHttpResponse retrieve(String appId, RequestOptions requestOptions) { + public BaseClientHttpResponse retrieve(String appId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/apps") @@ -133,17 +133,17 @@ public PipedreamApiHttpResponse retrieve(String appId, RequestOp try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetAppResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java index 43e8178..f0e05a6 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.components; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -43,16 +43,16 @@ public AsyncRawComponentsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list() { + public CompletableFuture>> list() { return list(ComponentsListRequest.builder().build()); } - public CompletableFuture>> list( + public CompletableFuture>> list( ComponentsListRequest request) { return list(request, null); } - public CompletableFuture>> list( + public CompletableFuture>> list( ComponentsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -87,7 +87,7 @@ public CompletableFuture> if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -102,7 +102,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO .after(startingAfter) .build(); List result = parsedResponse.getData(); - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( new SyncPagingIterable(startingAfter.isPresent(), result, () -> { try { return list(nextRequest, requestOptions) @@ -116,30 +116,30 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> retrieve(String componentId) { + public CompletableFuture> retrieve(String componentId) { return retrieve(componentId, null); } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String componentId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -158,7 +158,7 @@ public CompletableFuture> retrieve( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -166,35 +166,35 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { GetComponentResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - future.complete(new PipedreamApiHttpResponse<>(parsedResponse.getData(), response)); + future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> configureProp( + public CompletableFuture> configureProp( ComponentsConfigurePropRequest request) { return configureProp(request, null); } - public CompletableFuture> configureProp( + public CompletableFuture> configureProp( ComponentsConfigurePropRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -223,43 +223,43 @@ public CompletableFuture> config if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> reloadProps( + public CompletableFuture> reloadProps( ComponentsReloadPropsRequest request) { return reloadProps(request, null); } - public CompletableFuture> reloadProps( + public CompletableFuture> reloadProps( ComponentsReloadPropsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -288,32 +288,32 @@ public CompletableFuture> reloadPr if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java index cd8521d..9cd5a6f 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.components; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -38,15 +38,15 @@ public RawComponentsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> list() { + public BaseClientHttpResponse> list() { return list(ComponentsListRequest.builder().build()); } - public PipedreamApiHttpResponse> list(ComponentsListRequest request) { + public BaseClientHttpResponse> list(ComponentsListRequest request) { return list(request, null); } - public PipedreamApiHttpResponse> list( + public BaseClientHttpResponse> list( ComponentsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -92,28 +92,28 @@ public PipedreamApiHttpResponse> list( .after(startingAfter) .build(); List result = parsedResponse.getData(); - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( new SyncPagingIterable( startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) .body()), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse retrieve(String componentId) { + public BaseClientHttpResponse retrieve(String componentId) { return retrieve(componentId, null); } - public PipedreamApiHttpResponse retrieve(String componentId, RequestOptions requestOptions) { + public BaseClientHttpResponse retrieve(String componentId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -136,24 +136,24 @@ public PipedreamApiHttpResponse retrieve(String componentId, RequestO if (response.isSuccessful()) { GetComponentResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - return new PipedreamApiHttpResponse<>(parsedResponse.getData(), response); + return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse configureProp(ComponentsConfigurePropRequest request) { + public BaseClientHttpResponse configureProp(ComponentsConfigurePropRequest request) { return configureProp(request, null); } - public PipedreamApiHttpResponse configureProp( + public BaseClientHttpResponse configureProp( ComponentsConfigurePropRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -185,26 +185,26 @@ public PipedreamApiHttpResponse configureProp( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse reloadProps(ComponentsReloadPropsRequest request) { + public BaseClientHttpResponse reloadProps(ComponentsReloadPropsRequest request) { return reloadProps(request, null); } - public PipedreamApiHttpResponse reloadProps( + public BaseClientHttpResponse reloadProps( ComponentsReloadPropsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -236,18 +236,18 @@ public PipedreamApiHttpResponse reloadProps( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java index cbee597..e91dca3 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.deployedtriggers; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -53,12 +53,12 @@ public AsyncRawDeployedTriggersClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list( + public CompletableFuture>> list( DeployedTriggersListRequest request) { return list(request, null); } - public CompletableFuture>> list( + public CompletableFuture>> list( DeployedTriggersListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -88,7 +88,7 @@ public CompletableFuture>> future = + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override @@ -104,7 +104,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO .after(startingAfter) .build(); List result = parsedResponse.getData(); - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( new SyncPagingIterable(startingAfter.isPresent(), result, () -> { try { return list(nextRequest, requestOptions) @@ -118,31 +118,31 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String triggerId, DeployedTriggersRetrieveRequest request) { return retrieve(triggerId, request, null); } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String triggerId, DeployedTriggersRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -161,7 +161,7 @@ public CompletableFuture> retrieve( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -169,35 +169,35 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { GetTriggerResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); - future.complete(new PipedreamApiHttpResponse<>(parsedResponse.getData(), response)); + future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> update( + public CompletableFuture> update( String triggerId, UpdateTriggerOpts request) { return update(triggerId, request, null); } - public CompletableFuture> update( + public CompletableFuture> update( String triggerId, UpdateTriggerOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -234,7 +234,7 @@ public CompletableFuture> update( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -242,35 +242,35 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { GetTriggerResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); - future.complete(new PipedreamApiHttpResponse<>(parsedResponse.getData(), response)); + future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> delete( + public CompletableFuture> delete( String triggerId, DeployedTriggersDeleteRequest request) { return delete(triggerId, request, null); } - public CompletableFuture> delete( + public CompletableFuture> delete( String triggerId, DeployedTriggersDeleteRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -292,41 +292,41 @@ public CompletableFuture> delete( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>(null, response)); + future.complete(new BaseClientHttpResponse<>(null, response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture>> listEvents( + public CompletableFuture>> listEvents( String triggerId, DeployedTriggersListEventsRequest request) { return listEvents(triggerId, request, null); } - public CompletableFuture>> listEvents( + public CompletableFuture>> listEvents( String triggerId, DeployedTriggersListEventsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -349,7 +349,7 @@ public CompletableFuture>> listEvent if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -357,35 +357,35 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { GetTriggerEventsResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), GetTriggerEventsResponse.class); - future.complete(new PipedreamApiHttpResponse<>(parsedResponse.getData(), response)); + future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> listWorkflows( + public CompletableFuture> listWorkflows( String triggerId, DeployedTriggersListWorkflowsRequest request) { return listWorkflows(triggerId, request, null); } - public CompletableFuture> listWorkflows( + public CompletableFuture> listWorkflows( String triggerId, DeployedTriggersListWorkflowsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -405,44 +405,44 @@ public CompletableFuture> if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), GetTriggerWorkflowsResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> updateWorkflows( + public CompletableFuture> updateWorkflows( String triggerId, UpdateTriggerWorkflowsOpts request) { return updateWorkflows(triggerId, request, null); } - public CompletableFuture> updateWorkflows( + public CompletableFuture> updateWorkflows( String triggerId, UpdateTriggerWorkflowsOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -472,44 +472,44 @@ public CompletableFuture> if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), GetTriggerWorkflowsResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> listWebhooks( + public CompletableFuture> listWebhooks( String triggerId, DeployedTriggersListWebhooksRequest request) { return listWebhooks(triggerId, request, null); } - public CompletableFuture> listWebhooks( + public CompletableFuture> listWebhooks( String triggerId, DeployedTriggersListWebhooksRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -529,44 +529,44 @@ public CompletableFuture> l if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), GetTriggerWebhooksResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> updateWebhooks( + public CompletableFuture> updateWebhooks( String triggerId, UpdateTriggerWebhooksOpts request) { return updateWebhooks(triggerId, request, null); } - public CompletableFuture> updateWebhooks( + public CompletableFuture> updateWebhooks( String triggerId, UpdateTriggerWebhooksOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -596,33 +596,33 @@ public CompletableFuture> u if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), GetTriggerWebhooksResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java index 0e1e09f..837d672 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.deployedtriggers; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -48,11 +48,11 @@ public RawDeployedTriggersClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> list(DeployedTriggersListRequest request) { + public BaseClientHttpResponse> list(DeployedTriggersListRequest request) { return list(request, null); } - public PipedreamApiHttpResponse> list( + public BaseClientHttpResponse> list( DeployedTriggersListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -93,29 +93,29 @@ public PipedreamApiHttpResponse> list( .after(startingAfter) .build(); List result = parsedResponse.getData(); - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( new SyncPagingIterable( startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) .body()), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse retrieve( + public BaseClientHttpResponse retrieve( String triggerId, DeployedTriggersRetrieveRequest request) { return retrieve(triggerId, request, null); } - public PipedreamApiHttpResponse retrieve( + public BaseClientHttpResponse retrieve( String triggerId, DeployedTriggersRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -139,24 +139,24 @@ public PipedreamApiHttpResponse retrieve( if (response.isSuccessful()) { GetTriggerResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); - return new PipedreamApiHttpResponse<>(parsedResponse.getData(), response); + return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse update(String triggerId, UpdateTriggerOpts request) { + public BaseClientHttpResponse update(String triggerId, UpdateTriggerOpts request) { return update(triggerId, request, null); } - public PipedreamApiHttpResponse update( + public BaseClientHttpResponse update( String triggerId, UpdateTriggerOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -198,24 +198,24 @@ public PipedreamApiHttpResponse update( if (response.isSuccessful()) { GetTriggerResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); - return new PipedreamApiHttpResponse<>(parsedResponse.getData(), response); + return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse delete(String triggerId, DeployedTriggersDeleteRequest request) { + public BaseClientHttpResponse delete(String triggerId, DeployedTriggersDeleteRequest request) { return delete(triggerId, request, null); } - public PipedreamApiHttpResponse delete( + public BaseClientHttpResponse delete( String triggerId, DeployedTriggersDeleteRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -240,25 +240,25 @@ public PipedreamApiHttpResponse delete( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>(null, response); + return new BaseClientHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse> listEvents( + public BaseClientHttpResponse> listEvents( String triggerId, DeployedTriggersListEventsRequest request) { return listEvents(triggerId, request, null); } - public PipedreamApiHttpResponse> listEvents( + public BaseClientHttpResponse> listEvents( String triggerId, DeployedTriggersListEventsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -286,25 +286,25 @@ public PipedreamApiHttpResponse> listEvents( if (response.isSuccessful()) { GetTriggerEventsResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerEventsResponse.class); - return new PipedreamApiHttpResponse<>(parsedResponse.getData(), response); + return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse listWorkflows( + public BaseClientHttpResponse listWorkflows( String triggerId, DeployedTriggersListWorkflowsRequest request) { return listWorkflows(triggerId, request, null); } - public PipedreamApiHttpResponse listWorkflows( + public BaseClientHttpResponse listWorkflows( String triggerId, DeployedTriggersListWorkflowsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -327,27 +327,27 @@ public PipedreamApiHttpResponse listWorkflows( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWorkflowsResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse updateWorkflows( + public BaseClientHttpResponse updateWorkflows( String triggerId, UpdateTriggerWorkflowsOpts request) { return updateWorkflows(triggerId, request, null); } - public PipedreamApiHttpResponse updateWorkflows( + public BaseClientHttpResponse updateWorkflows( String triggerId, UpdateTriggerWorkflowsOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -380,27 +380,27 @@ public PipedreamApiHttpResponse updateWorkflows( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWorkflowsResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse listWebhooks( + public BaseClientHttpResponse listWebhooks( String triggerId, DeployedTriggersListWebhooksRequest request) { return listWebhooks(triggerId, request, null); } - public PipedreamApiHttpResponse listWebhooks( + public BaseClientHttpResponse listWebhooks( String triggerId, DeployedTriggersListWebhooksRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -423,27 +423,27 @@ public PipedreamApiHttpResponse listWebhooks( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWebhooksResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse updateWebhooks( + public BaseClientHttpResponse updateWebhooks( String triggerId, UpdateTriggerWebhooksOpts request) { return updateWebhooks(triggerId, request, null); } - public PipedreamApiHttpResponse updateWebhooks( + public BaseClientHttpResponse updateWebhooks( String triggerId, UpdateTriggerWebhooksOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -476,18 +476,18 @@ public PipedreamApiHttpResponse updateWebhooks( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWebhooksResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncRawOauthTokensClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncRawOauthTokensClient.java index cc29bb8..1e0479b 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncRawOauthTokensClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncRawOauthTokensClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.oauthtokens; import com.fasterxml.jackson.core.JsonProcessingException; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.resources.oauthtokens.requests.CreateOAuthTokenOpts; import com.pipedream.api.types.CreateOAuthTokenResponse; @@ -33,11 +33,11 @@ public AsyncRawOauthTokensClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture> create(CreateOAuthTokenOpts request) { + public CompletableFuture> create(CreateOAuthTokenOpts request) { return create(request, null); } - public CompletableFuture> create( + public CompletableFuture> create( CreateOAuthTokenOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -48,7 +48,7 @@ public CompletableFuture> cre body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { - throw new PipedreamApiException("Failed to serialize request", e); + throw new BaseClientException("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -61,33 +61,33 @@ public CompletableFuture> cre if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), CreateOAuthTokenResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java index c7096b4..6dd34fb 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.oauthtokens; import com.fasterxml.jackson.core.JsonProcessingException; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.resources.oauthtokens.requests.CreateOAuthTokenOpts; import com.pipedream.api.types.CreateOAuthTokenResponse; @@ -29,11 +29,11 @@ public RawOauthTokensClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse create(CreateOAuthTokenOpts request) { + public BaseClientHttpResponse create(CreateOAuthTokenOpts request) { return create(request, null); } - public PipedreamApiHttpResponse create( + public BaseClientHttpResponse create( CreateOAuthTokenOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -44,7 +44,7 @@ public PipedreamApiHttpResponse create( body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { - throw new PipedreamApiException("Failed to serialize request", e); + throw new BaseClientException("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -60,18 +60,18 @@ public PipedreamApiHttpResponse create( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreateOAuthTokenResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java index df37ce8..89c9ec3 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java @@ -3,11 +3,11 @@ */ package com.pipedream.api.resources.projects; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.types.ProjectInfoResponse; import java.io.IOException; @@ -29,12 +29,11 @@ public AsyncRawProjectsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture> retrieveInfo() { + public CompletableFuture> retrieveInfo() { return retrieveInfo(null); } - public CompletableFuture> retrieveInfo( - RequestOptions requestOptions) { + public CompletableFuture> retrieveInfo(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -51,32 +50,32 @@ public CompletableFuture> retrieve if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ProjectInfoResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java index d09dc32..c927bf5 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java @@ -3,11 +3,11 @@ */ package com.pipedream.api.resources.projects; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.types.ProjectInfoResponse; import java.io.IOException; @@ -25,11 +25,11 @@ public RawProjectsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse retrieveInfo() { + public BaseClientHttpResponse retrieveInfo() { return retrieveInfo(null); } - public PipedreamApiHttpResponse retrieveInfo(RequestOptions requestOptions) { + public BaseClientHttpResponse retrieveInfo(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -49,18 +49,18 @@ public PipedreamApiHttpResponse retrieveInfo(RequestOptions try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ProjectInfoResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java index d6737d6..30ca813 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.proxy; import com.fasterxml.jackson.core.type.TypeReference; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.resources.proxy.requests.ProxyDeleteRequest; @@ -38,11 +38,11 @@ public AsyncRawProxyClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> get(String url64, ProxyGetRequest request) { + public CompletableFuture>> get(String url64, ProxyGetRequest request) { return get(url64, request, null); } - public CompletableFuture>> get( + public CompletableFuture>> get( String url64, ProxyGetRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -62,44 +62,43 @@ public CompletableFuture>> get( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture>> post( - String url64, ProxyPostRequest request) { + public CompletableFuture>> post(String url64, ProxyPostRequest request) { return post(url64, request, null); } - public CompletableFuture>> post( + public CompletableFuture>> post( String url64, ProxyPostRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -127,43 +126,43 @@ public CompletableFuture>> post( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture>> put(String url64, ProxyPutRequest request) { + public CompletableFuture>> put(String url64, ProxyPutRequest request) { return put(url64, request, null); } - public CompletableFuture>> put( + public CompletableFuture>> put( String url64, ProxyPutRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -191,44 +190,44 @@ public CompletableFuture>> put( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture>> delete( + public CompletableFuture>> delete( String url64, ProxyDeleteRequest request) { return delete(url64, request, null); } - public CompletableFuture>> delete( + public CompletableFuture>> delete( String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -248,44 +247,44 @@ public CompletableFuture>> delete( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture>> patch( + public CompletableFuture>> patch( String url64, ProxyPatchRequest request) { return patch(url64, request, null); } - public CompletableFuture>> patch( + public CompletableFuture>> patch( String url64, ProxyPatchRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -313,33 +312,33 @@ public CompletableFuture>> patch( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java index 9720f2b..fb9c5bf 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.proxy; import com.fasterxml.jackson.core.type.TypeReference; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.resources.proxy.requests.ProxyDeleteRequest; @@ -34,11 +34,11 @@ public RawProxyClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> get(String url64, ProxyGetRequest request) { + public BaseClientHttpResponse> get(String url64, ProxyGetRequest request) { return get(url64, request, null); } - public PipedreamApiHttpResponse> get( + public BaseClientHttpResponse> get( String url64, ProxyGetRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -61,27 +61,27 @@ public PipedreamApiHttpResponse> get( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse> post(String url64, ProxyPostRequest request) { + public BaseClientHttpResponse> post(String url64, ProxyPostRequest request) { return post(url64, request, null); } - public PipedreamApiHttpResponse> post( + public BaseClientHttpResponse> post( String url64, ProxyPostRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -112,27 +112,27 @@ public PipedreamApiHttpResponse> post( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse> put(String url64, ProxyPutRequest request) { + public BaseClientHttpResponse> put(String url64, ProxyPutRequest request) { return put(url64, request, null); } - public PipedreamApiHttpResponse> put( + public BaseClientHttpResponse> put( String url64, ProxyPutRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -163,27 +163,27 @@ public PipedreamApiHttpResponse> put( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse> delete(String url64, ProxyDeleteRequest request) { + public BaseClientHttpResponse> delete(String url64, ProxyDeleteRequest request) { return delete(url64, request, null); } - public PipedreamApiHttpResponse> delete( + public BaseClientHttpResponse> delete( String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -206,27 +206,27 @@ public PipedreamApiHttpResponse> delete( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse> patch(String url64, ProxyPatchRequest request) { + public BaseClientHttpResponse> patch(String url64, ProxyPatchRequest request) { return patch(url64, request, null); } - public PipedreamApiHttpResponse> patch( + public BaseClientHttpResponse> patch( String url64, ProxyPatchRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -257,19 +257,19 @@ public PipedreamApiHttpResponse> patch( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java index 9ddd525..84570a9 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.tokens; import com.fasterxml.jackson.core.JsonProcessingException; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.resources.tokens.requests.CreateTokenRequest; @@ -36,11 +36,11 @@ public AsyncRawTokensClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture> create(CreateTokenRequest request) { + public CompletableFuture> create(CreateTokenRequest request) { return create(request, null); } - public CompletableFuture> create( + public CompletableFuture> create( CreateTokenRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -51,7 +51,7 @@ public CompletableFuture> create( body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { - throw new PipedreamApiException("Failed to serialize request", e); + throw new BaseClientException("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -64,47 +64,47 @@ public CompletableFuture> create( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreateTokenResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> validate(String ctok) { + public CompletableFuture> validate(String ctok) { return validate(ctok, TokensValidateRequest.builder().build()); } - public CompletableFuture> validate( + public CompletableFuture> validate( String ctok, TokensValidateRequest request) { return validate(ctok, request, null); } - public CompletableFuture> validate( + public CompletableFuture> validate( String ctok, TokensValidateRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -125,32 +125,32 @@ public CompletableFuture> valida if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ValidateTokenResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java index d20fbea..b18022c 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.tokens; import com.fasterxml.jackson.core.JsonProcessingException; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.resources.tokens.requests.CreateTokenRequest; @@ -32,11 +32,11 @@ public RawTokensClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse create(CreateTokenRequest request) { + public BaseClientHttpResponse create(CreateTokenRequest request) { return create(request, null); } - public PipedreamApiHttpResponse create( + public BaseClientHttpResponse create( CreateTokenRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -47,7 +47,7 @@ public PipedreamApiHttpResponse create( body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { - throw new PipedreamApiException("Failed to serialize request", e); + throw new BaseClientException("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -63,30 +63,30 @@ public PipedreamApiHttpResponse create( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreateTokenResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse validate(String ctok) { + public BaseClientHttpResponse validate(String ctok) { return validate(ctok, TokensValidateRequest.builder().build()); } - public PipedreamApiHttpResponse validate(String ctok, TokensValidateRequest request) { + public BaseClientHttpResponse validate(String ctok, TokensValidateRequest request) { return validate(ctok, request, null); } - public PipedreamApiHttpResponse validate( + public BaseClientHttpResponse validate( String ctok, TokensValidateRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -110,18 +110,18 @@ public PipedreamApiHttpResponse validate( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ValidateTokenResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java index 8e4c08a..ddc9aff 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.triggers; import com.fasterxml.jackson.core.JsonProcessingException; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -47,16 +47,15 @@ public AsyncRawTriggersClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list() { + public CompletableFuture>> list() { return list(TriggersListRequest.builder().build()); } - public CompletableFuture>> list( - TriggersListRequest request) { + public CompletableFuture>> list(TriggersListRequest request) { return list(request, null); } - public CompletableFuture>> list( + public CompletableFuture>> list( TriggersListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -91,7 +90,7 @@ public CompletableFuture> if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -106,7 +105,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO .after(startingAfter) .build(); List result = parsedResponse.getData(); - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( new SyncPagingIterable(startingAfter.isPresent(), result, () -> { try { return list(nextRequest, requestOptions) @@ -120,30 +119,30 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> retrieve(String componentId) { + public CompletableFuture> retrieve(String componentId) { return retrieve(componentId, null); } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String componentId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -162,7 +161,7 @@ public CompletableFuture> retrieve( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -170,35 +169,35 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { GetComponentResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - future.complete(new PipedreamApiHttpResponse<>(parsedResponse.getData(), response)); + future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> configureProp( + public CompletableFuture> configureProp( TriggersConfigurePropRequest request) { return configureProp(request, null); } - public CompletableFuture> configureProp( + public CompletableFuture> configureProp( TriggersConfigurePropRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -227,43 +226,43 @@ public CompletableFuture> config if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> reloadProps( + public CompletableFuture> reloadProps( TriggersReloadPropsRequest request) { return reloadProps(request, null); } - public CompletableFuture> reloadProps( + public CompletableFuture> reloadProps( TriggersReloadPropsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -292,42 +291,42 @@ public CompletableFuture> reloadPr if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> deploy(DeployTriggerOpts request) { + public CompletableFuture> deploy(DeployTriggerOpts request) { return deploy(request, null); } - public CompletableFuture> deploy( + public CompletableFuture> deploy( DeployTriggerOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -340,7 +339,7 @@ public CompletableFuture> deploy( body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { - throw new PipedreamApiException("Failed to serialize request", e); + throw new BaseClientException("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -353,7 +352,7 @@ public CompletableFuture> deploy( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -361,24 +360,24 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { DeployTriggerResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DeployTriggerResponse.class); - future.complete(new PipedreamApiHttpResponse<>(parsedResponse.getData(), response)); + future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java index 83abd08..192686d 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.triggers; import com.fasterxml.jackson.core.JsonProcessingException; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -42,15 +42,15 @@ public RawTriggersClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> list() { + public BaseClientHttpResponse> list() { return list(TriggersListRequest.builder().build()); } - public PipedreamApiHttpResponse> list(TriggersListRequest request) { + public BaseClientHttpResponse> list(TriggersListRequest request) { return list(request, null); } - public PipedreamApiHttpResponse> list( + public BaseClientHttpResponse> list( TriggersListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -96,28 +96,28 @@ public PipedreamApiHttpResponse> list( .after(startingAfter) .build(); List result = parsedResponse.getData(); - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( new SyncPagingIterable( startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) .body()), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse retrieve(String componentId) { + public BaseClientHttpResponse retrieve(String componentId) { return retrieve(componentId, null); } - public PipedreamApiHttpResponse retrieve(String componentId, RequestOptions requestOptions) { + public BaseClientHttpResponse retrieve(String componentId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -140,24 +140,24 @@ public PipedreamApiHttpResponse retrieve(String componentId, RequestO if (response.isSuccessful()) { GetComponentResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - return new PipedreamApiHttpResponse<>(parsedResponse.getData(), response); + return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse configureProp(TriggersConfigurePropRequest request) { + public BaseClientHttpResponse configureProp(TriggersConfigurePropRequest request) { return configureProp(request, null); } - public PipedreamApiHttpResponse configureProp( + public BaseClientHttpResponse configureProp( TriggersConfigurePropRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -189,26 +189,26 @@ public PipedreamApiHttpResponse configureProp( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse reloadProps(TriggersReloadPropsRequest request) { + public BaseClientHttpResponse reloadProps(TriggersReloadPropsRequest request) { return reloadProps(request, null); } - public PipedreamApiHttpResponse reloadProps( + public BaseClientHttpResponse reloadProps( TriggersReloadPropsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -240,27 +240,26 @@ public PipedreamApiHttpResponse reloadProps( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse deploy(DeployTriggerOpts request) { + public BaseClientHttpResponse deploy(DeployTriggerOpts request) { return deploy(request, null); } - public PipedreamApiHttpResponse deploy( - DeployTriggerOpts request, RequestOptions requestOptions) { + public BaseClientHttpResponse deploy(DeployTriggerOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -272,7 +271,7 @@ public PipedreamApiHttpResponse deploy( body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { - throw new PipedreamApiException("Failed to serialize request", e); + throw new BaseClientException("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -290,16 +289,16 @@ public PipedreamApiHttpResponse deploy( if (response.isSuccessful()) { DeployTriggerResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DeployTriggerResponse.class); - return new PipedreamApiHttpResponse<>(parsedResponse.getData(), response); + return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java index 5cb2cdb..53d886e 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java @@ -3,11 +3,11 @@ */ package com.pipedream.api.resources.users; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import java.io.IOException; import java.util.concurrent.CompletableFuture; @@ -28,11 +28,11 @@ public AsyncRawUsersClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture> deleteExternalUser(String externalUserId) { + public CompletableFuture> deleteExternalUser(String externalUserId) { return deleteExternalUser(externalUserId, null); } - public CompletableFuture> deleteExternalUser( + public CompletableFuture> deleteExternalUser( String externalUserId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -50,30 +50,30 @@ public CompletableFuture> deleteExternalUser( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>(null, response)); + future.complete(new BaseClientHttpResponse<>(null, response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java index 7fe69c9..69011b7 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java +++ b/build/spotless/spotlessJava/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java @@ -3,11 +3,11 @@ */ package com.pipedream.api.resources.users; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import java.io.IOException; import okhttp3.Headers; @@ -24,11 +24,11 @@ public RawUsersClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse deleteExternalUser(String externalUserId) { + public BaseClientHttpResponse deleteExternalUser(String externalUserId) { return deleteExternalUser(externalUserId, null); } - public PipedreamApiHttpResponse deleteExternalUser(String externalUserId, RequestOptions requestOptions) { + public BaseClientHttpResponse deleteExternalUser(String externalUserId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -48,16 +48,16 @@ public PipedreamApiHttpResponse deleteExternalUser(String externalUserId, try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>(null, response); + return new BaseClientHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/reference.md b/reference.md index d4f2874..4569eb0 100644 --- a/reference.md +++ b/reference.md @@ -318,6 +318,8 @@ client.accounts().create( CreateAccountRequest .builder() .appSlug("app_slug") + .cfmapJson("cfmap_json") + .connectToken("connect_token") .build() ); ``` @@ -374,7 +376,15 @@ client.accounts().create(
-**cfmapJson:** `Optional` — JSON string containing the custom fields mapping +**cfmapJson:** `String` — JSON string containing the custom fields mapping + +
+
+ +
+
+ +**connectToken:** `String` — The connect token for authentication
diff --git a/sample-app/src/main/java/sample/App.java b/sample-app/src/main/java/sample/App.java index 7587480..103615f 100644 --- a/sample-app/src/main/java/sample/App.java +++ b/sample-app/src/main/java/sample/App.java @@ -8,6 +8,6 @@ public final class App { public static void main(String[] args) { - // import com.pipedream.api.AsyncPipedreamApiClient + // import com.pipedream.api.AsyncBaseClient } } diff --git a/src/main/java/com/pipedream/api/AsyncPipedreamApiClient.java b/src/main/java/com/pipedream/api/AsyncBaseClient.java similarity index 95% rename from src/main/java/com/pipedream/api/AsyncPipedreamApiClient.java rename to src/main/java/com/pipedream/api/AsyncBaseClient.java index ee61fa8..39ecdab 100644 --- a/src/main/java/com/pipedream/api/AsyncPipedreamApiClient.java +++ b/src/main/java/com/pipedream/api/AsyncBaseClient.java @@ -19,7 +19,7 @@ import com.pipedream.api.resources.users.AsyncUsersClient; import java.util.function.Supplier; -public class AsyncPipedreamApiClient { +public class AsyncBaseClient { protected final ClientOptions clientOptions; protected final Supplier appCategoriesClient; @@ -46,7 +46,7 @@ public class AsyncPipedreamApiClient { protected final Supplier oauthTokensClient; - public AsyncPipedreamApiClient(ClientOptions clientOptions) { + public AsyncBaseClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.appCategoriesClient = Suppliers.memoize(() -> new AsyncAppCategoriesClient(clientOptions)); this.appsClient = Suppliers.memoize(() -> new AsyncAppsClient(clientOptions)); @@ -110,7 +110,7 @@ public AsyncOauthTokensClient oauthTokens() { return this.oauthTokensClient.get(); } - public static AsyncPipedreamApiClientBuilder builder() { - return new AsyncPipedreamApiClientBuilder(); + public static AsyncBaseClientBuilder builder() { + return new AsyncBaseClientBuilder(); } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncPipedreamApiClientBuilder.java b/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java similarity index 74% rename from build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncPipedreamApiClientBuilder.java rename to src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java index 0ebee7b..5759e8b 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/AsyncPipedreamApiClientBuilder.java +++ b/src/main/java/com/pipedream/api/AsyncBaseClientBuilder.java @@ -9,7 +9,7 @@ import com.pipedream.api.resources.oauthtokens.OauthTokensClient; import okhttp3.OkHttpClient; -public final class AsyncPipedreamApiClientBuilder { +public final class AsyncBaseClientBuilder { private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder(); private String clientId = System.getenv("PIPEDREAM_CLIENT_ID"); @@ -24,7 +24,7 @@ public final class AsyncPipedreamApiClientBuilder { * Sets clientId. * Defaults to the PIPEDREAM_CLIENT_ID environment variable. */ - public AsyncPipedreamApiClientBuilder clientId(String clientId) { + public AsyncBaseClientBuilder clientId(String clientId) { this.clientId = clientId; return this; } @@ -33,7 +33,7 @@ public AsyncPipedreamApiClientBuilder clientId(String clientId) { * Sets clientSecret. * Defaults to the PIPEDREAM_CLIENT_SECRET environment variable. */ - public AsyncPipedreamApiClientBuilder clientSecret(String clientSecret) { + public AsyncBaseClientBuilder clientSecret(String clientSecret) { this.clientSecret = clientSecret; return this; } @@ -41,17 +41,17 @@ public AsyncPipedreamApiClientBuilder clientSecret(String clientSecret) { /** * Sets projectEnvironment */ - public AsyncPipedreamApiClientBuilder projectEnvironment(String projectEnvironment) { + public AsyncBaseClientBuilder projectEnvironment(String projectEnvironment) { this.projectEnvironment = projectEnvironment; return this; } - public AsyncPipedreamApiClientBuilder environment(Environment environment) { + public AsyncBaseClientBuilder environment(Environment environment) { this.environment = environment; return this; } - public AsyncPipedreamApiClientBuilder url(String url) { + public AsyncBaseClientBuilder url(String url) { this.environment = Environment.custom(url); return this; } @@ -59,7 +59,7 @@ public AsyncPipedreamApiClientBuilder url(String url) { /** * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. */ - public AsyncPipedreamApiClientBuilder timeout(int timeout) { + public AsyncBaseClientBuilder timeout(int timeout) { this.clientOptionsBuilder.timeout(timeout); return this; } @@ -67,7 +67,7 @@ public AsyncPipedreamApiClientBuilder timeout(int timeout) { /** * Sets the maximum number of retries for the client. Defaults to 2 retries. */ - public AsyncPipedreamApiClientBuilder maxRetries(int maxRetries) { + public AsyncBaseClientBuilder maxRetries(int maxRetries) { this.clientOptionsBuilder.maxRetries(maxRetries); return this; } @@ -75,17 +75,17 @@ public AsyncPipedreamApiClientBuilder maxRetries(int maxRetries) { /** * Sets the underlying OkHttp client */ - public AsyncPipedreamApiClientBuilder httpClient(OkHttpClient httpClient) { + public AsyncBaseClientBuilder httpClient(OkHttpClient httpClient) { this.clientOptionsBuilder.httpClient(httpClient); return this; } - public AsyncPipedreamApiClientBuilder projectId(String projectId) { + public AsyncBaseClientBuilder projectId(String projectId) { clientOptionsBuilder.projectId(projectId); return this; } - public AsyncPipedreamApiClient build() { + public AsyncBaseClient build() { OauthTokensClient authClient = new OauthTokensClient( ClientOptions.builder().environment(this.environment).build()); OAuthTokenSupplier oAuthTokenSupplier = new OAuthTokenSupplier(clientId, clientSecret, authClient); @@ -94,6 +94,6 @@ public AsyncPipedreamApiClient build() { this.clientOptionsBuilder.addHeader("x-pd-environment", this.projectEnvironment); } clientOptionsBuilder.environment(this.environment); - return new AsyncPipedreamApiClient(clientOptionsBuilder.build()); + return new AsyncBaseClient(clientOptionsBuilder.build()); } } diff --git a/src/main/java/com/pipedream/api/PipedreamApiClient.java b/src/main/java/com/pipedream/api/BaseClient.java similarity index 95% rename from src/main/java/com/pipedream/api/PipedreamApiClient.java rename to src/main/java/com/pipedream/api/BaseClient.java index fbe892b..69e5677 100644 --- a/src/main/java/com/pipedream/api/PipedreamApiClient.java +++ b/src/main/java/com/pipedream/api/BaseClient.java @@ -19,7 +19,7 @@ import com.pipedream.api.resources.users.UsersClient; import java.util.function.Supplier; -public class PipedreamApiClient { +public class BaseClient { protected final ClientOptions clientOptions; protected final Supplier appCategoriesClient; @@ -46,7 +46,7 @@ public class PipedreamApiClient { protected final Supplier oauthTokensClient; - public PipedreamApiClient(ClientOptions clientOptions) { + public BaseClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; this.appCategoriesClient = Suppliers.memoize(() -> new AppCategoriesClient(clientOptions)); this.appsClient = Suppliers.memoize(() -> new AppsClient(clientOptions)); @@ -110,7 +110,7 @@ public OauthTokensClient oauthTokens() { return this.oauthTokensClient.get(); } - public static PipedreamApiClientBuilder builder() { - return new PipedreamApiClientBuilder(); + public static BaseClientBuilder builder() { + return new BaseClientBuilder(); } } diff --git a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/PipedreamApiClientBuilder.java b/src/main/java/com/pipedream/api/BaseClientBuilder.java similarity index 75% rename from build/spotless/spotlessJava/src/main/java/com/pipedream/api/PipedreamApiClientBuilder.java rename to src/main/java/com/pipedream/api/BaseClientBuilder.java index 9983f98..59ed177 100644 --- a/build/spotless/spotlessJava/src/main/java/com/pipedream/api/PipedreamApiClientBuilder.java +++ b/src/main/java/com/pipedream/api/BaseClientBuilder.java @@ -9,7 +9,7 @@ import com.pipedream.api.resources.oauthtokens.OauthTokensClient; import okhttp3.OkHttpClient; -public final class PipedreamApiClientBuilder { +public final class BaseClientBuilder { private ClientOptions.Builder clientOptionsBuilder = ClientOptions.builder(); private String clientId = System.getenv("PIPEDREAM_CLIENT_ID"); @@ -24,7 +24,7 @@ public final class PipedreamApiClientBuilder { * Sets clientId. * Defaults to the PIPEDREAM_CLIENT_ID environment variable. */ - public PipedreamApiClientBuilder clientId(String clientId) { + public BaseClientBuilder clientId(String clientId) { this.clientId = clientId; return this; } @@ -33,7 +33,7 @@ public PipedreamApiClientBuilder clientId(String clientId) { * Sets clientSecret. * Defaults to the PIPEDREAM_CLIENT_SECRET environment variable. */ - public PipedreamApiClientBuilder clientSecret(String clientSecret) { + public BaseClientBuilder clientSecret(String clientSecret) { this.clientSecret = clientSecret; return this; } @@ -41,17 +41,17 @@ public PipedreamApiClientBuilder clientSecret(String clientSecret) { /** * Sets projectEnvironment */ - public PipedreamApiClientBuilder projectEnvironment(String projectEnvironment) { + public BaseClientBuilder projectEnvironment(String projectEnvironment) { this.projectEnvironment = projectEnvironment; return this; } - public PipedreamApiClientBuilder environment(Environment environment) { + public BaseClientBuilder environment(Environment environment) { this.environment = environment; return this; } - public PipedreamApiClientBuilder url(String url) { + public BaseClientBuilder url(String url) { this.environment = Environment.custom(url); return this; } @@ -59,7 +59,7 @@ public PipedreamApiClientBuilder url(String url) { /** * Sets the timeout (in seconds) for the client. Defaults to 60 seconds. */ - public PipedreamApiClientBuilder timeout(int timeout) { + public BaseClientBuilder timeout(int timeout) { this.clientOptionsBuilder.timeout(timeout); return this; } @@ -67,7 +67,7 @@ public PipedreamApiClientBuilder timeout(int timeout) { /** * Sets the maximum number of retries for the client. Defaults to 2 retries. */ - public PipedreamApiClientBuilder maxRetries(int maxRetries) { + public BaseClientBuilder maxRetries(int maxRetries) { this.clientOptionsBuilder.maxRetries(maxRetries); return this; } @@ -75,17 +75,17 @@ public PipedreamApiClientBuilder maxRetries(int maxRetries) { /** * Sets the underlying OkHttp client */ - public PipedreamApiClientBuilder httpClient(OkHttpClient httpClient) { + public BaseClientBuilder httpClient(OkHttpClient httpClient) { this.clientOptionsBuilder.httpClient(httpClient); return this; } - public PipedreamApiClientBuilder projectId(String projectId) { + public BaseClientBuilder projectId(String projectId) { clientOptionsBuilder.projectId(projectId); return this; } - public PipedreamApiClient build() { + public BaseClient build() { OauthTokensClient authClient = new OauthTokensClient( ClientOptions.builder().environment(this.environment).build()); OAuthTokenSupplier oAuthTokenSupplier = new OAuthTokenSupplier(clientId, clientSecret, authClient); @@ -94,6 +94,6 @@ public PipedreamApiClient build() { this.clientOptionsBuilder.addHeader("x-pd-environment", this.projectEnvironment); } clientOptionsBuilder.environment(this.environment); - return new PipedreamApiClient(clientOptionsBuilder.build()); + return new BaseClient(clientOptionsBuilder.build()); } } diff --git a/src/main/java/com/pipedream/api/core/PipedreamApiApiException.java b/src/main/java/com/pipedream/api/core/BaseClientApiException.java similarity index 80% rename from src/main/java/com/pipedream/api/core/PipedreamApiApiException.java rename to src/main/java/com/pipedream/api/core/BaseClientApiException.java index d4d2e56..a2680b0 100644 --- a/src/main/java/com/pipedream/api/core/PipedreamApiApiException.java +++ b/src/main/java/com/pipedream/api/core/BaseClientApiException.java @@ -12,7 +12,7 @@ /** * This exception type will be thrown for any non-2XX API responses. */ -public class PipedreamApiApiException extends PipedreamApiException { +public class BaseClientApiException extends BaseClientException { /** * The error code of the response that triggered the exception. */ @@ -25,14 +25,14 @@ public class PipedreamApiApiException extends PipedreamApiException { private final Map> headers; - public PipedreamApiApiException(String message, int statusCode, Object body) { + public BaseClientApiException(String message, int statusCode, Object body) { super(message); this.statusCode = statusCode; this.body = body; this.headers = new HashMap<>(); } - public PipedreamApiApiException(String message, int statusCode, Object body, Response rawResponse) { + public BaseClientApiException(String message, int statusCode, Object body, Response rawResponse) { super(message); this.statusCode = statusCode; this.body = body; @@ -67,7 +67,7 @@ public Map> headers() { @java.lang.Override public String toString() { - return "PipedreamApiApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + return "BaseClientApiException{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + body + "}"; } } diff --git a/src/main/java/com/pipedream/api/core/PipedreamApiException.java b/src/main/java/com/pipedream/api/core/BaseClientException.java similarity index 58% rename from src/main/java/com/pipedream/api/core/PipedreamApiException.java rename to src/main/java/com/pipedream/api/core/BaseClientException.java index 866b47e..e034e68 100644 --- a/src/main/java/com/pipedream/api/core/PipedreamApiException.java +++ b/src/main/java/com/pipedream/api/core/BaseClientException.java @@ -6,12 +6,12 @@ /** * This class serves as the base exception for all errors in the SDK. */ -public class PipedreamApiException extends RuntimeException { - public PipedreamApiException(String message) { +public class BaseClientException extends RuntimeException { + public BaseClientException(String message) { super(message); } - public PipedreamApiException(String message, Exception e) { + public BaseClientException(String message, Exception e) { super(message, e); } } diff --git a/src/main/java/com/pipedream/api/core/PipedreamApiHttpResponse.java b/src/main/java/com/pipedream/api/core/BaseClientHttpResponse.java similarity index 87% rename from src/main/java/com/pipedream/api/core/PipedreamApiHttpResponse.java rename to src/main/java/com/pipedream/api/core/BaseClientHttpResponse.java index 59f2804..68376ae 100644 --- a/src/main/java/com/pipedream/api/core/PipedreamApiHttpResponse.java +++ b/src/main/java/com/pipedream/api/core/BaseClientHttpResponse.java @@ -9,13 +9,13 @@ import java.util.Map; import okhttp3.Response; -public final class PipedreamApiHttpResponse { +public final class BaseClientHttpResponse { private final T body; private final Map> headers; - public PipedreamApiHttpResponse(T body, Response rawResponse) { + public BaseClientHttpResponse(T body, Response rawResponse) { this.body = body; Map> headers = new HashMap<>(); diff --git a/src/main/java/com/pipedream/api/core/ClientOptions.java b/src/main/java/com/pipedream/api/core/ClientOptions.java index 5424c0d..7eac9d9 100644 --- a/src/main/java/com/pipedream/api/core/ClientOptions.java +++ b/src/main/java/com/pipedream/api/core/ClientOptions.java @@ -37,7 +37,7 @@ private ClientOptions( { put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.pipedream.fern:api-sdk"); - put("X-Fern-SDK-Version", "0.0.202"); + put("X-Fern-SDK-Version", "0.0.217"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java b/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java index 82dc947..59601c1 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java +++ b/src/main/java/com/pipedream/api/resources/accounts/AsyncRawAccountsClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.accounts; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -42,15 +42,15 @@ public AsyncRawAccountsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list() { + public CompletableFuture>> list() { return list(AccountsListRequest.builder().build()); } - public CompletableFuture>> list(AccountsListRequest request) { + public CompletableFuture>> list(AccountsListRequest request) { return list(request, null); } - public CompletableFuture>> list( + public CompletableFuture>> list( AccountsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -98,7 +98,7 @@ public CompletableFuture>> if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -113,7 +113,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO .after(startingAfter) .build(); List result = parsedResponse.getData(); - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( new SyncPagingIterable(startingAfter.isPresent(), result, () -> { try { return list(nextRequest, requestOptions) @@ -127,30 +127,30 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> create(CreateAccountRequest request) { + public CompletableFuture> create(CreateAccountRequest request) { return create(request, null); } - public CompletableFuture> create( + public CompletableFuture> create( CreateAccountRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -171,9 +171,8 @@ public CompletableFuture> create( } Map properties = new HashMap<>(); properties.put("app_slug", request.getAppSlug()); - if (request.getCfmapJson().isPresent()) { - properties.put("cfmap_json", request.getCfmapJson()); - } + properties.put("cfmap_json", request.getCfmapJson()); + properties.put("connect_token", request.getConnectToken()); if (request.getName().isPresent()) { properties.put("name", request.getName()); } @@ -195,46 +194,46 @@ public CompletableFuture> create( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> retrieve(String accountId) { + public CompletableFuture> retrieve(String accountId) { return retrieve(accountId, AccountsRetrieveRequest.builder().build()); } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String accountId, AccountsRetrieveRequest request) { return retrieve(accountId, request, null); } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String accountId, AccountsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -259,41 +258,41 @@ public CompletableFuture> retrieve( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> delete(String accountId) { + public CompletableFuture> delete(String accountId) { return delete(accountId, null); } - public CompletableFuture> delete(String accountId, RequestOptions requestOptions) { + public CompletableFuture> delete(String accountId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -310,40 +309,40 @@ public CompletableFuture> delete(String accountId if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>(null, response)); + future.complete(new BaseClientHttpResponse<>(null, response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> deleteByApp(String appId) { + public CompletableFuture> deleteByApp(String appId) { return deleteByApp(appId, null); } - public CompletableFuture> deleteByApp(String appId, RequestOptions requestOptions) { + public CompletableFuture> deleteByApp(String appId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -361,30 +360,30 @@ public CompletableFuture> deleteByApp(String appI if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>(null, response)); + future.complete(new BaseClientHttpResponse<>(null, response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java b/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java index ad4652d..e90fe31 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java +++ b/src/main/java/com/pipedream/api/resources/accounts/RawAccountsClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.accounts; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -37,15 +37,15 @@ public RawAccountsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> list() { + public BaseClientHttpResponse> list() { return list(AccountsListRequest.builder().build()); } - public PipedreamApiHttpResponse> list(AccountsListRequest request) { + public BaseClientHttpResponse> list(AccountsListRequest request) { return list(request, null); } - public PipedreamApiHttpResponse> list( + public BaseClientHttpResponse> list( AccountsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -104,28 +104,28 @@ public PipedreamApiHttpResponse> list( .after(startingAfter) .build(); List result = parsedResponse.getData(); - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( new SyncPagingIterable( startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) .body()), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse create(CreateAccountRequest request) { + public BaseClientHttpResponse create(CreateAccountRequest request) { return create(request, null); } - public PipedreamApiHttpResponse create(CreateAccountRequest request, RequestOptions requestOptions) { + public BaseClientHttpResponse create(CreateAccountRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -145,9 +145,8 @@ public PipedreamApiHttpResponse create(CreateAccountRequest request, Re } Map properties = new HashMap<>(); properties.put("app_slug", request.getAppSlug()); - if (request.getCfmapJson().isPresent()) { - properties.put("cfmap_json", request.getCfmapJson()); - } + properties.put("cfmap_json", request.getCfmapJson()); + properties.put("connect_token", request.getConnectToken()); if (request.getName().isPresent()) { properties.put("name", request.getName()); } @@ -172,29 +171,29 @@ public PipedreamApiHttpResponse create(CreateAccountRequest request, Re try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse retrieve(String accountId) { + public BaseClientHttpResponse retrieve(String accountId) { return retrieve(accountId, AccountsRetrieveRequest.builder().build()); } - public PipedreamApiHttpResponse retrieve(String accountId, AccountsRetrieveRequest request) { + public BaseClientHttpResponse retrieve(String accountId, AccountsRetrieveRequest request) { return retrieve(accountId, request, null); } - public PipedreamApiHttpResponse retrieve( + public BaseClientHttpResponse retrieve( String accountId, AccountsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -222,25 +221,25 @@ public PipedreamApiHttpResponse retrieve( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse delete(String accountId) { + public BaseClientHttpResponse delete(String accountId) { return delete(accountId, null); } - public PipedreamApiHttpResponse delete(String accountId, RequestOptions requestOptions) { + public BaseClientHttpResponse delete(String accountId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -260,24 +259,24 @@ public PipedreamApiHttpResponse delete(String accountId, RequestOptions re try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>(null, response); + return new BaseClientHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse deleteByApp(String appId) { + public BaseClientHttpResponse deleteByApp(String appId) { return deleteByApp(appId, null); } - public PipedreamApiHttpResponse deleteByApp(String appId, RequestOptions requestOptions) { + public BaseClientHttpResponse deleteByApp(String appId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -298,16 +297,16 @@ public PipedreamApiHttpResponse deleteByApp(String appId, RequestOptions r try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>(null, response); + return new BaseClientHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountRequest.java b/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountRequest.java index fe25bb8..aeec52a 100644 --- a/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountRequest.java +++ b/src/main/java/com/pipedream/api/resources/accounts/requests/CreateAccountRequest.java @@ -29,7 +29,9 @@ public final class CreateAccountRequest { private final String appSlug; - private final Optional cfmapJson; + private final String cfmapJson; + + private final String connectToken; private final Optional name; @@ -40,7 +42,8 @@ private CreateAccountRequest( Optional externalUserId, Optional oauthAppId, String appSlug, - Optional cfmapJson, + String cfmapJson, + String connectToken, Optional name, Map additionalProperties) { this.appId = appId; @@ -48,6 +51,7 @@ private CreateAccountRequest( this.oauthAppId = oauthAppId; this.appSlug = appSlug; this.cfmapJson = cfmapJson; + this.connectToken = connectToken; this.name = name; this.additionalProperties = additionalProperties; } @@ -85,10 +89,18 @@ public String getAppSlug() { * @return JSON string containing the custom fields mapping */ @JsonProperty("cfmap_json") - public Optional getCfmapJson() { + public String getCfmapJson() { return cfmapJson; } + /** + * @return The connect token for authentication + */ + @JsonProperty("connect_token") + public String getConnectToken() { + return connectToken; + } + /** * @return Optional name for the account */ @@ -114,12 +126,20 @@ private boolean equalTo(CreateAccountRequest other) { && oauthAppId.equals(other.oauthAppId) && appSlug.equals(other.appSlug) && cfmapJson.equals(other.cfmapJson) + && connectToken.equals(other.connectToken) && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.appId, this.externalUserId, this.oauthAppId, this.appSlug, this.cfmapJson, this.name); + return Objects.hash( + this.appId, + this.externalUserId, + this.oauthAppId, + this.appSlug, + this.cfmapJson, + this.connectToken, + this.name); } @java.lang.Override @@ -135,11 +155,25 @@ public interface AppSlugStage { /** *

The app slug for the account

*/ - _FinalStage appSlug(@NotNull String appSlug); + CfmapJsonStage appSlug(@NotNull String appSlug); Builder from(CreateAccountRequest other); } + public interface CfmapJsonStage { + /** + *

JSON string containing the custom fields mapping

+ */ + ConnectTokenStage cfmapJson(@NotNull String cfmapJson); + } + + public interface ConnectTokenStage { + /** + *

The connect token for authentication

+ */ + _FinalStage connectToken(@NotNull String connectToken); + } + public interface _FinalStage { CreateAccountRequest build(); @@ -161,13 +195,6 @@ public interface _FinalStage { _FinalStage oauthAppId(String oauthAppId); - /** - *

JSON string containing the custom fields mapping

- */ - _FinalStage cfmapJson(Optional cfmapJson); - - _FinalStage cfmapJson(String cfmapJson); - /** *

Optional name for the account

*/ @@ -177,12 +204,14 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AppSlugStage, _FinalStage { + public static final class Builder implements AppSlugStage, CfmapJsonStage, ConnectTokenStage, _FinalStage { private String appSlug; - private Optional name = Optional.empty(); + private String cfmapJson; - private Optional cfmapJson = Optional.empty(); + private String connectToken; + + private Optional name = Optional.empty(); private Optional oauthAppId = Optional.empty(); @@ -202,6 +231,7 @@ public Builder from(CreateAccountRequest other) { oauthAppId(other.getOauthAppId()); appSlug(other.getAppSlug()); cfmapJson(other.getCfmapJson()); + connectToken(other.getConnectToken()); name(other.getName()); return this; } @@ -213,48 +243,52 @@ public Builder from(CreateAccountRequest other) { */ @java.lang.Override @JsonSetter("app_slug") - public _FinalStage appSlug(@NotNull String appSlug) { + public CfmapJsonStage appSlug(@NotNull String appSlug) { this.appSlug = Objects.requireNonNull(appSlug, "appSlug must not be null"); return this; } /** - *

Optional name for the account

+ *

JSON string containing the custom fields mapping

+ *

JSON string containing the custom fields mapping

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage name(String name) { - this.name = Optional.ofNullable(name); + @JsonSetter("cfmap_json") + public ConnectTokenStage cfmapJson(@NotNull String cfmapJson) { + this.cfmapJson = Objects.requireNonNull(cfmapJson, "cfmapJson must not be null"); return this; } /** - *

Optional name for the account

+ *

The connect token for authentication

+ *

The connect token for authentication

+ * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public _FinalStage name(Optional name) { - this.name = name; + @JsonSetter("connect_token") + public _FinalStage connectToken(@NotNull String connectToken) { + this.connectToken = Objects.requireNonNull(connectToken, "connectToken must not be null"); return this; } /** - *

JSON string containing the custom fields mapping

+ *

Optional name for the account

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage cfmapJson(String cfmapJson) { - this.cfmapJson = Optional.ofNullable(cfmapJson); + public _FinalStage name(String name) { + this.name = Optional.ofNullable(name); return this; } /** - *

JSON string containing the custom fields mapping

+ *

Optional name for the account

*/ @java.lang.Override - @JsonSetter(value = "cfmap_json", nulls = Nulls.SKIP) - public _FinalStage cfmapJson(Optional cfmapJson) { - this.cfmapJson = cfmapJson; + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; return this; } @@ -314,7 +348,7 @@ public _FinalStage appId(Optional appId) { @java.lang.Override public CreateAccountRequest build() { return new CreateAccountRequest( - appId, externalUserId, oauthAppId, appSlug, cfmapJson, name, additionalProperties); + appId, externalUserId, oauthAppId, appSlug, cfmapJson, connectToken, name, additionalProperties); } } } diff --git a/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java b/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java index 9686990..8b1ab94 100644 --- a/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java +++ b/src/main/java/com/pipedream/api/resources/actions/AsyncRawActionsClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.actions; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -47,15 +47,15 @@ public AsyncRawActionsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list() { + public CompletableFuture>> list() { return list(ActionsListRequest.builder().build()); } - public CompletableFuture>> list(ActionsListRequest request) { + public CompletableFuture>> list(ActionsListRequest request) { return list(request, null); } - public CompletableFuture>> list( + public CompletableFuture>> list( ActionsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -90,7 +90,7 @@ public CompletableFuture> if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -105,7 +105,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO .after(startingAfter) .build(); List result = parsedResponse.getData(); - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( new SyncPagingIterable(startingAfter.isPresent(), result, () -> { try { return list(nextRequest, requestOptions) @@ -119,30 +119,30 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> retrieve(String componentId) { + public CompletableFuture> retrieve(String componentId) { return retrieve(componentId, null); } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String componentId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -161,7 +161,7 @@ public CompletableFuture> retrieve( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -169,35 +169,35 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { GetComponentResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - future.complete(new PipedreamApiHttpResponse<>(parsedResponse.getData(), response)); + future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> configureProp( + public CompletableFuture> configureProp( ActionsConfigurePropRequest request) { return configureProp(request, null); } - public CompletableFuture> configureProp( + public CompletableFuture> configureProp( ActionsConfigurePropRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -226,43 +226,43 @@ public CompletableFuture> config if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> reloadProps( + public CompletableFuture> reloadProps( ActionsReloadPropsRequest request) { return reloadProps(request, null); } - public CompletableFuture> reloadProps( + public CompletableFuture> reloadProps( ActionsReloadPropsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -291,42 +291,42 @@ public CompletableFuture> reloadPr if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> run(RunActionOpts request) { + public CompletableFuture> run(RunActionOpts request) { return run(request, null); } - public CompletableFuture> run( + public CompletableFuture> run( RunActionOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -364,32 +364,32 @@ public CompletableFuture> run( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RunActionResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java b/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java index eee1aa6..1dbf30b 100644 --- a/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java +++ b/src/main/java/com/pipedream/api/resources/actions/RawActionsClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.actions; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -42,15 +42,15 @@ public RawActionsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> list() { + public BaseClientHttpResponse> list() { return list(ActionsListRequest.builder().build()); } - public PipedreamApiHttpResponse> list(ActionsListRequest request) { + public BaseClientHttpResponse> list(ActionsListRequest request) { return list(request, null); } - public PipedreamApiHttpResponse> list( + public BaseClientHttpResponse> list( ActionsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -96,28 +96,28 @@ public PipedreamApiHttpResponse> list( .after(startingAfter) .build(); List result = parsedResponse.getData(); - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( new SyncPagingIterable( startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) .body()), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse retrieve(String componentId) { + public BaseClientHttpResponse retrieve(String componentId) { return retrieve(componentId, null); } - public PipedreamApiHttpResponse retrieve(String componentId, RequestOptions requestOptions) { + public BaseClientHttpResponse retrieve(String componentId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -140,24 +140,24 @@ public PipedreamApiHttpResponse retrieve(String componentId, RequestO if (response.isSuccessful()) { GetComponentResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - return new PipedreamApiHttpResponse<>(parsedResponse.getData(), response); + return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse configureProp(ActionsConfigurePropRequest request) { + public BaseClientHttpResponse configureProp(ActionsConfigurePropRequest request) { return configureProp(request, null); } - public PipedreamApiHttpResponse configureProp( + public BaseClientHttpResponse configureProp( ActionsConfigurePropRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -189,26 +189,26 @@ public PipedreamApiHttpResponse configureProp( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse reloadProps(ActionsReloadPropsRequest request) { + public BaseClientHttpResponse reloadProps(ActionsReloadPropsRequest request) { return reloadProps(request, null); } - public PipedreamApiHttpResponse reloadProps( + public BaseClientHttpResponse reloadProps( ActionsReloadPropsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -240,26 +240,26 @@ public PipedreamApiHttpResponse reloadProps( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse run(RunActionOpts request) { + public BaseClientHttpResponse run(RunActionOpts request) { return run(request, null); } - public PipedreamApiHttpResponse run(RunActionOpts request, RequestOptions requestOptions) { + public BaseClientHttpResponse run(RunActionOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -299,17 +299,17 @@ public PipedreamApiHttpResponse run(RunActionOpts request, Re try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RunActionResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java b/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java index c7a7bf5..ebaf619 100644 --- a/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java +++ b/src/main/java/com/pipedream/api/resources/appcategories/AsyncRawAppCategoriesClient.java @@ -4,11 +4,11 @@ package com.pipedream.api.resources.appcategories; import com.fasterxml.jackson.core.type.TypeReference; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.types.AppCategory; import java.io.IOException; @@ -31,11 +31,11 @@ public AsyncRawAppCategoriesClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list() { + public CompletableFuture>> list() { return list(null); } - public CompletableFuture>> list(RequestOptions requestOptions) { + public CompletableFuture>> list(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/app_categories") @@ -50,43 +50,43 @@ public CompletableFuture>> list(Reque if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> retrieve(String id) { + public CompletableFuture> retrieve(String id) { return retrieve(id, null); } - public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/app_categories") @@ -102,32 +102,32 @@ public CompletableFuture> retrieve(String if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AppCategory.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java b/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java index 497bd77..9fb1c24 100644 --- a/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java +++ b/src/main/java/com/pipedream/api/resources/appcategories/RawAppCategoriesClient.java @@ -4,11 +4,11 @@ package com.pipedream.api.resources.appcategories; import com.fasterxml.jackson.core.type.TypeReference; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.types.AppCategory; import java.io.IOException; @@ -27,11 +27,11 @@ public RawAppCategoriesClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> list() { + public BaseClientHttpResponse> list() { return list(null); } - public PipedreamApiHttpResponse> list(RequestOptions requestOptions) { + public BaseClientHttpResponse> list(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/app_categories") @@ -49,27 +49,27 @@ public PipedreamApiHttpResponse> list(RequestOptions requestOp try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse retrieve(String id) { + public BaseClientHttpResponse retrieve(String id) { return retrieve(id, null); } - public PipedreamApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + public BaseClientHttpResponse retrieve(String id, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/app_categories") @@ -88,17 +88,17 @@ public PipedreamApiHttpResponse retrieve(String id, RequestOptions try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AppCategory.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java b/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java index 42967c0..bd53d7d 100644 --- a/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java +++ b/src/main/java/com/pipedream/api/resources/apps/AsyncRawAppsClient.java @@ -3,11 +3,11 @@ */ package com.pipedream.api.resources.apps; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -37,15 +37,15 @@ public AsyncRawAppsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list() { + public CompletableFuture>> list() { return list(AppsListRequest.builder().build()); } - public CompletableFuture>> list(AppsListRequest request) { + public CompletableFuture>> list(AppsListRequest request) { return list(request, null); } - public CompletableFuture>> list( + public CompletableFuture>> list( AppsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -87,7 +87,7 @@ public CompletableFuture>> list if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -102,7 +102,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO .after(startingAfter) .build(); List result = parsedResponse.getData(); - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( new SyncPagingIterable(startingAfter.isPresent(), result, () -> { try { return list(nextRequest, requestOptions) @@ -116,30 +116,30 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> retrieve(String appId) { + public CompletableFuture> retrieve(String appId) { return retrieve(appId, null); } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String appId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -156,32 +156,32 @@ public CompletableFuture> retrieve( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetAppResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java b/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java index 37619d9..8b4a892 100644 --- a/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java +++ b/src/main/java/com/pipedream/api/resources/apps/RawAppsClient.java @@ -3,11 +3,11 @@ */ package com.pipedream.api.resources.apps; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -32,15 +32,15 @@ public RawAppsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> list() { + public BaseClientHttpResponse> list() { return list(AppsListRequest.builder().build()); } - public PipedreamApiHttpResponse> list(AppsListRequest request) { + public BaseClientHttpResponse> list(AppsListRequest request) { return list(request, null); } - public PipedreamApiHttpResponse> list( + public BaseClientHttpResponse> list( AppsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -93,28 +93,28 @@ public PipedreamApiHttpResponse> list( .after(startingAfter) .build(); List result = parsedResponse.getData(); - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( new SyncPagingIterable( startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) .body()), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse retrieve(String appId) { + public BaseClientHttpResponse retrieve(String appId) { return retrieve(appId, null); } - public PipedreamApiHttpResponse retrieve(String appId, RequestOptions requestOptions) { + public BaseClientHttpResponse retrieve(String appId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect/apps") @@ -133,17 +133,17 @@ public PipedreamApiHttpResponse retrieve(String appId, RequestOp try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetAppResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java b/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java index 43e8178..f0e05a6 100644 --- a/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java +++ b/src/main/java/com/pipedream/api/resources/components/AsyncRawComponentsClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.components; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -43,16 +43,16 @@ public AsyncRawComponentsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list() { + public CompletableFuture>> list() { return list(ComponentsListRequest.builder().build()); } - public CompletableFuture>> list( + public CompletableFuture>> list( ComponentsListRequest request) { return list(request, null); } - public CompletableFuture>> list( + public CompletableFuture>> list( ComponentsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -87,7 +87,7 @@ public CompletableFuture> if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -102,7 +102,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO .after(startingAfter) .build(); List result = parsedResponse.getData(); - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( new SyncPagingIterable(startingAfter.isPresent(), result, () -> { try { return list(nextRequest, requestOptions) @@ -116,30 +116,30 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> retrieve(String componentId) { + public CompletableFuture> retrieve(String componentId) { return retrieve(componentId, null); } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String componentId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -158,7 +158,7 @@ public CompletableFuture> retrieve( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -166,35 +166,35 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { GetComponentResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - future.complete(new PipedreamApiHttpResponse<>(parsedResponse.getData(), response)); + future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> configureProp( + public CompletableFuture> configureProp( ComponentsConfigurePropRequest request) { return configureProp(request, null); } - public CompletableFuture> configureProp( + public CompletableFuture> configureProp( ComponentsConfigurePropRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -223,43 +223,43 @@ public CompletableFuture> config if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> reloadProps( + public CompletableFuture> reloadProps( ComponentsReloadPropsRequest request) { return reloadProps(request, null); } - public CompletableFuture> reloadProps( + public CompletableFuture> reloadProps( ComponentsReloadPropsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -288,32 +288,32 @@ public CompletableFuture> reloadPr if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java b/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java index cd8521d..9cd5a6f 100644 --- a/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java +++ b/src/main/java/com/pipedream/api/resources/components/RawComponentsClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.components; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -38,15 +38,15 @@ public RawComponentsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> list() { + public BaseClientHttpResponse> list() { return list(ComponentsListRequest.builder().build()); } - public PipedreamApiHttpResponse> list(ComponentsListRequest request) { + public BaseClientHttpResponse> list(ComponentsListRequest request) { return list(request, null); } - public PipedreamApiHttpResponse> list( + public BaseClientHttpResponse> list( ComponentsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -92,28 +92,28 @@ public PipedreamApiHttpResponse> list( .after(startingAfter) .build(); List result = parsedResponse.getData(); - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( new SyncPagingIterable( startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) .body()), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse retrieve(String componentId) { + public BaseClientHttpResponse retrieve(String componentId) { return retrieve(componentId, null); } - public PipedreamApiHttpResponse retrieve(String componentId, RequestOptions requestOptions) { + public BaseClientHttpResponse retrieve(String componentId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -136,24 +136,24 @@ public PipedreamApiHttpResponse retrieve(String componentId, RequestO if (response.isSuccessful()) { GetComponentResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - return new PipedreamApiHttpResponse<>(parsedResponse.getData(), response); + return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse configureProp(ComponentsConfigurePropRequest request) { + public BaseClientHttpResponse configureProp(ComponentsConfigurePropRequest request) { return configureProp(request, null); } - public PipedreamApiHttpResponse configureProp( + public BaseClientHttpResponse configureProp( ComponentsConfigurePropRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -185,26 +185,26 @@ public PipedreamApiHttpResponse configureProp( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse reloadProps(ComponentsReloadPropsRequest request) { + public BaseClientHttpResponse reloadProps(ComponentsReloadPropsRequest request) { return reloadProps(request, null); } - public PipedreamApiHttpResponse reloadProps( + public BaseClientHttpResponse reloadProps( ComponentsReloadPropsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -236,18 +236,18 @@ public PipedreamApiHttpResponse reloadProps( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java b/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java index cbee597..e91dca3 100644 --- a/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java +++ b/src/main/java/com/pipedream/api/resources/deployedtriggers/AsyncRawDeployedTriggersClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.deployedtriggers; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -53,12 +53,12 @@ public AsyncRawDeployedTriggersClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list( + public CompletableFuture>> list( DeployedTriggersListRequest request) { return list(request, null); } - public CompletableFuture>> list( + public CompletableFuture>> list( DeployedTriggersListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -88,7 +88,7 @@ public CompletableFuture>> future = + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override @@ -104,7 +104,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO .after(startingAfter) .build(); List result = parsedResponse.getData(); - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( new SyncPagingIterable(startingAfter.isPresent(), result, () -> { try { return list(nextRequest, requestOptions) @@ -118,31 +118,31 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String triggerId, DeployedTriggersRetrieveRequest request) { return retrieve(triggerId, request, null); } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String triggerId, DeployedTriggersRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -161,7 +161,7 @@ public CompletableFuture> retrieve( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -169,35 +169,35 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { GetTriggerResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); - future.complete(new PipedreamApiHttpResponse<>(parsedResponse.getData(), response)); + future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> update( + public CompletableFuture> update( String triggerId, UpdateTriggerOpts request) { return update(triggerId, request, null); } - public CompletableFuture> update( + public CompletableFuture> update( String triggerId, UpdateTriggerOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -234,7 +234,7 @@ public CompletableFuture> update( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -242,35 +242,35 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { GetTriggerResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); - future.complete(new PipedreamApiHttpResponse<>(parsedResponse.getData(), response)); + future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> delete( + public CompletableFuture> delete( String triggerId, DeployedTriggersDeleteRequest request) { return delete(triggerId, request, null); } - public CompletableFuture> delete( + public CompletableFuture> delete( String triggerId, DeployedTriggersDeleteRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -292,41 +292,41 @@ public CompletableFuture> delete( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>(null, response)); + future.complete(new BaseClientHttpResponse<>(null, response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture>> listEvents( + public CompletableFuture>> listEvents( String triggerId, DeployedTriggersListEventsRequest request) { return listEvents(triggerId, request, null); } - public CompletableFuture>> listEvents( + public CompletableFuture>> listEvents( String triggerId, DeployedTriggersListEventsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -349,7 +349,7 @@ public CompletableFuture>> listEvent if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -357,35 +357,35 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { GetTriggerEventsResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), GetTriggerEventsResponse.class); - future.complete(new PipedreamApiHttpResponse<>(parsedResponse.getData(), response)); + future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> listWorkflows( + public CompletableFuture> listWorkflows( String triggerId, DeployedTriggersListWorkflowsRequest request) { return listWorkflows(triggerId, request, null); } - public CompletableFuture> listWorkflows( + public CompletableFuture> listWorkflows( String triggerId, DeployedTriggersListWorkflowsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -405,44 +405,44 @@ public CompletableFuture> if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), GetTriggerWorkflowsResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> updateWorkflows( + public CompletableFuture> updateWorkflows( String triggerId, UpdateTriggerWorkflowsOpts request) { return updateWorkflows(triggerId, request, null); } - public CompletableFuture> updateWorkflows( + public CompletableFuture> updateWorkflows( String triggerId, UpdateTriggerWorkflowsOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -472,44 +472,44 @@ public CompletableFuture> if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), GetTriggerWorkflowsResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> listWebhooks( + public CompletableFuture> listWebhooks( String triggerId, DeployedTriggersListWebhooksRequest request) { return listWebhooks(triggerId, request, null); } - public CompletableFuture> listWebhooks( + public CompletableFuture> listWebhooks( String triggerId, DeployedTriggersListWebhooksRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -529,44 +529,44 @@ public CompletableFuture> l if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), GetTriggerWebhooksResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> updateWebhooks( + public CompletableFuture> updateWebhooks( String triggerId, UpdateTriggerWebhooksOpts request) { return updateWebhooks(triggerId, request, null); } - public CompletableFuture> updateWebhooks( + public CompletableFuture> updateWebhooks( String triggerId, UpdateTriggerWebhooksOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -596,33 +596,33 @@ public CompletableFuture> u if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), GetTriggerWebhooksResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java b/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java index 0e1e09f..837d672 100644 --- a/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java +++ b/src/main/java/com/pipedream/api/resources/deployedtriggers/RawDeployedTriggersClient.java @@ -3,12 +3,12 @@ */ package com.pipedream.api.resources.deployedtriggers; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -48,11 +48,11 @@ public RawDeployedTriggersClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> list(DeployedTriggersListRequest request) { + public BaseClientHttpResponse> list(DeployedTriggersListRequest request) { return list(request, null); } - public PipedreamApiHttpResponse> list( + public BaseClientHttpResponse> list( DeployedTriggersListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -93,29 +93,29 @@ public PipedreamApiHttpResponse> list( .after(startingAfter) .build(); List result = parsedResponse.getData(); - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( new SyncPagingIterable( startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) .body()), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse retrieve( + public BaseClientHttpResponse retrieve( String triggerId, DeployedTriggersRetrieveRequest request) { return retrieve(triggerId, request, null); } - public PipedreamApiHttpResponse retrieve( + public BaseClientHttpResponse retrieve( String triggerId, DeployedTriggersRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -139,24 +139,24 @@ public PipedreamApiHttpResponse retrieve( if (response.isSuccessful()) { GetTriggerResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); - return new PipedreamApiHttpResponse<>(parsedResponse.getData(), response); + return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse update(String triggerId, UpdateTriggerOpts request) { + public BaseClientHttpResponse update(String triggerId, UpdateTriggerOpts request) { return update(triggerId, request, null); } - public PipedreamApiHttpResponse update( + public BaseClientHttpResponse update( String triggerId, UpdateTriggerOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -198,24 +198,24 @@ public PipedreamApiHttpResponse update( if (response.isSuccessful()) { GetTriggerResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerResponse.class); - return new PipedreamApiHttpResponse<>(parsedResponse.getData(), response); + return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse delete(String triggerId, DeployedTriggersDeleteRequest request) { + public BaseClientHttpResponse delete(String triggerId, DeployedTriggersDeleteRequest request) { return delete(triggerId, request, null); } - public PipedreamApiHttpResponse delete( + public BaseClientHttpResponse delete( String triggerId, DeployedTriggersDeleteRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -240,25 +240,25 @@ public PipedreamApiHttpResponse delete( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>(null, response); + return new BaseClientHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse> listEvents( + public BaseClientHttpResponse> listEvents( String triggerId, DeployedTriggersListEventsRequest request) { return listEvents(triggerId, request, null); } - public PipedreamApiHttpResponse> listEvents( + public BaseClientHttpResponse> listEvents( String triggerId, DeployedTriggersListEventsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -286,25 +286,25 @@ public PipedreamApiHttpResponse> listEvents( if (response.isSuccessful()) { GetTriggerEventsResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerEventsResponse.class); - return new PipedreamApiHttpResponse<>(parsedResponse.getData(), response); + return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse listWorkflows( + public BaseClientHttpResponse listWorkflows( String triggerId, DeployedTriggersListWorkflowsRequest request) { return listWorkflows(triggerId, request, null); } - public PipedreamApiHttpResponse listWorkflows( + public BaseClientHttpResponse listWorkflows( String triggerId, DeployedTriggersListWorkflowsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -327,27 +327,27 @@ public PipedreamApiHttpResponse listWorkflows( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWorkflowsResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse updateWorkflows( + public BaseClientHttpResponse updateWorkflows( String triggerId, UpdateTriggerWorkflowsOpts request) { return updateWorkflows(triggerId, request, null); } - public PipedreamApiHttpResponse updateWorkflows( + public BaseClientHttpResponse updateWorkflows( String triggerId, UpdateTriggerWorkflowsOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -380,27 +380,27 @@ public PipedreamApiHttpResponse updateWorkflows( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWorkflowsResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse listWebhooks( + public BaseClientHttpResponse listWebhooks( String triggerId, DeployedTriggersListWebhooksRequest request) { return listWebhooks(triggerId, request, null); } - public PipedreamApiHttpResponse listWebhooks( + public BaseClientHttpResponse listWebhooks( String triggerId, DeployedTriggersListWebhooksRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -423,27 +423,27 @@ public PipedreamApiHttpResponse listWebhooks( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWebhooksResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse updateWebhooks( + public BaseClientHttpResponse updateWebhooks( String triggerId, UpdateTriggerWebhooksOpts request) { return updateWebhooks(triggerId, request, null); } - public PipedreamApiHttpResponse updateWebhooks( + public BaseClientHttpResponse updateWebhooks( String triggerId, UpdateTriggerWebhooksOpts request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -476,18 +476,18 @@ public PipedreamApiHttpResponse updateWebhooks( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetTriggerWebhooksResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncRawOauthTokensClient.java b/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncRawOauthTokensClient.java index cc29bb8..1e0479b 100644 --- a/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncRawOauthTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/oauthtokens/AsyncRawOauthTokensClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.oauthtokens; import com.fasterxml.jackson.core.JsonProcessingException; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.resources.oauthtokens.requests.CreateOAuthTokenOpts; import com.pipedream.api.types.CreateOAuthTokenResponse; @@ -33,11 +33,11 @@ public AsyncRawOauthTokensClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture> create(CreateOAuthTokenOpts request) { + public CompletableFuture> create(CreateOAuthTokenOpts request) { return create(request, null); } - public CompletableFuture> create( + public CompletableFuture> create( CreateOAuthTokenOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -48,7 +48,7 @@ public CompletableFuture> cre body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { - throw new PipedreamApiException("Failed to serialize request", e); + throw new BaseClientException("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -61,33 +61,33 @@ public CompletableFuture> cre if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), CreateOAuthTokenResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java b/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java index c7096b4..6dd34fb 100644 --- a/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/oauthtokens/RawOauthTokensClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.oauthtokens; import com.fasterxml.jackson.core.JsonProcessingException; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.resources.oauthtokens.requests.CreateOAuthTokenOpts; import com.pipedream.api.types.CreateOAuthTokenResponse; @@ -29,11 +29,11 @@ public RawOauthTokensClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse create(CreateOAuthTokenOpts request) { + public BaseClientHttpResponse create(CreateOAuthTokenOpts request) { return create(request, null); } - public PipedreamApiHttpResponse create( + public BaseClientHttpResponse create( CreateOAuthTokenOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -44,7 +44,7 @@ public PipedreamApiHttpResponse create( body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { - throw new PipedreamApiException("Failed to serialize request", e); + throw new BaseClientException("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -60,18 +60,18 @@ public PipedreamApiHttpResponse create( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreateOAuthTokenResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java b/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java index df37ce8..89c9ec3 100644 --- a/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java +++ b/src/main/java/com/pipedream/api/resources/projects/AsyncRawProjectsClient.java @@ -3,11 +3,11 @@ */ package com.pipedream.api.resources.projects; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.types.ProjectInfoResponse; import java.io.IOException; @@ -29,12 +29,11 @@ public AsyncRawProjectsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture> retrieveInfo() { + public CompletableFuture> retrieveInfo() { return retrieveInfo(null); } - public CompletableFuture> retrieveInfo( - RequestOptions requestOptions) { + public CompletableFuture> retrieveInfo(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -51,32 +50,32 @@ public CompletableFuture> retrieve if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ProjectInfoResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java b/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java index d09dc32..c927bf5 100644 --- a/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java +++ b/src/main/java/com/pipedream/api/resources/projects/RawProjectsClient.java @@ -3,11 +3,11 @@ */ package com.pipedream.api.resources.projects; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.types.ProjectInfoResponse; import java.io.IOException; @@ -25,11 +25,11 @@ public RawProjectsClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse retrieveInfo() { + public BaseClientHttpResponse retrieveInfo() { return retrieveInfo(null); } - public PipedreamApiHttpResponse retrieveInfo(RequestOptions requestOptions) { + public BaseClientHttpResponse retrieveInfo(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -49,18 +49,18 @@ public PipedreamApiHttpResponse retrieveInfo(RequestOptions try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ProjectInfoResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java b/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java index d6737d6..30ca813 100644 --- a/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java +++ b/src/main/java/com/pipedream/api/resources/proxy/AsyncRawProxyClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.proxy; import com.fasterxml.jackson.core.type.TypeReference; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.resources.proxy.requests.ProxyDeleteRequest; @@ -38,11 +38,11 @@ public AsyncRawProxyClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> get(String url64, ProxyGetRequest request) { + public CompletableFuture>> get(String url64, ProxyGetRequest request) { return get(url64, request, null); } - public CompletableFuture>> get( + public CompletableFuture>> get( String url64, ProxyGetRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -62,44 +62,43 @@ public CompletableFuture>> get( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture>> post( - String url64, ProxyPostRequest request) { + public CompletableFuture>> post(String url64, ProxyPostRequest request) { return post(url64, request, null); } - public CompletableFuture>> post( + public CompletableFuture>> post( String url64, ProxyPostRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -127,43 +126,43 @@ public CompletableFuture>> post( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture>> put(String url64, ProxyPutRequest request) { + public CompletableFuture>> put(String url64, ProxyPutRequest request) { return put(url64, request, null); } - public CompletableFuture>> put( + public CompletableFuture>> put( String url64, ProxyPutRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -191,44 +190,44 @@ public CompletableFuture>> put( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture>> delete( + public CompletableFuture>> delete( String url64, ProxyDeleteRequest request) { return delete(url64, request, null); } - public CompletableFuture>> delete( + public CompletableFuture>> delete( String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -248,44 +247,44 @@ public CompletableFuture>> delete( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture>> patch( + public CompletableFuture>> patch( String url64, ProxyPatchRequest request) { return patch(url64, request, null); } - public CompletableFuture>> patch( + public CompletableFuture>> patch( String url64, ProxyPatchRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -313,33 +312,33 @@ public CompletableFuture>> patch( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java b/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java index 9720f2b..fb9c5bf 100644 --- a/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java +++ b/src/main/java/com/pipedream/api/resources/proxy/RawProxyClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.proxy; import com.fasterxml.jackson.core.type.TypeReference; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.resources.proxy.requests.ProxyDeleteRequest; @@ -34,11 +34,11 @@ public RawProxyClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> get(String url64, ProxyGetRequest request) { + public BaseClientHttpResponse> get(String url64, ProxyGetRequest request) { return get(url64, request, null); } - public PipedreamApiHttpResponse> get( + public BaseClientHttpResponse> get( String url64, ProxyGetRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -61,27 +61,27 @@ public PipedreamApiHttpResponse> get( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse> post(String url64, ProxyPostRequest request) { + public BaseClientHttpResponse> post(String url64, ProxyPostRequest request) { return post(url64, request, null); } - public PipedreamApiHttpResponse> post( + public BaseClientHttpResponse> post( String url64, ProxyPostRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -112,27 +112,27 @@ public PipedreamApiHttpResponse> post( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse> put(String url64, ProxyPutRequest request) { + public BaseClientHttpResponse> put(String url64, ProxyPutRequest request) { return put(url64, request, null); } - public PipedreamApiHttpResponse> put( + public BaseClientHttpResponse> put( String url64, ProxyPutRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -163,27 +163,27 @@ public PipedreamApiHttpResponse> put( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse> delete(String url64, ProxyDeleteRequest request) { + public BaseClientHttpResponse> delete(String url64, ProxyDeleteRequest request) { return delete(url64, request, null); } - public PipedreamApiHttpResponse> delete( + public BaseClientHttpResponse> delete( String url64, ProxyDeleteRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -206,27 +206,27 @@ public PipedreamApiHttpResponse> delete( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse> patch(String url64, ProxyPatchRequest request) { + public BaseClientHttpResponse> patch(String url64, ProxyPatchRequest request) { return patch(url64, request, null); } - public PipedreamApiHttpResponse> patch( + public BaseClientHttpResponse> patch( String url64, ProxyPatchRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -257,19 +257,19 @@ public PipedreamApiHttpResponse> patch( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( responseBody.string(), new TypeReference>() {}), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java b/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java index 9ddd525..84570a9 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/tokens/AsyncRawTokensClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.tokens; import com.fasterxml.jackson.core.JsonProcessingException; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.resources.tokens.requests.CreateTokenRequest; @@ -36,11 +36,11 @@ public AsyncRawTokensClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture> create(CreateTokenRequest request) { + public CompletableFuture> create(CreateTokenRequest request) { return create(request, null); } - public CompletableFuture> create( + public CompletableFuture> create( CreateTokenRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -51,7 +51,7 @@ public CompletableFuture> create( body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { - throw new PipedreamApiException("Failed to serialize request", e); + throw new BaseClientException("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -64,47 +64,47 @@ public CompletableFuture> create( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreateTokenResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> validate(String ctok) { + public CompletableFuture> validate(String ctok) { return validate(ctok, TokensValidateRequest.builder().build()); } - public CompletableFuture> validate( + public CompletableFuture> validate( String ctok, TokensValidateRequest request) { return validate(ctok, request, null); } - public CompletableFuture> validate( + public CompletableFuture> validate( String ctok, TokensValidateRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -125,32 +125,32 @@ public CompletableFuture> valida if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ValidateTokenResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java b/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java index d20fbea..b18022c 100644 --- a/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java +++ b/src/main/java/com/pipedream/api/resources/tokens/RawTokensClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.tokens; import com.fasterxml.jackson.core.JsonProcessingException; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.resources.tokens.requests.CreateTokenRequest; @@ -32,11 +32,11 @@ public RawTokensClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse create(CreateTokenRequest request) { + public BaseClientHttpResponse create(CreateTokenRequest request) { return create(request, null); } - public PipedreamApiHttpResponse create( + public BaseClientHttpResponse create( CreateTokenRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -47,7 +47,7 @@ public PipedreamApiHttpResponse create( body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { - throw new PipedreamApiException("Failed to serialize request", e); + throw new BaseClientException("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -63,30 +63,30 @@ public PipedreamApiHttpResponse create( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreateTokenResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse validate(String ctok) { + public BaseClientHttpResponse validate(String ctok) { return validate(ctok, TokensValidateRequest.builder().build()); } - public PipedreamApiHttpResponse validate(String ctok, TokensValidateRequest request) { + public BaseClientHttpResponse validate(String ctok, TokensValidateRequest request) { return validate(ctok, request, null); } - public PipedreamApiHttpResponse validate( + public BaseClientHttpResponse validate( String ctok, TokensValidateRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -110,18 +110,18 @@ public PipedreamApiHttpResponse validate( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ValidateTokenResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java b/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java index 8e4c08a..ddc9aff 100644 --- a/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java +++ b/src/main/java/com/pipedream/api/resources/triggers/AsyncRawTriggersClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.triggers; import com.fasterxml.jackson.core.JsonProcessingException; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -47,16 +47,15 @@ public AsyncRawTriggersClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture>> list() { + public CompletableFuture>> list() { return list(TriggersListRequest.builder().build()); } - public CompletableFuture>> list( - TriggersListRequest request) { + public CompletableFuture>> list(TriggersListRequest request) { return list(request, null); } - public CompletableFuture>> list( + public CompletableFuture>> list( TriggersListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -91,7 +90,7 @@ public CompletableFuture> if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture>> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -106,7 +105,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO .after(startingAfter) .build(); List result = parsedResponse.getData(); - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( new SyncPagingIterable(startingAfter.isPresent(), result, () -> { try { return list(nextRequest, requestOptions) @@ -120,30 +119,30 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> retrieve(String componentId) { + public CompletableFuture> retrieve(String componentId) { return retrieve(componentId, null); } - public CompletableFuture> retrieve( + public CompletableFuture> retrieve( String componentId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -162,7 +161,7 @@ public CompletableFuture> retrieve( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -170,35 +169,35 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { GetComponentResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - future.complete(new PipedreamApiHttpResponse<>(parsedResponse.getData(), response)); + future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> configureProp( + public CompletableFuture> configureProp( TriggersConfigurePropRequest request) { return configureProp(request, null); } - public CompletableFuture> configureProp( + public CompletableFuture> configureProp( TriggersConfigurePropRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -227,43 +226,43 @@ public CompletableFuture> config if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> reloadProps( + public CompletableFuture> reloadProps( TriggersReloadPropsRequest request) { return reloadProps(request, null); } - public CompletableFuture> reloadProps( + public CompletableFuture> reloadProps( TriggersReloadPropsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -292,42 +291,42 @@ public CompletableFuture> reloadPr if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>( + future.complete(new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; } - public CompletableFuture> deploy(DeployTriggerOpts request) { + public CompletableFuture> deploy(DeployTriggerOpts request) { return deploy(request, null); } - public CompletableFuture> deploy( + public CompletableFuture> deploy( DeployTriggerOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -340,7 +339,7 @@ public CompletableFuture> deploy( body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { - throw new PipedreamApiException("Failed to serialize request", e); + throw new BaseClientException("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -353,7 +352,7 @@ public CompletableFuture> deploy( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -361,24 +360,24 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO if (response.isSuccessful()) { DeployTriggerResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DeployTriggerResponse.class); - future.complete(new PipedreamApiHttpResponse<>(parsedResponse.getData(), response)); + future.complete(new BaseClientHttpResponse<>(parsedResponse.getData(), response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java b/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java index 83abd08..192686d 100644 --- a/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java +++ b/src/main/java/com/pipedream/api/resources/triggers/RawTriggersClient.java @@ -4,12 +4,12 @@ package com.pipedream.api.resources.triggers; import com.fasterxml.jackson.core.JsonProcessingException; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.MediaTypes; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.QueryStringMapper; import com.pipedream.api.core.RequestOptions; import com.pipedream.api.core.pagination.SyncPagingIterable; @@ -42,15 +42,15 @@ public RawTriggersClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse> list() { + public BaseClientHttpResponse> list() { return list(TriggersListRequest.builder().build()); } - public PipedreamApiHttpResponse> list(TriggersListRequest request) { + public BaseClientHttpResponse> list(TriggersListRequest request) { return list(request, null); } - public PipedreamApiHttpResponse> list( + public BaseClientHttpResponse> list( TriggersListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -96,28 +96,28 @@ public PipedreamApiHttpResponse> list( .after(startingAfter) .build(); List result = parsedResponse.getData(); - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( new SyncPagingIterable( startingAfter.isPresent(), result, () -> list(nextRequest, requestOptions) .body()), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse retrieve(String componentId) { + public BaseClientHttpResponse retrieve(String componentId) { return retrieve(componentId, null); } - public PipedreamApiHttpResponse retrieve(String componentId, RequestOptions requestOptions) { + public BaseClientHttpResponse retrieve(String componentId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -140,24 +140,24 @@ public PipedreamApiHttpResponse retrieve(String componentId, RequestO if (response.isSuccessful()) { GetComponentResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GetComponentResponse.class); - return new PipedreamApiHttpResponse<>(parsedResponse.getData(), response); + return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse configureProp(TriggersConfigurePropRequest request) { + public BaseClientHttpResponse configureProp(TriggersConfigurePropRequest request) { return configureProp(request, null); } - public PipedreamApiHttpResponse configureProp( + public BaseClientHttpResponse configureProp( TriggersConfigurePropRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -189,26 +189,26 @@ public PipedreamApiHttpResponse configureProp( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ConfigurePropResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse reloadProps(TriggersReloadPropsRequest request) { + public BaseClientHttpResponse reloadProps(TriggersReloadPropsRequest request) { return reloadProps(request, null); } - public PipedreamApiHttpResponse reloadProps( + public BaseClientHttpResponse reloadProps( TriggersReloadPropsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -240,27 +240,26 @@ public PipedreamApiHttpResponse reloadProps( try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>( + return new BaseClientHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ReloadPropsResponse.class), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } - public PipedreamApiHttpResponse deploy(DeployTriggerOpts request) { + public BaseClientHttpResponse deploy(DeployTriggerOpts request) { return deploy(request, null); } - public PipedreamApiHttpResponse deploy( - DeployTriggerOpts request, RequestOptions requestOptions) { + public BaseClientHttpResponse deploy(DeployTriggerOpts request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -272,7 +271,7 @@ public PipedreamApiHttpResponse deploy( body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { - throw new PipedreamApiException("Failed to serialize request", e); + throw new BaseClientException("Failed to serialize request", e); } Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -290,16 +289,16 @@ public PipedreamApiHttpResponse deploy( if (response.isSuccessful()) { DeployTriggerResponse parsedResponse = ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DeployTriggerResponse.class); - return new PipedreamApiHttpResponse<>(parsedResponse.getData(), response); + return new BaseClientHttpResponse<>(parsedResponse.getData(), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } } diff --git a/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java b/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java index 5cb2cdb..53d886e 100644 --- a/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java +++ b/src/main/java/com/pipedream/api/resources/users/AsyncRawUsersClient.java @@ -3,11 +3,11 @@ */ package com.pipedream.api.resources.users; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import java.io.IOException; import java.util.concurrent.CompletableFuture; @@ -28,11 +28,11 @@ public AsyncRawUsersClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public CompletableFuture> deleteExternalUser(String externalUserId) { + public CompletableFuture> deleteExternalUser(String externalUserId) { return deleteExternalUser(externalUserId, null); } - public CompletableFuture> deleteExternalUser( + public CompletableFuture> deleteExternalUser( String externalUserId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -50,30 +50,30 @@ public CompletableFuture> deleteExternalUser( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { if (response.isSuccessful()) { - future.complete(new PipedreamApiHttpResponse<>(null, response)); + future.complete(new BaseClientHttpResponse<>(null, response)); return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - future.completeExceptionally(new PipedreamApiApiException( + future.completeExceptionally(new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; } catch (IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } } @Override public void onFailure(@NotNull Call call, @NotNull IOException e) { - future.completeExceptionally(new PipedreamApiException("Network error executing HTTP request", e)); + future.completeExceptionally(new BaseClientException("Network error executing HTTP request", e)); } }); return future; diff --git a/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java b/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java index 7fe69c9..69011b7 100644 --- a/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java +++ b/src/main/java/com/pipedream/api/resources/users/RawUsersClient.java @@ -3,11 +3,11 @@ */ package com.pipedream.api.resources.users; +import com.pipedream.api.core.BaseClientApiException; +import com.pipedream.api.core.BaseClientException; +import com.pipedream.api.core.BaseClientHttpResponse; import com.pipedream.api.core.ClientOptions; import com.pipedream.api.core.ObjectMappers; -import com.pipedream.api.core.PipedreamApiApiException; -import com.pipedream.api.core.PipedreamApiException; -import com.pipedream.api.core.PipedreamApiHttpResponse; import com.pipedream.api.core.RequestOptions; import java.io.IOException; import okhttp3.Headers; @@ -24,11 +24,11 @@ public RawUsersClient(ClientOptions clientOptions) { this.clientOptions = clientOptions; } - public PipedreamApiHttpResponse deleteExternalUser(String externalUserId) { + public BaseClientHttpResponse deleteExternalUser(String externalUserId) { return deleteExternalUser(externalUserId, null); } - public PipedreamApiHttpResponse deleteExternalUser(String externalUserId, RequestOptions requestOptions) { + public BaseClientHttpResponse deleteExternalUser(String externalUserId, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/connect") @@ -48,16 +48,16 @@ public PipedreamApiHttpResponse deleteExternalUser(String externalUserId, try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); if (response.isSuccessful()) { - return new PipedreamApiHttpResponse<>(null, response); + return new BaseClientHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new PipedreamApiApiException( + throw new BaseClientApiException( "Error with status code " + response.code(), response.code(), ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); } catch (IOException e) { - throw new PipedreamApiException("Network error executing HTTP request", e); + throw new BaseClientException("Network error executing HTTP request", e); } } }