From 0a5d868a7e51b2dfa1a065a2236c1794acdd836b Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 17 Aug 2020 11:31:14 -0700 Subject: [PATCH 01/73] feat: initial code generation --- dialogflow-cx/snippets/pom.xml | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 dialogflow-cx/snippets/pom.xml diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml new file mode 100644 index 00000000000..56750e55f3d --- /dev/null +++ b/dialogflow-cx/snippets/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + com.google.cloud + dialogflow-cx-snippets + jar + Google Dialogflow CX Snippets + https://github.com/googleapis/java-dialogflow-cx + + + + com.google.cloud.samples + shared-configuration + 1.0.12 + + + + 1.8 + 1.8 + UTF-8 + + + + + + com.google.cloud + google-cloud-dialogflow-cx + 0.0.0 + + + + junit + junit + 4.13 + test + + + com.google.truth + truth + 1.0.1 + test + + + From 349c6b9c67a75bec3e8bab22aa71c4c5ece9b019 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 26 Aug 2020 23:53:04 +0200 Subject: [PATCH 02/73] chore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.18 (#3) --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 56750e55f3d..99d94dcdb32 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.12 + 1.0.18 From 96835530627da2eb40911ecec5c2949643d43c7f Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Wed, 26 Aug 2020 15:45:28 -0700 Subject: [PATCH 03/73] chore: fix samples dependencies so tests pass (#11) --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 99d94dcdb32..144c091fb87 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.0.0 + 0.1.0 From 01ee354801b49be1dd7285ce4f1dbe7b8ddbf3cc Mon Sep 17 00:00:00 2001 From: "Jessie (Xiaoyu) Jiang" <70290069+jessiexjiang27@users.noreply.github.com> Date: Fri, 11 Sep 2020 18:25:32 -0400 Subject: [PATCH 04/73] samples: add samples for Dialogflow CX (#15) * Add sample codes. Add the sample codes for the following method: - CreateFlow - CreatePage - CreateIntent - DetectIntent - StreamingDetectIntent * Small fix to header Small fix to header to pass lint * Fix package name Fix package format. * Add tests for sample codes. Add tests for sample codes per change request. * Fix lint error. Change the location of variable declarations. * Exclude new dependencies from the region tag Exclude new dependencies from the region tag * Add integration tests for sample codes. Add integration tests for sample codes. * Change env vars and package based on comments Change the env variables and package names based on comments. Remove DIALOGFLOW_CX_AGENT_ID from Kokora configs. * Refactor code and move clean up logics * Change output stream Avoid setting output stream to null to enable tests to run in parallel. * Get audio transcript for test --- .../snippets/resources/book_a_room.wav | Bin 0 -> 31058 bytes .../main/java/dialogflow/cx/CreateFlow.java | 79 ++++++++++++ .../main/java/dialogflow/cx/CreateIntent.java | 72 +++++++++++ .../main/java/dialogflow/cx/CreatePage.java | 101 ++++++++++++++++ .../main/java/dialogflow/cx/DetectIntent.java | 87 ++++++++++++++ .../dialogflow/cx/DetectIntentStream.java | 112 ++++++++++++++++++ .../test/java/dialogflow/cx/CreateFlowIT.java | 67 +++++++++++ .../java/dialogflow/cx/CreateIntentIT.java | 71 +++++++++++ .../test/java/dialogflow/cx/CreatePageIT.java | 66 +++++++++++ .../java/dialogflow/cx/DetectIntentIT.java | 54 +++++++++ .../dialogflow/cx/DetectIntentStreamIT.java | 69 +++++++++++ 11 files changed, 778 insertions(+) create mode 100644 dialogflow-cx/snippets/resources/book_a_room.wav create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateFlowIT.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateIntentIT.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreatePageIT.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamIT.java diff --git a/dialogflow-cx/snippets/resources/book_a_room.wav b/dialogflow-cx/snippets/resources/book_a_room.wav new file mode 100644 index 0000000000000000000000000000000000000000..9124e9279460a0057df91202a5d0e5e147b60813 GIT binary patch literal 31058 zcmeEug;!k36YiC9X9jn7CxL``LfqXw8`q7KWaIAc?(R-PNJt0)LU4z{WrP97uf5ve zd4I%v=j_gb3^Vuk?W+2^y8HX8cg)}c1BPrwkcoXJ^q;?Mji(Gj5ENe9dcvD62!bIp zWWcatV=|@i_kaKW=Yjt`@Sg|%^T2-|_|F6XdEh?}{O5uHJn)|f{`0_p9{A4#|6h4v z-t0BA$1M7Py~_;aiJV8)qp8?N)^<)3&mgc7*GLA*BsOboDsBAaiSjJDmtv#hrJ_Vp zr)X8QDSj)SDwZfv#SwYC&3Ky{**w_?sgLxeq)9wR{8Xe71`DSM4)EXbeshf+IVX%g zi8UYJgZ)G~Xm4aQ^PH}rJgL9PvqZVIul2Ph!1BSo$jmi=FbGDVq;#!};3<2mDf z<1^zM;}4_SXlt5aI&OMlB28V*dZ+g_ajvmRVLTjQ-WttYJ?t(n#)D~E6* z`VrfRYs3TMGm%XoWCS@Lp7xr|AyF!vT1Y*j^wa=)51mIxF((-Vvj}NLmZI(G1`NTs z;W+CU%Z~kkJ&2>>oaOrR-tuPh_5A$;nQ*VrC>$qxCE|;RiPwnFiSxupF)oov93);6 z4+$T`(q7MiQ;o`_^$*#QNE?!4hmSnsdz8%&W~~%{|S|W*c*a zIo#aUJj%S#yw7~uoMJYaLoJgn7c74)q@}wx(fZ60!KI(7k zFKRY5gz8PjQjt`5svGz*gmR(el$i3R;;H`B3~C;=m^w^-gF6W-h#pQaqL0zvX%-X5 ztYv;Od}I`I7imMrq4&{Rv>$d8Q)9jG8#uMbLb|T&Db+`Od!*P8NiHUCNeXasmyF<9y5!X2EV5=Lzym&J43;h zRdg!-l->vNm`0DL2hgE(1iakoKst&ZNY8^9{X<`+ztH)#m5yWvGRv5&%yXuQVHj5= z7MTWiUO`fkO2mxBpySbv=rgnswZTSU>#=881E#=-;j8eAcoFW*8pK-9dc-PY@z`FgM`4ZDN&hLyLry0*m0#j>0b0qz~w&r0)3gjOFyAs(x2%}x`-~M ztLa)=M~fLZCY~9|Ok!5U2!6}tGu2ExV`OX)4ZAQ$1?G2|ig2;M(Io+BTTLWF}xq0`WP;PrA8$AYk_*iq~$_8H5@3a~6J6?>1} z!S-PD!G{c>{}H+r?S(p^W+VqK{AniBnAFHfGkA%fIV%@GiD{z zhv6{a=tJ}r$P*}COudGY`42UXN}vW(y{I140BSTfi&{<{rEXDgDJ5l3_XR9nrPJsR zIsoFc5q$6g#$h^>%)DT(G1~xzGA>WzPFec)dV8(&rGIAz?SpxVD zLiQp*ka{E?*@grnub9b<4^vDZguJzl{u{jU2y%EJvw?Zan3&1XS~0>xyP-4D)#zXF zdj{Gam7vvN#dc&k;*O*-o0-mxmVOMmj}Jb40C{aC_-qArpQ@vr=(ThUoxogSe31JP z(V6IVREx%8T`&*K9V+H$1`y+)>zhLmM6=AU%>U)C~O;g4oPCN=~jwEEhEnmB+Qya ztzp(VRynbnXeCm}WU7s>WYUltbSV~zb67&wbk+%00*lW&fcL=dOAWp2$AKD#R1; zeONj~a~2{*`ZKS#M;u-Bjl{Uujy>q;H(x$ZJF! zw>R9ZAKh@EDPDC~wNmZYdb&N{Fxix6NhQ}YBe3qQwd@4$WL^;`jeUhZ6puqj((&X( z;;i+MWiYH_T!^*AENUe(6&;4YMnBzvPc|G@!a0RsZ| z`H%2z@_yqr$a9^0yvuPX%we}YT=qbGTJVc=5KlzsGFmE{RKptOm-Q0Cq4KFG^a#Yn zB+wS>GnGr_kwwHt@(p>7j3N2t2;!Z2wDClTr%t0{H7%~|T7{IYES45MFZ@;%Rvc7Z zUGlqBP*J4Jud&u44gDMEG_PnmtqNCNX=!VE(2!rhyLPV9y@D$KRhUxPzsR=qad~v5 zzV38ucVaZhB6wr-#8vO74y}l&jf(B$7CWNL`7Rf`UWxA)9~^(Ei#+yer=(6-V%oxw z`@eFt*w@?K6#wRWqC*M7m~8mFL)11?7o@eQ!kZ5^j%ymxvQ1mue$TjtSdPvUG%0qv z&iCCIG$Y(8#;bF;I87YYc}%B~;Yt1*z3N@#oDM0y9&x=2u`t&&YY|6pZ&p+JLe`Qqtex8?DBrRC|8}3hx)ZTwkriQ`L%2bYf}REc3~dh)22Jw4 z?$*gcDe20YNU;nPbT>344h?Nni4P*eS?zI*d9-dDFM3$J8}S&5-C@WHkMad`J9EuBX1!YcMgp zGtW)7kFAyFRD*MyP@``utf04#dTabS3*V|0V?+qD=84EL8 zfA7sn&5p@zN?V^+^*!ZBR_6M`F={lkc;z{OAXrs-tH{dhY4e5}5*`eMb^;w}Xhd2xj+$|LKdb!=)NFVg<5$Ed*j;SLdXk$w?@VRW!QP#zo* zEDB2X$9>t}d)<3GM#xb1V@tN?ubQS3Q_h4e_OEGablRk!3BML+^0VlysLaV3r!szK z&dEOU=TdG^(UXdrI=p3-rd#VR?ORP|vvb3MnmZNErE!I^xj+6)&vh)GU7g(egeeuy zat!eO9yY6!w)6ciKJjZ~H$-tGA4je4RNQ51&(OZr{mv)E_x0#S#iAh*9!U}r5^Z>? zI$HNc`K|g)ZE4-9Mzde3RMK( z^b7W=b*xqB!~xu7Y&Nok9z-ZiciZ#S>Uwt7$6`zFu&jVz?dgxQGV+rv5}HYU6`r8z z>v17~3Tusy>O^&_jkyz@68S#V7@Qsw5d6!3p>MLsJm=nudj495)bCaGtZpcZ%&E@$ zmNg@jm9Z(SO3mb0-#bDVkL(s%%uQszYiIRC_7?%LW(p`~5ZJ zX=YGXx10$@Zq+AsK^RAV!{c!Hh4@~*S$#M3JKc}y{xWt;+<-0RuZ6 zvy)4NhwmvzU%?oQZ_5?s+0yrU*|{CXPL;!Ix~dxV63YndMw*AOM-NeJn2Vec(FvQm z&JI4!A$6Tz#qWvVADa-pBxteg-?9VT5Qa8f)cLkXse_t+H9ly%)o@h#yJTrWXwLNP zrW}vFfhBDXFZFNm7#pSMgh+l|zitUVd-Qw~R~fDkV)=Y=neDLAPGo;hab1=tj_0v( z3*pyRP-GC!`kkNeGCDFx=ie#kH1aK#TsN2Yh)X@E4;eNxd+fS#XGa7MOz-u(`;X4L zkS{@KFh4jc=$K!3_lfpSVoz+f;cL@?iu~Ntj0?X;{K+fyDEnS-+tG)dgeURSWq!8K zim`GhMZEo8=UpC)eHB3;B1U$;AA2@-TFjJ?1s(>Q2F_yZ8ujKHZpD$3z(Q_5TKKfM zwKTetTeU&yS)bVQybU*dF?NDN#TmC>LH3aFj2uqzdn67<@K@BCHPM;O8C zi`*xF8Ux#6T5i_)RZS==%~t(-nZ`=pmU{2!i;T={=fadS2W5QS;D(BZr*(hYuG;&CBHq@oZ&VikVl@0wlEPr5bpYZO>!*09HRBVUr9mNae=W|E% zJ9t}J578g=DI#Bguc@PQNmWdpU89RSxnrBv8&8%@b>e!(d5`j#3E@K(61AR_tOj5(GHb%8t*^u8i*HqZ6bfI#p z`h}%|y+v`@t2Oj^r%RpR#vBMY`+xVD;x)-V+U>MUywh*z3!c+_?Y*8l=E*_?Tx`Bs z+crY=xUOq$|GFKGt5l3Gz%<(0NG8#Dn48RMG?rD1>sh6OEs8TvgI&EnmU#{F`rROz}!} zO5^?NmK#-}ZyMPCnryM_8*J#jG-3AO!XdYZ(1ZF8YU!a0OZK!lO;X4NSGn)8uGDdg zWqqs9X)A5DQw>$N6mKh8UpcNizTQ_?Yqm#IB-dRY`CRZ<1bhhG8x#_FAVBN?-dFEC z#4p5aq37Q|C0<@Gf%3(|M_&Q!QQeS(-VGLzUl4(Smo`lYV#4TAG>uEA-cn zUxhyczGZ&(`+7Jz?DO8_ij)g!Hh<{S`3+xnH`rC4M7SWnf4}mC)&abP$UaZImxd1V znBs`pZj?}>?Gi+|m@nnw?DaU!1e1;Jed~KyovQv_m(Va@J<-4+Qt(xh6AlC2#<&%@ zu5-EOz_MR&Ki)3PF52O(LyqG_w`D#XeQMm^IH3+b?J((3UJUy-T|}CIVVZ)RL0GW! zJxh0CK6pR->wms+v?fzDQM&o~O+D zmE)JUC8r}xn)xDa;#ylM zr1M2TTh}m$zieW}<>DKHb-YYo1A8RP1&gIm8q1r;Deo#L*FLMOZJN-1 z8HzYE*~|rM6QL(c&2fe~#ww#puQGNcCnKG)rI;^kDwoS`W6j3`$(J2#T9(%JP;M&6 z%Kj>NF-Ye4V5 zLvx029%k3?UepDju5M=>iX|~3AO1`B5&jrn2m2xSCmzJeI$Y{)tNv7cudFUVr##)D zXx&ZM@f~bm+wXHIclLJ*cFeTrIXF3-ah&5;=|u+(kDe2!j#Y<$3*h>&os*@L*$c_b z=AGsh)~2`=HFd1Tci1*~ zTSF&y+0pY`@2fo@#n3))T=qM>QuMUH<|uJ0bGhnq+I_pHt=D?TGG15xrk1x2(rUZ1 zAtiZLn`$Sjr&~I)FNu>SZnDi{Karg{RXkL@O*B_}KvC)Z-hV|@W%QNMeSxllk$!Tw z3J0r=uizEipM6yDK|Db+Lh2`u;BVvU+2iRplSf-071fZ@;G)iHO>2GFHqkti*kj#g zp$!MMp$!hTb8CkvJ1Z-yQG)>?D@?s}x=RoT3vi+TMszooDFaWy$P{eESoYN)l9 zQz6^x`pWyfpKZ`}-=j|3Y}d&?@J)gcX^Fg(L#6X5w+b)9FVke3t5Hruq^ zZrauOtC7{vR^wE?U8z>isQFs+z2;JFUTs_*Rclj&)DBg@YWravL_fiv^Es04ipRDm zY%6RE#lez2g5Nx;ptrcU)JZ0=jdVQeHo_y;^|2jGc2Yc(+m61chLL%|Ox~pWU<3H8 z1&akFe-3{;e;02QXBz$uxqjPnxL9UMp)w)&xQqHU4!2H(HykC`|@zNT#w5C;k zL*1mluO6m4q&lH))L6CAy6tUO+jh1IbyHi9>M;E%lia$E+)f|EX0uLlo^V;53#`4^ zAGCwPn7&8>>_#VXdkej#Yvo;SeQjUJm&vju)uJxKG+rKe7SD<2%ReE=7JU*w6HgIq zh1LAE+J#Ov^_ySp>Oa!4wpYca7=VgyhI|F$ixqX_JYoQ6?Z205GR>)f^(RS zvLE0tv3*DpHHL7qoHr#KHyA$|QVb`IjB%8y!T8&dq5srT-F9Agp!I5NlCHMR*x_RA zXOR%Wzz{bR!-y8kPIIR5hvBHZ`o-b1-8znmH=-pV7`Mwu#%#Q5mpz=T=N~%LQ|Wmx8;O2n;^+i^myhh za}U_sNT!PZi=GHdf*4rpv4}VD#sQcu=7RytfYu}DfTLaqT=i?j6V_Ts(4D|`>VS_w z#W*sRw2F>p%9zhcF0=pf+OGeKb^nR;M@zcY=D2>A=iMk3KY=r=SAy^Wqh zCj%G!7TE-!9|T_g6mZ~8NEPx2*zirj4YQE<%rRy;u=ksoEzAvg;xDF|iGi!1ApOyN zbQ|W3-^9IHV_4y=24FSUVq4H-NC6W9J=#oPr~lAGV83?*hyH+B#rQFKpeuOLwxF+U zqnqi8!2M5#m53gZq9|H{{6by;uYVQ!gow~c;E?x$mg0nd0}W{(Fs%bYJ30jV;TEcb z>Pz3F!+_ix1lfBp+^-o%5;am{$wb|1)ekkc=xNozGol=ct`a@uVww4X)92vlET)dh1#c9?zbdANF*9CBSK#prku2m6;I$M< zgWenk%_;)aBQ;!`$)qtBMh;4ciIE_Dq@B@#N8iAwnGkCQSQ`ux7>sO0R)9Vejd%mj zdm%%R#h^iL1eGKa*$kf#1cd-YYCs8UhIWLAJrW7Zm;mWu*ocv-WGX-*lK)Q?@<2Kx zQiKQCvceORKtH+)$l3-7NoG<2&8I=x_zD(01Eu5%>@hAdr{Ibt<|FeB`jrdu%79hg zFR-u}+O@!6U*X>xCWk42?~4KDwa|-PuwKhlF@4yx1&+L!@u;|~v!oZp! z#0%mR1U>fx1uG13fN!G!1$`kVanM&kuto~sI6|~JU|mm$a1h)*4B8bSHeitso>>Js z!w5Dj!6z8f0@nNlOU^Jyn4QcT<{!wE*O}LV6)yD46kor5&Iycky)Syu0z%U zzE;EU^)M>`McinxB@Fs+i&TS`8~%rhI_N1EiHB&;N7lmC8{wWM$T(;x1iWJlsBQ)? zR{?sSKomZ~Sh)k)W7q%2cOr8h^ttnZ!dHN?*ATTdz)=mLtOhK%Kn7)?btzcz?>Mo* znBpU5$nd|xCmH|Ffe_>C(C#z1_ZdXE628+wztk`iQ0Qq0Sm_Vrzu*5wTt9f%2S!m4 z#KQwH2U9h~zY<>mVkQGTUI}s6f?ayhR59?a4~L6h^!PA`$`!h=U&di{LR`2n^D03KriXFgz&KWKf<&`$(< z+4et=|2wXK0sg;(M~eYPTIh*|@c`8IK@tFU(;!Zxk%{m#0SP#fToRuLNt} zLuPmco_z^f=|04*7(7crUh@H5_l1~u2b>2%y`_l6cbL7%+9S9%zCm2mZE$Q>6T zy60gQI}G`C0c74Cphn(+cGJLS4|wLk>hpHUXuBZi?uFTXA+iXvLl3~F2lS*Ke3Jz| zcm+>C1ejR~D+C9I4;tT z3Rrjs80`bLT>D4qv_Xo|{o@r%n0A6lGEMmc?2tW!4Jq(KXO;Bok zGv0u}Uq~E^fx0Y02SCr>Gh30#@SGa-CPrZ#oWZQvJ*YZa1he=XSd&;_CJ#p4kbKBM zV*r<*8IrE1?5HT}Jk-*7LG_Fql|^nRrPNM%&48az5DA(pqz%ktvY~eU^rn9HBW`VtOybW86nbG0s1yJuBAwzxr zUzJS`ZKV29ENV5C4D~>%ln=cEEdNgJp*xrYWB^)KR{pF1;1jDobI+J%RlHfeC|k<{M-mjCfCU zC1!)afyx*!Ry#Hsjf3pw1^N3g^c1=uZGk$4>Bvmx6+M=jflNaG#u8XN*dn$bKZu{e z`+`?JSZCOF91Z&~_7_$uR)j2ME`!DXP{A^rZl+$5QsTR%#=HZnwHz!q)(k63)DhRA z=B>$k$oh~7As3TL)C9=WL9mWn4f`$(R$$>s6+^&^`YKgVCJ_+?Lc|f5pdxOs^_F#k z^^~Qvbsq7QbfW4h5g_pjauMy17qPl=ZgRb#N-B{j7mN`$Lakbd$RIi<{9CY7;491# zbQci(odTm^G}NTI^9S;DoJZ_W>?54v++yw-UJb8>dy=!7J&jG{#{tP((XVJAV9*EA zQ#>NpJkPj9zq>=y@uywVeoGhEdP6f??V@_#lF{;BHD2wfn%dl@vAIrAGq%dJVoYgn zLFYeLv#w;#${SwUOLfQON-bi3QoD(BgfEgV*k~8#vD9yD5HF-Q$Ql?QkmN^sZ}J%K zy3zTo^9$#GPGfAZi)HL*WVFe}&|u_SY>7^Uzs1$~cSllte)~ZE9OF;(5$oUNCM2BA z=5H1(6?El?avRuRIEw{WB=PcXimURKvgP7x!3Lh5bDZ6TH=}xH3T+@C69VgeGshHa zLd=xq0CgHW$Gt8XAa<2XY&vXO6!s2{PTyVsaUbZJ=qdI5+oQkxPuGLaeH^8BH|2S< zzofLt#Gk~y3Y@5dTx1cLHtVz62kTC0IhsmUV2h^VcAc@hplU|thl=eLhVpIYDW!c1 zNBtR?IVL?g?Z|ik)Yo78ec6#b>~q)8z0<~&Xj==&EY4dQ%eGXupFd3I!6 zVwv#6+&lbF!dD`DNxAg1bgS%xY`pA}ge7$5$kDO%4XTy8OD{vFpq@xRb&611{Rt_x zkI903Q;y29x3H5ujwL{~$_ilcqtQ8t3_XYkb2{@-J}T%en8fGsgZO6ze}un8N5q@N zN#c3HpnZ@YlsZVai@yn`@P=?hxq4s))^e7!)3KGzd2$IMARby*TJJ+mX;+ib(5+)c zTdMAZ?sltH6RJ*ZIoI&L>QKp_{Oj58(iPv!Qx+#bNgDKV!G{O$mwbya?5ZhbR!Td0 z2KxJY4|ZAO8sW1u;92<4*bUvxU4}|wBA-FHLDx4>(4ZEwYctx z?m&C9zLzoGl1RT}O%YDBS#0;0-3>cGdsn+Gd4|m2MkxDB)P>)JJBl-yWkjo(Rn$O2 zWezbF8a>U=tOLoTq>;>lJ^Na^JM$6k&ic)YX05;{;a<2E`-m6AXj{jbz-Fs6_SE~f57otJSE&4&yER^D@NUSg`&r{#`LcLxZfeG@v@59# zzdifgVmT%lW8>)%RD>-YAzYJL2m)EeJd2!*?u@ z4&|Rh!%ao437XcHxTdJ)>6$CLw6=`)^#+Nln}tuo49T?pk$k_fr`8f0TBnuzA2BcQTr zJ*);QVD?Rh@7ORWuLRB{kj^0W)-UEHLwft%*6!*X&0`v8HO#JGSpTX%sou3gR&P^R zQoXL~M|o07Owo}1e!0on`B{rIZ8Jt>jQM>uC%*Jv?by~0Of>&*r+r@c{J(_G4sZ&b z>}7Hhxw<;6c3$VY$;05&$@j9~eea9z(;YqJ>qJl3i}7}*5LO7~R6WxTD$h*JI+zE< z@cu6H0a=J`#+R^Z&KX{;a4OU#Et2+@#n@=2eAzBZmFR*{&r9RZVqe44u~w+(%Y*rG z1gr^b5I3|98G|+>c~EDz7HZbmP!HISuECyT)mRmli1o*^(L*r5*#IX|3>9+ykRqrW zbpST(GgLozgT1H>ISG4dCGb*Tp;9dgsYaTS1xN#Po90js#C5ZcF|i|C*H!DRCY!}g z8yXtxGHZFY{b~YhxHWI8UseyPPFJp0eyRFgNmgW(wU#U_D#**sN&G$hcV%{3uCTnk zwyte0UC(cJEORUNA0GI~zagN*Bh@3p^`29m>wMRBUVPtR|D?d40rUN?cvidgwQH4( z5-3@@*kY&)3_vF%CdelnVC7ZLOkrGU9XTHAUhEkg^bG!?T! z1GSb6uwOoCA*@eNBfDV*eG@7(--E{=!2ZhvR;-(W0SbXSMNg(0YIDC+AIWtDW4UGK zo1PkC^jF#s0-tKtuGaifCAREo!Wv`h_tx6iq$#ti&R1Tl*jS!c#wwd!DlV0m+%3*7 z`dN6Oa8H3-;qfA(WVO<%;iqmT@sT66eeXIhpiAh`i2BHvVXs2A2M|90ct7;q?{(k% zz0Y;O4}LxUFrSwmGM8k#8#0ZcjibZnBCA0)V(3lGNn|RPiPhupfbD;dO-1)36B!R! zKesUlQ3M~!_TiTEW(%4GeTBya5BO_&rJSQ|0#cdEs%#n4;@slh;?UyX65g`C*|vE}Q+Z>2 zoUilier*2UII&i zq?0d+tx%hY5qZP`vV(jHHLnfSIH*ovMop%A)4B9>rUuDDH{(B9ft*q~oGH?Z7nt zgO;EoSO*tkY&;Cd@La41wj9=;rdxwT%_8lt))l(Lx>33wwQX1`{o zR@jQRKF|s@Bh<%K!&GgWi8_`3j1@r^b4QB(6yF_(yT0+T@!IWm(rcLKe2;whQ1=UN znQl_|P43fj$X!@8hX-$^t8aUDRuG8WC;1 z3G8*E<)w8W`Hc2KzvD8_VQxBa8b5}=iuV^+!U<+6uwlqOdMWh|suBZWO}-7bQtPNv z>Kr|d@rUeXLTzw&Rx;}>TL?9j9c+~2&*{zS&p815g(~(8_Gi{;Ru`5A{|k4-HXw55 z6xBk=tj^{`#u&p2eW3nxM_z}cew;o-KgqDzpwoBKpZa&5*>+JE*7{0wRFkUxqI=$+ zpl9^=^tk>(dtuuz-BMkN&R)mYIkaxl%Cti@V>Jcp&+5hM=c=`;8Bkf3)K+g8VztmM zn3nTKFj`z8b&}^PhT8S8pXe~nk#W>GJ#wyeKIYuld7G1~(_p7WrwXUxPIny7I`px- zCQp=liTwDZIV!vm{lvu4GbtnahfE;%!nuI{gaesRo~K4Yt?wn^2c*DHQozLA`X8I~ zFC*N_j08TRGqAObVFud_`}#9bN4*C8G#N7dQG6dh2p@v~jsL(+cpPg7oPY>q>F|yC zG<*aejn`qVFoUX@vrsFzgt%sjFq6h5M$CBMP;Vd%EMpJjcq7}m%5YuptRLLr-tN$L z5PVRj9k1)&Ue&=dI2%ss&vZ;{ztpw|w7&Z~FP)|}TYE#VOuto>QvR z4(B%K)6P?!>m8TaA66KpYeYTxeK@7~N%RD>l+L6s|2zIjcVe`)vvrU4l2r;PC|ZdL zaQ3DXl}MrVPMEz+%yNW6UZM-IaySK&2w7+}Cc?&}KVeSW2mJq3;Ll1SW8DQ#gav+l zgcy(>=wkF3T7l-E7tvQ}209%hvHtiWyc?c^b;B&cM&E{~FQ;s&065(fM2#f}5mD9- zI4|@NPRo2XO)?(_r6tUC$`oNH;IxdR+0T?^zzy5=2RkNqEbUm+QQXl-zgw@->-A;& z`TErz8SVD%jk?{fgS5Xig_<1AV-2PD)5L1dYB#ru4J)mIOm9{#PbWmB?J`{Mpm?ol zRD4nJ6+Fc>MQ6oL#Z229wh!%o*l%$7;c(0TsNFTi16haITR50k$7b-k*ki<*Az=T$ z7*0Nw6BKclJVQ-_%J!ag5N$)>rFO&k)KSxbl@EiQBu1VhVqj;=U|#!<+yho}Eud;1 zte#ebw`Kri^cGZ=bHGjx2TpYus3(3f1B8K&FdWXoOaLWfAt)}-VHQv!FQE>ff@}XU zPeARdCB4XpL>SRxT}1RIajKMDL@cyiHFYvgG})Ob<0xZ+{)+yI-rR9gztqszm}~lB zx@v6G%Q||r4`^4nb30aa%+y!uZT0!>t$;Y!*6y0+Dqc%Plc;G?!$+G`SMl)0exU53$m33Qt{CI+;XVqkUB(Pyxp-@~$JZv$-* zXD?=L!2e*KvCHTebTIY;SFp#kL)n3>vzQ67V}hy0gvv7B>}c{fo&+!aXfx_4-L$rS z?Y}$5>N)zK?Vs9?=yJ4t&GweRo7x+4>Mz&#s-ImyqyA9c@>;)|drE25fQlz&2TDUr zt`sK}_b(|Zb*%WidO+j3wr%7)?s&y5*PcF?{bmLT0)O~z^6~NN>oLq@t%uR`nop1) z?YGGPihq@_kM}Hhk<&8yFkuDzDB?!?S+mV&%m*w|!a%;KhSFN9Gug)~G3$-%j5AC> zEL>_jatP1jyyU&+ll(>eBfJINAW%4y;Uthd`x|>3r-0Lqo6RBFuURg*2E7g|PH$!g z9Rr9A1x{=SQU;?i9L_YXhWs^_mBm`g4&?NON`s!96!uQ`X_hDc2AzmZ2ZfE#ETkzo z(IY0yEh9}E^!d8=8h@3(DX{TdeOTSenn6mU;z&7Oo?O;YHnQBm{C#O_ao3`^1(yoy z3tS4r3jZ!B$v>5UJ>Ri#SrMq)g^_%S9u2+I<4MCo!&#%hWi_c|{$RV`ngz;)q9a8Ci7qTyZP2MaC;LIfB1 zS9v8IZ*~m67WF`!n3c2)crAoZq#Nl8zz;3}y=@Yfg3o6gIh}ZY`3{2H0*-LL@Q1LQ zXqjlXh$GrAd@FdyAH-YC31uBe4RkGW#r)Qg*FH!WsQsvNZ$8v;qIR*eb47NEP0^i# z!hBW!>4J^|Wno3pqvD$-VWm$>J4)@#wwCQJW0kKcXIH$bpei3JV`@{HlC+Vgb@&YN z4ku@yH~zdJkASg0xK}5y;ohqQv|*>B_r#s;GCuZx%%1Sufib?L-TON&w!0(SB#sm~ zb3e1rVO^nuX^bUAKd1GPY8b5Dj%)nedzhQaMC2i6z)(27LgL*yoB3-+VbYT}gXKAL zvpmJ7RCZ0WRXCJ4jg^S>rnXyc%~r#u4xhFU+SlrbDy!-l>@g4M>&M+OQi~V-{JN8xf_Z(6j{2Wf$O_3YKZ+R(r3BBKX%Q&ljvUXj|jfP>ha-~;= zs&sRSr6{B@CBGo|L~cVKw@_L-vSNSL^=gM|p7LsCLU~fz__Bp%p5>0^$)&wZL(0Zg z{HVR9nrOI>J&{~@9_sfya76H(z@>gSeC58e{yl>Ekw-civSz@Q{Eof^7oyISsZyyS`QoPgm$GlMq=xcbfYUE~`X@F(O%)X~n*x}1q?jLC`| z8#*k|-6!6qPVrgvfpZn_3LJJ6GmQ=-$C=F?vsy=MU$r*3mzeeuGnonaTMi;%iN=Zf z(p|DVn=JWUg{$p)yF~lJ_OERvHY3Eze41U3&1K4nGIN^YMEktf0JW|;t0}oDu%$|! zsvqxYlIuj5e5Y)O%XUh+Qexm=VC|uQnICmT zx1LZ1G-cF9S6{6-R~lD*vM{0GPhL%~ectx`(4s!2J{3V#Kb7;V+mxr2_bbWrvt=)f zt%d0Y9}6xPd?^@IG`v_|xxBusZY|bDq4#nNaR_w_*%@H*_41qQmleo_^o*PkJtO*e z)cOc*Sb5+O&u;b!qDqcEoZ4N*K84>y>*$N*MoYTkw|=U=*dR8e)*19m{DL6b=Bw>1 zyF%MM#YBat;+-PUHr#HW-BH_(@`nO3Q;%t_Ys=~g zG~TveLH2Ubi7EME2WOWZ?(Uu$o>d+{-50qHb4hk=xBH@4YonF43Wl@aG1IMlW4HDx z+Fz<=%_kc@8ZOoyu2t47uSr&xSG+4tDj8UIts+fXTeG_EOdYSrRMEBMZo%ukhdJA_ zcV~HIdSndAF#i%|-TWPpx3J8nq0$;I8smN`pe^Wes5NM1$nj83_|QmY+B&LiA`h^Fwh67kIYP#Sr}s*=iJS$%I%Qb zdbb=`!a39FxnqFCBU>l=Icb|{1AjlOg1&0r*73X5QxmJY+pK8{Z5Fj0P`_*K+@Ur; zuqv5P>`@|jIcdMu`MYbr`(%$b9@pJbw@{bA9T(UwmQR!J7Y*f?vpzFw>uzI@4m(|c z&16;Q=J$PJUkQi$CXo zS7x5caL)+MSdwAR+LXPoaAD;sO(bTK7yCp6J_>mqViz13Iy?-C+z>fGDlY0vq+{f> zh$#^XK{wqpWkKvo^ccb$s(d7HQhgO+Po5@2sW(g{Iu}&O1Y9b3q4?+`^`t#RJok89 z^0@2X;d;v@$Z3#Wu*_35njgcRiIt{_%v@7wvAk9+SF05`>Y+Ke%%t-vaF?x zimj?@xzJM7?AjdN_@jP*eSCv=V}0YArX5XDO>Pa1HKmoyO5F;t{(1E4{Eu_r4t_28 zilpYHoydsI;TB7jLv#r1kbS7nK0kBNjL`033nKPMXd-(>-Hl=*r$-D4dl_yHcMqi9 z@)VyXlSN_t6>K=&NY1lrR8oMzfBvRNjv6FuM^z_(K8%!!7r9dFwVt~F6KcSIseAuLH{@%Q?DY(JC)~l+x#HL{CpYxg3KToGU{Nem{OUm}I z_^%PU52~ITcJK~4V$P&zkxxLt&ETA%YDYO_(aR*{PY=e6(egrc$?2-`~um&SSHA-6YrKS@t650#|=` zh5H`2ldg<&jYBuvwX%oeR6#Z8CwiJZ4=2BNbZl-*ZLQSCYA=BOJoQNx-Qv~qqj5of zaowl-xW;R6GUi!xx8|pfLG@V8xr(X9H}mYXw`2%^K1o~feMQQXl+16nneX!58oY_2 zk_so8OQUzS4;|}|8OUfLDvEzSEIc(n_a?Uj3JW%ka`E=yPTZ*{{j+unDpbRO)v#d~Jp z^?=TS1;Gu$??X-oZ1d~wwV}?2Jz4wNdd@#QPp&V= zmQ%~`DlV27CE36+MA^M|SZu#u@k+K>I##?&FoGMx%0wSAG@Q^jkS=7S<(jdRVWHuc zVYFeNK2d+(u*l3I>*y0`HQt*WE7VB><&;8XC$u|dJIQvlZG&Qr+*h_jQZBkFydW@e z=deiR6up6bW9excV<_)9+djHYrrW7qsUFbGu5YbAt_)ZHU4>P?E1Oojp`@l*R@_ox z%-j5DX(l&)?N3db$Is#)L(_L>1s3$LY;N9x*xT&!$a1IMD?O+9O!2MvdhJu-x!P-q z`y}@R9&tY1d_^89jtRD-?NSu)W#OVByh_eEjxGEj8piUv3s{1;d<}n=C`58X@>=pz z(p%O?zRh-~?Mu1BCPKDavPfvltH#eEb(B3xS!Y>uEmzEYjUx<~4SK^_!x6o`K3gAe zI&AGsy<~u$WY6HU#e-$9`s`K(NGb< zao;kE4EH-P(mtbS8E9fD{OtHyrmNBML z#ze#Fji&%wMa*=GO%+cvHzK{6Yp5m0E z`KtY~JbPquug325U`4K%)%#`O)WEyJ(Sh3n6uwz*?(PL{bG?$hZusW`0=76x9TFXQ z@_NxUP7J;TH1HzeRd@6D2w#d3>2VvWt*@d$HeS+SvQPS4rjjK}S4e!Mmt`}h|EIdM zaBu4F`*3p3NzREUO+AfPsNptj=;(lF3>h$NKyk*P$k3wQa0ZMGh7B0*F2gpwSc?^E zKwC;(a@->C_j&${mt0&|TCO(a{PNT9{kc!RzKrl-35sXF9a4<&fo;L8rc>!~W&`_( zT?V}Gajv_NFVa$j+}^)2_zDSN%hm7jb()2`y@p6riD|XTYMN_YZz$5c^i|qiq7m;# z+#tRoCg5|`MJlZ-4m*S_Q+yLB@pY5y#q$EqeP9a7yar=!>&pHg6H4OVZ7BShADiFu zZPlB^{4E8F!i=}~U$1%bTMqxE;L(>4|9)^Hd&#r5ue-eej_s;3N6w6H>ijY`BQC{r z$aUELA*LdFXk>Qu{-~+;osLJgZIN*iJ)$zg+gh`X&-Ht>U35Pg%%=CI<>uib&#eo? zH$`rUSQR?bLYR-3icA|#Q;nSrlMMY#*Nk82lZngdvETt;iS(DC=ho6ks6o_As-BKw zdeIlC=kz`{jPEAQ5VuLOzCfTmG7)>BO2#pbS+~?M*d&<#FwHh~G_5yYFdT)!Aw)Bs zI74I;NyISxhB`@oSXF`bK^aAEV5F-x;y%9MzuK|_Cw>Wt-}nF z3!^F`YC|<426MP+gR#hPQ=hFnuK(3|z#wTqsLvuZf=d5pX)eE%IYhOlekLD~*Qke- zooY|5p$-({p2U<7z_(J*z#Z zJ+7_M9Mc%IO|(|+Q;nZ!i+>H(kuFGxVwXQwmig9f9yQGSUH!Y7y;VpBQBHjPzI4L- z-9?oJA%)?EmkN>!%HJG#-R#w(mph-w<{~*?JRS6S;iCmlZakmxdh7d>^iXwp=-`Mb z$FA5FO^!DioBUJK*4R^ab9AkJ&cs6)Cx|_si#SL+-h@rx^nE|B2pQ`>*hY~Gy zuZ(*wTzF%|`EV?>!eTN<8&>I>X)B3ogkAfKK39K7m#*2aDo1R}+JH~uxJS$r`VVRi z^_aq`aI(ysLncwbP@`y)wlVG48T=bzjMziU@b^>LP$kSk6N%^A6r{T?PsB>|kXkF1?1?IP}U!gB7xqm%zW|!VCe{el})Z?P3 zxdq1?@|B!X4%_M)m-M3Pyyop&&1}&mwK3l9nc*hgqvIU0NuKQPuv8C8G zz>qRvx6CEx7Q2+Ega=|fshgbUPYd2tG%8!8&#`rC z5Ai}%tNY84X!_aYG+WJeCWR@>*u!|wU^Do2f9Sphr&C8=j`pTzAK_PXSVuGl$yD6% ze=Z696X-!p$u^Da>XEt*)r%^Tiqi7d9}Q)zO76UiEzT&!i{=(p7FWOf`dw)eS~xp@ z>YH7!>t9snzRF3+jm?eD+52q&i|s{|t7-YXt}r6T(Iys8oY^!5c2z@CBjcT}q4pP! z&aRoB4zX9_b|&CSdC7N@{)p!tB@w61w{)!fIXV?;pBmJv-b++!x@iA|8rEgaVj^3; zM70OgsCuiv$7MX6NFx>#Ey1NR8Z#;NflcykQRK3jdTJXPNA4oSslikRh0soB7dx8& zMK~(D<#fL!YRTPy+d~9EK?nB1A z6Gi!jn~Ds@x8LQz29} z%~i7mtlU?SPaCe(mDjAVZdEm)GN+yAP(|ko_sTz@DWe4RF;0-5$=ZOR^^JqZlSIO&z0IXd?X+4!mB4B5^&8+4& z3GJjTx!gAt%v8SM0bu->gT3e>c#I5SOxcWlKxe6rs{h8f5FIpYG-ov_TDNwUW|Zb@ zja_5a^wP}KY|?yy@7lGQnnlDv>N(h01d^0+=Cn^*D&B{a?W;n6FKa(rv>9SG! zjvvANLzcsue?v`rHC5HB`fByu8cVIE?o{2cb*Xjp;Kc1wm7&u7sjRH=gX3Lx;n9M} z`PAF1aJpRnx-qXjf6Kej^6zR-P?R_ui8T~P%yM3f>)m92(&*%@zgXdRg;{*h9R=%hfG#B|#G>G<&s=bz%BK-6-95 zZM=3R@sqkO7K(O8N);y|Cs7OhVavcRkK)Plyn3VLvE`gr@3GxZC zFCWXcpc7#iakb%7{l2dwMf(dc6n-im^uB-T@bZExxqdw}*597E6!LF$oojyl;l$MBuT$bu2c%dN zb#WV99~}4XJs>Z9z<$Rb>PT_Sb}Y4PZQUZXLa$q*OxN^j+HZ*fKAU(1XYOmXy>!cT znYul?D(!a~S)GMVL{gP%g%Ic*Xc9OO=nhPIB_xA3!%6MuP$k8M9^5Nt1k;sCXBrqU zYvX$g8R9s}FU^tP$(V0|Z;vk<41j6C6R!+@P{cysi-!^L4dzyDh5CmFzmJC!(+Q)d zllF|xW~el%jW>XC+io~%a2QVNsx&9@_3Bd9IMqhXfxcC)RGa`JXKWzee@tEjmcl`z zMZ6%q6i~5^SSNIXwk=`TGp*^_JZ)y%IRTHU-lq}p6Pw>rLttx2m{TCJ~= zD<)KYDu4Ddr*vIOdP!}`^-^b=Mv zv`u#>$JaFZPx8{#C(Twi`zs~7$!*Ve*G2FKEOKnNN81Zom!n=pC_+N4c@gIch$+-}{p{iu{M%LS3RPbP|1tvQTES zrqKvw;i~#|bz^Jy*F3I%RoxNzlR1^!E0$LzR^Sz#Dpq}}D}VHHE+j*Hf1L4gY1xBP zw5;F9Jr%~9=XLWMePk3@D@UMN`bA+)V&=Hsd)W9DiC7BWbX?Q0)XquDgafg!-2+_L z9K-AdF@s}{#`Lq7*r(aQj`=bAam4P>;g%4iTlX(ftUiVDNOxo?(h@z3Iibfs!Y2Y_ zdyS~Y%T!m9BSAg58g7fFKwS^!Gx=J+t*}=(C^&@P{9P`M3ukNSAE__NOJ2eIid4`q zm{Z(BVY_t8ml4<*oURA~J`+;{Ul3FVX<*X+f}}_UFkn5Di;yemM(hL_{32E7aixwm zWP_RVgr3!<7Zj->P(<8T)wSKH~f>TYQ-6B_kE^tM6_{Op(I zZPG?D3Ep42_*A?mt`|qbGox6HD}W3CNr@m25nOcupRc{5V|A1DFLj6YSB=xng_dIT4pU!a zAAO|moMr&Q0%5%ZDEzg^F(q*8z?DDomjch^ms&_|MS+*uGCGl}_fGJZc{52IuCkhH zMTJr|WD}}0wUatW<&nL~U%jUr%Np+2->o}ROVlRSM%5m#$*I0r6<&3|vUAnFDz0i& z_2_CtO>RxFCaU&i&6Jv-YtGfYt|jXKY>4tsCGB(%cAU`MAA@z(tF3(^T1Op@?r$IL zPE1&qv^;rd;@tQxu|ALNN%tV`u}-(+9OUmOx!<~E$JCf}Q6nPq!~V9)X0Jie4khwb z@6mvAHza3Llws&)Or=KgD=;T=usYp{qw1!xes8IK8cYvV_#)&<;yz)RpoOy#nZM5O z9|FijfZ>l?@oW&tB=fpiCkWWcq) zhD=17042&QJ0Rbom8x`&UH?$OT7N`8!f?d6+MFChgjAZw8v5xfH4Nd$zgMrqIs>(J z0zr^6#in3#V1+MHu7m!!pI^+aXTM=~Pz~NUjT0LWHpY3odm+Z|-R`|hR#K779p(lz zhzZ(~-+s2zUiE|=T2(&=_Rcejj9i*H$m zDo||$W9?pbjjFdwz*?*Ns*Yn*(XWw>$_Aileh6v;<9$~7kn|d;Z@0WxijhL38Nldd zNdG`Sp{cN!PXqROBX^WL&vD!ozMj7?>=VyRIr1ytEq^mG#>RoK@Iv5QNFu2f*+9vW z!Fh_Y%3|aPFaj1}DUiT@iz(DaYC%0ly#P*U(p0-t9C%%$RO7I=*mV@O}~=a!?PVx%%A zH>N1&2ZzPuO6Z-KmUtmyQru^;hhvAt?Tl^fUh9|yy>V> z(r4=CYWr%=<0kdb*gwcY#f5;?zd;U&c|td+n)DMU3QNG6JQx_k9sEWT3!nf}`L-Z3ws_sWn02Q(RX* zK)mQa>@+qCoUJlCAM2)KV3o+KcB>|X;q?#IA=M7m64g}Ic-7b7cU_1512)PyWS7zb zq-hP1kIw>40~7rVe9OUlm?w4>4+urPlJ5e{O*{~Kt6*-`P>;xm5J@D-Xy0e&SNK4?a@?72TfNQb)xyp(5co~bCz+txoucZ)F7B;$2q3C zay{$gjPZA4N4f2;9`4U$hsQQ|r+{fOFLGeSjPR~uN!Hiq-lm1d2ZrN%zqXBLJKk44 zL^TF0L;Q+DD(r_dDq(T~LuqW`~DEa8+eT)58n;@k4wcn^P{8^sB1 zHk?HDsd$|S^|0W zKG|g-@(bvpi$$fl6?nD9;8h6Yeq)o^znP}Y4q8EHQNyWpYBJRi&O;88-;)0! ze8N5wtNrB-2jk}3y{1n&3)6;#`a~E2s(6iaOJSHJ}a-=b0XV`wLCM45x&N9~W(6rLfQny%hi0DV$ z0n+;*wDiK@z<}LD$*f`7wxrCpwAguihuxXI{O2GPIBVc{1!p;MQsYS0N{g6ZO?i(Rx`A2{V zjPz&vewO!1m1195_vv(UZTvCH;D)a1yA5tG7+&<~cDmQxli#9?`3+^2g*tid@Gz(Q? zv#`V18SEPD!PMZQZm;r!opv-f9oq?W#dd567KxG2mmUBwYeYwYD_sIZL^DW@dV=Ev zTOd8z)OSX1Egu9+`Uq&1P+>Wb@Ta+1TnxO(Jt zPktTsoa#vrXO^&s*tu|4_6t==i|kB(9^Z+3z{D~a8Hvs3ZgDp51KS^)`} zvw$gNlGr8CV(kToZ-er(DqEF=BtY_cEmojSGj9!fVD4aOs~>9W9$FglIO>#5u$Mah zu08Ix?hIE)=XmE6*DUv7u*1HM$+Q`w&jIgqH;lIyh0F`-5Hj9UVtQ{lpgW@JNVLaO z)o-vFaMJcr@m260yjv^K$D`zp@*z21?jQ{o_X-*zgRkZKayQsXY${vK%m-8IMCLJ* z#-3)qY&18K3vgxpzd}3Moh}er@qpApz6a(C7ug}1R?(>wE=U>RIyyxAoLOL15w(aD`m4-JNt&Y%IsyZwqsmoLh%q(kYJ^hkuMHj((kYdu=UhE}iJmY8VTq$SZuX0Lm z9NV1zlXY=zxZUhd24Q+J9as@)l3x^FRd0L=#zSuXHzbZ&X&f1{#PY#_=vx_=hO`SG z8Tlz{myNQ&a1Dyhj;(fQIjbBIuF3AD?vbwXu*&UWI}yDks&@nyCRx$Yl+fc=zvX*V znf^=NdTpL&3vp0A8{3NXQO;H@41OEv?qB2U=Ii2X=DRIRu#(>@wiO@4sGY=5;(Y8& zXpcECtE<`1*b8ho?oaL^SHNlb<@{)&wRlQ=FJfSBz9RLO-^&Ah$9&;nhy4<$!ridX zi&I`uI^jD1g4{q%XcqbmMluT8Cltmo3bkNgz&`IdWdC-9*PTNDMbD!9&^c%lngb~+ zJ91Mw46;UBA&>q9ayTV{v4JXora#ty7w)=n2*%qjz-gBN{jU)>0w=wLkLGuCZZ40# z#IA-<)MI8X^ELFI96Fb-r1R+CppD#g74?h~sUPV#^f9_AaQazv0IC!BXg__78OOe3 z9YCl51m~Qw@VtyW$v=WNFJ@P=O}JQC@89KF{;9A+KCPfsVA;W}kn(zq9wWvW{x;{C zdl*OR8^C@0b7UY5Hqg5bJ<9;gKZe#$dYu0(-vU;KyDs-50ZkLSDm<=3cNi zwlkAS_opY)ed$7K0L+*LWK$}Knos*+mb?npmM82C4u${o4B;EGg;XT1l;eHHz9as5 zfi$qO2nr3N0~hxT)P}vo7*$aHCw>9W;}*f0yhx1DutZy8E8ZWUfM?()nDZ=fBHRHp zVOfx_%>t8n3S`2a!H$7Ae^=Q5jgiZxmeOS4)kB3${%MkYH4rnzkJBC@sWU|w^Bivdpo$JJP=Js=~ z_{F?~f696I2L3Trkp33y;5_xdJUTE|*&XeJCLrq}$39SXkoa6TUq4#!g*;oBag=#9 zWF}(5?uDO;{5HCi&1D-I{cltiqyQW?k8M@-+Ni~m(;`NP4+~osN?O-jD?+L)tIU*f zkb&2I)SlB!Av)t_Rm$V}A zeQ-Tw^smDz_lYuBS*`4i1fPP>z+Hq>R;<887>%>7%)S&zCiy{KjyzogKoDr4r&2!i3nmUo~NFqwnLKsf$Doz4vcJS z$PDd5P3R$H1emX`K!V`}F!^hhxN;rj_Pcp;JzzUe7k))J|j4z-uhbw+QDb^8@QUCpqi2iK9SqtBDexZ7Zltn Nh$0A1lK;Pd{tuoqdJX^p literal 0 HcmV?d00001 diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java new file mode 100644 index 00000000000..90ff3eae318 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java @@ -0,0 +1,79 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_create_flow] + +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.dialogflow.cx.v3beta1.AgentName; +import com.google.cloud.dialogflow.cx.v3beta1.EventHandler; +import com.google.cloud.dialogflow.cx.v3beta1.Flow; +import com.google.cloud.dialogflow.cx.v3beta1.FlowsClient; +import com.google.cloud.dialogflow.cx.v3beta1.Fulfillment; +import com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage; +import com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class CreateFlow { + + // Create a flow in the specified agent. + public static Flow createFlow( + String displayName, + String projectId, + String locationId, + String agentId, + Map eventsToFulfillmentMessages) + throws IOException, ApiException { + // Instantiates a client + try (FlowsClient flowsClient = FlowsClient.create()) { + // Set the project agent name using the projectID (my-project-id), locationID (global), and + // agentID (UUID). + AgentName parent = AgentName.of(projectId, locationId, agentId); + + // Build the EventHandlers for the flow using the mapping from events to fulfillment messages. + List eventHandlers = new ArrayList<>(); + for (Map.Entry item : eventsToFulfillmentMessages.entrySet()) { + eventHandlers.add( + EventHandler.newBuilder() + .setEvent(item.getKey()) // Event (sys.no-match-default) + .setTriggerFulfillment( + Fulfillment.newBuilder() + // Text ("Sorry, could you say that again?") + .addMessages( + ResponseMessage.newBuilder() + .setText(Text.newBuilder().addText(item.getValue()).build()) + .build()) + .build()) + .build()); + } + + // Build the flow. + Flow flow = + Flow.newBuilder().setDisplayName(displayName).addAllEventHandlers(eventHandlers).build(); + + // Performs the create flow request. + Flow response = flowsClient.createFlow(parent, flow); + System.out.format("Flow created: %s\n", response); + + return response; + } + } +} +// [END dialogflow_cx_create_flow] diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java new file mode 100644 index 00000000000..6aca7382b45 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java @@ -0,0 +1,72 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_create_intent] + +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.dialogflow.cx.v3beta1.AgentName; +import com.google.cloud.dialogflow.cx.v3beta1.Intent; +import com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase; +import com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part; +import com.google.cloud.dialogflow.cx.v3beta1.IntentsClient; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class CreateIntent { + + // Create an intent of the given intent type. + public static Intent createIntent( + String displayName, + String projectId, + String locationId, + String agentId, + List trainingPhrasesParts) + throws IOException, ApiException { + // Instantiates a client + try (IntentsClient intentsClient = IntentsClient.create()) { + // Set the project agent name using the projectID (my-project-id), locationID (global), and + // agentID (UUID). + AgentName parent = AgentName.of(projectId, locationId, agentId); + + // Build the trainingPhrases from the trainingPhrasesParts. + List trainingPhrases = new ArrayList<>(); + for (String trainingPhrase : trainingPhrasesParts) { + trainingPhrases.add( + TrainingPhrase.newBuilder() + .addParts(Part.newBuilder().setText(trainingPhrase).build()) + .setRepeatCount(1) + .build()); + } + + // Build the intent. + Intent intent = + Intent.newBuilder() + .setDisplayName(displayName) + .addAllTrainingPhrases(trainingPhrases) + .build(); + + // Performs the create intent request. + Intent response = intentsClient.createIntent(parent, intent); + System.out.format("Intent created: %s\n", response); + + return response; + } + } +} +// [END dialogflow_cx_create_intent] diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java new file mode 100644 index 00000000000..8b9688521f8 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java @@ -0,0 +1,101 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_create_page] + +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.dialogflow.cx.v3beta1.FlowName; +import com.google.cloud.dialogflow.cx.v3beta1.Form; +import com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter; +import com.google.cloud.dialogflow.cx.v3beta1.Form.Parameter.FillBehavior; +import com.google.cloud.dialogflow.cx.v3beta1.Fulfillment; +import com.google.cloud.dialogflow.cx.v3beta1.Page; +import com.google.cloud.dialogflow.cx.v3beta1.PagesClient; +import com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage; +import com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text; +import java.io.IOException; +import java.util.List; + +public class CreatePage { + + // Create a page in the specified agent. + public static Page createPage( + String displayName, + String projectId, + String locationId, + String agentId, + String flowId, + List entryTexts) + throws IOException, ApiException { + // Instantiates a client + try (PagesClient pagesClient = PagesClient.create()) { + // Set the flow name using the projectID (my-project-id), locationID (global), agentID (UUID) + // and flowID (UUID). + FlowName parent = FlowName.of(projectId, locationId, agentId, flowId); + + // Build the entry fulfillment based on entry texts. + Fulfillment.Builder entryFulfillmentBuilder = Fulfillment.newBuilder(); + for (String entryText : entryTexts) { + entryFulfillmentBuilder.addMessages( + ResponseMessage.newBuilder() + // Text ("Hi") + .setText(Text.newBuilder().addText(entryText).build()) + .build()); + } + Fulfillment entryFulfillment = entryFulfillmentBuilder.build(); + + // Build the form for the new page. + // Note: hard coding parameters for simplicity. + FillBehavior fillBehavior = + FillBehavior.newBuilder() + .setInitialPromptFulfillment( + Fulfillment.newBuilder() + .addMessages( + ResponseMessage.newBuilder() + .setText(Text.newBuilder().addText("What would you like?").build()) + .build()) + .build()) + .build(); + Form form = + Form.newBuilder() + .addParameters( + Parameter.newBuilder() + .setDisplayName("param") + .setRequired(true) + .setEntityType("projects/-/locations/-/agents/-/entityTypes/sys.any") + .setFillBehavior(fillBehavior) + .build()) + .build(); + + // Build the page. + Page page = + Page.newBuilder() + .setDisplayName(displayName) + .setEntryFulfillment(entryFulfillment) + .setForm(form) + .build(); + + // Performs the create page request. + Page response = pagesClient.createPage(parent, page); + System.out.format("Page created: %s\n", response); + + return response; + } + } +} +// [END dialogflow_cx_create_page] diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java new file mode 100644 index 00000000000..94dffb8f3b1 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java @@ -0,0 +1,87 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_detect_intent_text] + +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse; +import com.google.cloud.dialogflow.cx.v3beta1.QueryInput; +import com.google.cloud.dialogflow.cx.v3beta1.QueryResult; +import com.google.cloud.dialogflow.cx.v3beta1.SessionName; +import com.google.cloud.dialogflow.cx.v3beta1.SessionsClient; +import com.google.cloud.dialogflow.cx.v3beta1.TextInput; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +public class DetectIntent { + + // DialogFlow API Detect Intent sample with text inputs. + public static Map detectIntent( + String projectId, + String locationId, + String agentId, + String sessionId, + List texts, + String languageCode) + throws IOException, ApiException { + Map queryResults = Maps.newHashMap(); + // Instantiates a client + try (SessionsClient sessionsClient = SessionsClient.create()) { + // Set the session name using the projectID (my-project-id), locationID (global), agentID + // (UUID), and sessionId (UUID). + SessionName session = SessionName.of(projectId, locationId, agentId, sessionId); + System.out.println("Session Path: " + session.toString()); + + // Detect intents for each text input. + for (String text : texts) { + // Set the text (hello) for the query. + TextInput.Builder textInput = TextInput.newBuilder().setText(text); + + // Build the query with the TextInput and language code (en-US). + QueryInput queryInput = + QueryInput.newBuilder().setText(textInput).setLanguageCode(languageCode).build(); + + // Build the DetectIntentRequest with the SessionName and QueryInput. + DetectIntentRequest request = + DetectIntentRequest.newBuilder() + .setSession(session.toString()) + .setQueryInput(queryInput) + .build(); + + // Performs the detect intent request. + DetectIntentResponse response = sessionsClient.detectIntent(request); + + // Display the query result. + QueryResult queryResult = response.getQueryResult(); + + System.out.println("===================="); + System.out.format("Query Text: '%s'\n", queryResult.getText()); + System.out.format( + "Detected Intent: %s (confidence: %f)\n", + queryResult.getIntent().getDisplayName(), queryResult.getIntentDetectionConfidence()); + + queryResults.put(text, queryResult); + } + } + return queryResults; + } +} +// [END dialogflow_cx_detect_intent_text] diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java new file mode 100644 index 00000000000..3bab80a0150 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java @@ -0,0 +1,112 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_detect_intent_streaming] + +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.dialogflow.cx.v3beta1.AudioEncoding; +import com.google.cloud.dialogflow.cx.v3beta1.AudioInput; +import com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig; +import com.google.cloud.dialogflow.cx.v3beta1.QueryInput; +import com.google.cloud.dialogflow.cx.v3beta1.QueryResult; +import com.google.cloud.dialogflow.cx.v3beta1.SessionName; +import com.google.cloud.dialogflow.cx.v3beta1.SessionsClient; +import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse; +import com.google.protobuf.ByteString; +import java.io.FileInputStream; +import java.io.IOException; + +public class DetectIntentStream { + + // DialogFlow API Detect Intent sample with audio files processes as an audio stream. + public static void detectIntentStream( + String projectId, String locationId, String agentId, String sessionId, String audioFilePath) + throws ApiException, IOException { + // Instantiates a client + try (SessionsClient sessionsClient = SessionsClient.create()) { + // Set the session name using the projectID (my-project-id), locationID (global), agentID + // (UUID), and sessionId (UUID). + // Using the same `sessionId` between requests allows continuation of the conversation. + SessionName session = SessionName.of(projectId, locationId, agentId, sessionId); + + // Instructs the speech recognizer how to process the audio content. + // Note: hard coding audioEncoding and sampleRateHertz for simplicity. + // Audio encoding of the audio content sent in the query request. + InputAudioConfig inputAudioConfig = + InputAudioConfig.newBuilder() + .setAudioEncoding(AudioEncoding.AUDIO_ENCODING_LINEAR_16) + .setSampleRateHertz(16000) // sampleRateHertz = 16000 + .build(); + + // Build the AudioInput with the InputAudioConfig. + AudioInput audioInput = AudioInput.newBuilder().setConfig(inputAudioConfig).build(); + + // Build the query with the InputAudioConfig. + QueryInput queryInput = + QueryInput.newBuilder() + .setAudio(audioInput) + .setLanguageCode("en-US") // languageCode = "en-US" + .build(); + + // Create the Bidirectional stream + BidiStream bidiStream = + sessionsClient.streamingDetectIntentCallable().call(); + + // The first request must **only** contain the audio configuration: + bidiStream.send( + StreamingDetectIntentRequest.newBuilder() + .setSession(session.toString()) + .setQueryInput(queryInput) + .build()); + + try (FileInputStream audioStream = new FileInputStream(audioFilePath)) { + // Subsequent requests must **only** contain the audio data. + // Following messages: audio chunks. We just read the file in fixed-size chunks. In reality + // you would split the user input by time. + byte[] buffer = new byte[4096]; + int bytes; + while ((bytes = audioStream.read(buffer)) != -1) { + AudioInput subAudioInput = + AudioInput.newBuilder().setAudio(ByteString.copyFrom(buffer, 0, bytes)).build(); + QueryInput subQueryInput = + QueryInput.newBuilder() + .setAudio(subAudioInput) + .setLanguageCode("en-US") // languageCode = "en-US" + .build(); + bidiStream.send( + StreamingDetectIntentRequest.newBuilder().setQueryInput(subQueryInput).build()); + } + } + + // Tell the service you are done sending data. + bidiStream.closeSend(); + + for (StreamingDetectIntentResponse response : bidiStream) { + QueryResult queryResult = response.getDetectIntentResponse().getQueryResult(); + System.out.println("===================="); + System.out.format("Query Text: '%s'\n", queryResult.getTranscript()); + System.out.format( + "Detected Intent: %s (confidence: %f)\n", + queryResult.getIntent().getDisplayName(), queryResult.getIntentDetectionConfidence()); + } + } + } +} +// [END dialogflow_cx_detect_intent_streaming] diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateFlowIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateFlowIT.java new file mode 100644 index 00000000000..f5356828bbc --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateFlowIT.java @@ -0,0 +1,67 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static org.junit.Assert.assertEquals; + +import com.google.cloud.dialogflow.cx.v3beta1.Flow; +import com.google.cloud.dialogflow.cx.v3beta1.FlowsClient; +import com.google.common.collect.ImmutableMap; +import java.util.Map; +import java.util.UUID; +import org.junit.After; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Integration (system) tests for {@link CreateFlow}. */ +@RunWith(JUnit4.class) +@SuppressWarnings("checkstyle:abbreviationaswordinname") +public class CreateFlowIT { + + private static String DISPLAY_NAME = "flow-" + UUID.randomUUID().toString(); + private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static String LOCATION = "global"; + private static String AGENT_ID = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static Map EVENT_TO_FULFILLMENT_MESSAGES = + ImmutableMap.of("event-1", "message-1", "event-2", "message-2"); + private static String newFlowName; + + @After + public void tearDown() throws Exception { + // Delete the newly created Flow. + if (newFlowName != null) { + try (FlowsClient flowsClient = FlowsClient.create()) { + flowsClient.deleteFlow(newFlowName); + } + } + } + + @Test + public void testCreateFlow() throws Exception { + Flow result = + CreateFlow.createFlow( + DISPLAY_NAME, PROJECT_ID, LOCATION, AGENT_ID, EVENT_TO_FULFILLMENT_MESSAGES); + newFlowName = result.getName(); + + assertEquals(result.getDisplayName(), DISPLAY_NAME); + // Number of added event handlers + 2 default event handlers. + assertEquals(result.getEventHandlersCount(), EVENT_TO_FULFILLMENT_MESSAGES.size() + 2); + } +} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateIntentIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateIntentIT.java new file mode 100644 index 00000000000..67580d3c4f5 --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateIntentIT.java @@ -0,0 +1,71 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import com.google.cloud.dialogflow.cx.v3beta1.Intent; +import com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase; +import com.google.cloud.dialogflow.cx.v3beta1.IntentsClient; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.junit.After; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Integration (system) tests for {@link CreateIntent}. */ +@RunWith(JUnit4.class) +@SuppressWarnings("checkstyle:abbreviationaswordinname") +public class CreateIntentIT { + + private static String DISPLAY_NAME = "intent-" + UUID.randomUUID().toString(); + private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static String LOCATION = "global"; + private static String AGENT_ID = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static List TRAINING_PHRASES_PARTS = Arrays.asList("red", "blue", "green"); + private static String newIntentName; + + @After + public void tearDown() throws Exception { + // Delete the newly created Intent. + if (newIntentName != null) { + try (IntentsClient intentsClient = IntentsClient.create()) { + intentsClient.deleteIntent(newIntentName); + } + } + } + + @Test + public void testCreateIntent() throws Exception { + Intent result = + CreateIntent.createIntent( + DISPLAY_NAME, PROJECT_ID, LOCATION, AGENT_ID, TRAINING_PHRASES_PARTS); + newIntentName = result.getName(); + + assertEquals(result.getTrainingPhrasesCount(), TRAINING_PHRASES_PARTS.size()); + for (TrainingPhrase trainingPhrase : result.getTrainingPhrasesList()) { + assertEquals(trainingPhrase.getPartsCount(), 1); + String partText = trainingPhrase.getParts(0).getText(); + assertTrue(partText.equals("red") || partText.equals("blue") || partText.equals("green")); + } + } +} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreatePageIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreatePageIT.java new file mode 100644 index 00000000000..4b3c26601ad --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreatePageIT.java @@ -0,0 +1,66 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static org.junit.Assert.assertEquals; + +import com.google.cloud.dialogflow.cx.v3beta1.Page; +import com.google.cloud.dialogflow.cx.v3beta1.PagesClient; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.junit.After; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Integration (system) tests for {@link CreatePage}. */ +@RunWith(JUnit4.class) +@SuppressWarnings("checkstyle:abbreviationaswordinname") +public class CreatePageIT { + + private static String DISPLAY_NAME = "page-" + UUID.randomUUID().toString(); + private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static String LOCATION = "global"; + private static String AGENT_ID = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String DEFAULT_START_FLOW_ID = "00000000-0000-0000-0000-000000000000"; + private static List ENTRY_TEXTS = Arrays.asList("Hi", "Hello", "How can I help you?"); + private static String newPageName; + + @After + public void tearDown() throws Exception { + // Delete the newly created Page. + if (newPageName != null) { + try (PagesClient pagesClient = PagesClient.create()) { + pagesClient.deletePage(newPageName); + } + } + } + + @Test + public void testCreatePage() throws Exception { + Page result = + CreatePage.createPage( + DISPLAY_NAME, PROJECT_ID, LOCATION, AGENT_ID, DEFAULT_START_FLOW_ID, ENTRY_TEXTS); + newPageName = result.getName(); + + assertEquals(result.getDisplayName(), DISPLAY_NAME); + assertEquals(result.getEntryFulfillment().getMessagesCount(), ENTRY_TEXTS.size()); + } +} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java new file mode 100644 index 00000000000..2a7e362a561 --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static org.junit.Assert.assertEquals; + +import com.google.cloud.dialogflow.cx.v3beta1.QueryResult; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Integration (system) tests for {@link DetectIntent}. */ +@RunWith(JUnit4.class) +@SuppressWarnings("checkstyle:abbreviationaswordinname") +public class DetectIntentIT { + + private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static String LOCATION = "global"; + private static String AGENT_ID = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String SESSION_ID = UUID.randomUUID().toString(); + private static String LANGUAGE_CODE = "en-US"; + private static List TEXTS = Arrays.asList("hello", "book a meeting room"); + + @Test + public void testDetectIntent() throws Exception { + Map queryResults = + DetectIntent.detectIntent(PROJECT_ID, LOCATION, AGENT_ID, SESSION_ID, TEXTS, LANGUAGE_CODE); + assertEquals(queryResults.size(), TEXTS.size()); + for (int i = 0; i < TEXTS.size(); i++) { + String text = TEXTS.get(i); + assertEquals(queryResults.get(text).getText(), text); + } + } +} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamIT.java new file mode 100644 index 00000000000..5a86c6e4fe9 --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamIT.java @@ -0,0 +1,69 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.UUID; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Integration (system) tests for {@link DetectIntentStream}. */ +@RunWith(JUnit4.class) +@SuppressWarnings("checkstyle:abbreviationaswordinname") +public class DetectIntentStreamIT { + + private static String AUDIO_FILE_PATH = "resources/book_a_room.wav"; + private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static String LOCATION = "global"; + private static String AGENT_ID = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String SESSION_ID = UUID.randomUUID().toString(); + private ByteArrayOutputStream bout; + private PrintStream original; + + @Before + public void setUp() { + original = System.out; + bout = new ByteArrayOutputStream(); + System.setOut(new PrintStream(bout)); + } + + @After + public void tearDown() { + System.setOut(original); + bout.reset(); + } + + @Test + public void testDetectIntentStream() throws IOException { + DetectIntentStream.detectIntentStream( + PROJECT_ID, LOCATION, AGENT_ID, SESSION_ID, AUDIO_FILE_PATH); + + String output = bout.toString(); + + assertThat(output).contains("Detected Intent"); + assertThat(output).contains("book"); + } +} From 5ada7f81a615a620feddb6125645687ee63ff8dc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 2 Oct 2020 18:52:25 +0200 Subject: [PATCH 05/73] chore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.21 (#37) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.cloud.samples:shared-configuration](com/google/cloud/samples/shared-configuration) | patch | `1.0.18` -> `1.0.21` | --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 144c091fb87..d21fc71b76a 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.18 + 1.0.21 From ebb8906525bca89d520954b0a7d2ec29e10ff0ab Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 8 Oct 2020 23:44:19 +0200 Subject: [PATCH 06/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.1.2 (#33) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | patch | `0.1.0` -> `0.1.2` | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.1.2`](https://togithub.com/googleapis/java-dialogflow-cx/blob/master/CHANGELOG.md#​012-httpswwwgithubcomgoogleapisjava-dialogflow-cxcomparev011v012-2020-10-08) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.1.1...v0.1.2) ### [`v0.1.1`](https://togithub.com/googleapis/java-dialogflow-cx/blob/master/CHANGELOG.md#​011-httpswwwgithubcomgoogleapisjava-dialogflow-cxcomparev010v011-2020-09-23) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.1.0...v0.1.1)
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index d21fc71b76a..57ce3e38494 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.1.0 + 0.1.2 From 605a5162733a2b6d35cad4513635e59ebd6952b0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 12 Oct 2020 18:59:43 +0200 Subject: [PATCH 07/73] test(deps): update dependency junit:junit to v4.13.1 --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 57ce3e38494..7bd52341286 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -34,7 +34,7 @@ junit junit - 4.13 + 4.13.1 test From 1656f0050aef17c1e0fe49a87d885e112e1c6d1d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 22 Oct 2020 21:36:37 +0200 Subject: [PATCH 08/73] test(deps): update dependency com.google.truth:truth to v1.1 (#56) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.truth:truth](com/google/truth/truth) | minor | `1.0.1` -> `1.1` | --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 7bd52341286..8ff5a9cb0ba 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -40,7 +40,7 @@ com.google.truth truth - 1.0.1 + 1.1 test From a38ea5e956f3af07f9220f76d3deea58b72938ea Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 Nov 2020 23:02:32 +0100 Subject: [PATCH 09/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.3.0 (#71) --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 8ff5a9cb0ba..d7d74e58500 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.1.2 + 0.3.0 From ea77718ac4a20bccd519681fd4602630868a3f14 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 13 Nov 2020 23:28:21 +0100 Subject: [PATCH 10/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.3.1 (#81) --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index d7d74e58500..21de39a587f 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.3.0 + 0.3.1 From 092858ea8d81fe9ee3d141aa9ae1a0acb656d03e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 19 Nov 2020 18:38:22 +0100 Subject: [PATCH 11/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.4.0 (#86) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | minor | `0.3.1` -> `0.4.0` | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.4.0`](https://togithub.com/googleapis/java-dialogflow-cx/blob/master/CHANGELOG.md#​040-httpswwwgithubcomgoogleapisjava-dialogflow-cxcomparev031v040-2020-11-13) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.3.1...v0.4.0) ##### Features - add v3 client ([#​74](https://www.github.com/googleapis/java-dialogflow-cx/issues/74)) ([f1c6142](https://www.github.com/googleapis/java-dialogflow-cx/commit/f1c614229b458d18d1f631edb9a69b087a8ebbba)) - expose matched event in Sessions API. ([#​83](https://www.github.com/googleapis/java-dialogflow-cx/issues/83)) ([22344ef](https://www.github.com/googleapis/java-dialogflow-cx/commit/22344ef0df7361dcb56b0b34d369b30b5bf482bd)) ##### [0.3.1](https://www.github.com/googleapis/java-dialogflow-cx/compare/v0.3.0...v0.3.1) (2020-11-11) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.15.0 ([#​76](https://www.github.com/googleapis/java-dialogflow-cx/issues/76)) ([4f0bff4](https://www.github.com/googleapis/java-dialogflow-cx/commit/4f0bff488e4155e1ad1255503c497db932d4d7d8))
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 21de39a587f..e1acf8c8fef 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.3.1 + 0.4.0 From 71bb6bb3a6abca15f87b13f08a64fe000204f38d Mon Sep 17 00:00:00 2001 From: "Jessie (Xiaoyu) Jiang" <70290069+jessiexjiang27@users.noreply.github.com> Date: Thu, 10 Dec 2020 15:40:41 -0500 Subject: [PATCH 12/73] samples: add sample code to query regional Dialogflow CX agent (#100) * samples: add sample code to query regional Dialogflow CX agent Add logic to query regional Dialogflow CX endpoint for the following methods: - CreateFlow - CreateIntent - CreatePage - DetectIntent - DetectIntentStream * Fix: use equals instead of == for string comparison --- .../main/java/dialogflow/cx/CreateFlow.java | 11 +++- .../main/java/dialogflow/cx/CreateIntent.java | 11 +++- .../main/java/dialogflow/cx/CreatePage.java | 11 +++- .../main/java/dialogflow/cx/DetectIntent.java | 11 +++- .../dialogflow/cx/DetectIntentStream.java | 11 +++- .../test/java/dialogflow/cx/CreateFlowIT.java | 64 ++++++++++++++---- .../java/dialogflow/cx/CreateIntentIT.java | 60 +++++++++++++---- .../test/java/dialogflow/cx/CreatePageIT.java | 65 +++++++++++++++---- .../java/dialogflow/cx/DetectIntentIT.java | 27 ++++++-- .../dialogflow/cx/DetectIntentStreamIT.java | 25 +++++-- 10 files changed, 242 insertions(+), 54 deletions(-) diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java index 90ff3eae318..7098aa861fb 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java @@ -23,6 +23,7 @@ import com.google.cloud.dialogflow.cx.v3beta1.EventHandler; import com.google.cloud.dialogflow.cx.v3beta1.Flow; import com.google.cloud.dialogflow.cx.v3beta1.FlowsClient; +import com.google.cloud.dialogflow.cx.v3beta1.FlowsSettings; import com.google.cloud.dialogflow.cx.v3beta1.Fulfillment; import com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage; import com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text; @@ -41,8 +42,16 @@ public static Flow createFlow( String agentId, Map eventsToFulfillmentMessages) throws IOException, ApiException { + FlowsSettings.Builder flowsSettingsBuilder = FlowsSettings.newBuilder(); + if (locationId.equals("global")) { + flowsSettingsBuilder.setEndpoint("dialogflow.googleapis.com:443"); + } else { + flowsSettingsBuilder.setEndpoint(locationId + "-dialogflow.googleapis.com:443"); + } + FlowsSettings flowsSettings = flowsSettingsBuilder.build(); + // Instantiates a client - try (FlowsClient flowsClient = FlowsClient.create()) { + try (FlowsClient flowsClient = FlowsClient.create(flowsSettings)) { // Set the project agent name using the projectID (my-project-id), locationID (global), and // agentID (UUID). AgentName parent = AgentName.of(projectId, locationId, agentId); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java index 6aca7382b45..d9e473585bc 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java @@ -24,6 +24,7 @@ import com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase; import com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase.Part; import com.google.cloud.dialogflow.cx.v3beta1.IntentsClient; +import com.google.cloud.dialogflow.cx.v3beta1.IntentsSettings; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -38,8 +39,16 @@ public static Intent createIntent( String agentId, List trainingPhrasesParts) throws IOException, ApiException { + IntentsSettings.Builder intentsSettingsBuilder = IntentsSettings.newBuilder(); + if (locationId.equals("global")) { + intentsSettingsBuilder.setEndpoint("dialogflow.googleapis.com:443"); + } else { + intentsSettingsBuilder.setEndpoint(locationId + "-dialogflow.googleapis.com:443"); + } + IntentsSettings intentsSettings = intentsSettingsBuilder.build(); + // Instantiates a client - try (IntentsClient intentsClient = IntentsClient.create()) { + try (IntentsClient intentsClient = IntentsClient.create(intentsSettings)) { // Set the project agent name using the projectID (my-project-id), locationID (global), and // agentID (UUID). AgentName parent = AgentName.of(projectId, locationId, agentId); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java index 8b9688521f8..4418e8970f8 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java @@ -26,6 +26,7 @@ import com.google.cloud.dialogflow.cx.v3beta1.Fulfillment; import com.google.cloud.dialogflow.cx.v3beta1.Page; import com.google.cloud.dialogflow.cx.v3beta1.PagesClient; +import com.google.cloud.dialogflow.cx.v3beta1.PagesSettings; import com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage; import com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text; import java.io.IOException; @@ -42,8 +43,16 @@ public static Page createPage( String flowId, List entryTexts) throws IOException, ApiException { + PagesSettings.Builder pagesSettingsBuilder = PagesSettings.newBuilder(); + if (locationId.equals("global")) { + pagesSettingsBuilder.setEndpoint("dialogflow.googleapis.com:443"); + } else { + pagesSettingsBuilder.setEndpoint(locationId + "-dialogflow.googleapis.com:443"); + } + PagesSettings pagesSettings = pagesSettingsBuilder.build(); + // Instantiates a client - try (PagesClient pagesClient = PagesClient.create()) { + try (PagesClient pagesClient = PagesClient.create(pagesSettings)) { // Set the flow name using the projectID (my-project-id), locationID (global), agentID (UUID) // and flowID (UUID). FlowName parent = FlowName.of(projectId, locationId, agentId, flowId); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java index 94dffb8f3b1..d89067ad8ce 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java @@ -25,6 +25,7 @@ import com.google.cloud.dialogflow.cx.v3beta1.QueryResult; import com.google.cloud.dialogflow.cx.v3beta1.SessionName; import com.google.cloud.dialogflow.cx.v3beta1.SessionsClient; +import com.google.cloud.dialogflow.cx.v3beta1.SessionsSettings; import com.google.cloud.dialogflow.cx.v3beta1.TextInput; import com.google.common.collect.Maps; import java.io.IOException; @@ -42,9 +43,17 @@ public static Map detectIntent( List texts, String languageCode) throws IOException, ApiException { + SessionsSettings.Builder sessionsSettingsBuilder = SessionsSettings.newBuilder(); + if (locationId.equals("global")) { + sessionsSettingsBuilder.setEndpoint("dialogflow.googleapis.com:443"); + } else { + sessionsSettingsBuilder.setEndpoint(locationId + "-dialogflow.googleapis.com:443"); + } + SessionsSettings sessionsSettings = sessionsSettingsBuilder.build(); + Map queryResults = Maps.newHashMap(); // Instantiates a client - try (SessionsClient sessionsClient = SessionsClient.create()) { + try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { // Set the session name using the projectID (my-project-id), locationID (global), agentID // (UUID), and sessionId (UUID). SessionName session = SessionName.of(projectId, locationId, agentId, sessionId); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java index 3bab80a0150..125581c83e0 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java @@ -27,6 +27,7 @@ import com.google.cloud.dialogflow.cx.v3beta1.QueryResult; import com.google.cloud.dialogflow.cx.v3beta1.SessionName; import com.google.cloud.dialogflow.cx.v3beta1.SessionsClient; +import com.google.cloud.dialogflow.cx.v3beta1.SessionsSettings; import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest; import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse; import com.google.protobuf.ByteString; @@ -39,8 +40,16 @@ public class DetectIntentStream { public static void detectIntentStream( String projectId, String locationId, String agentId, String sessionId, String audioFilePath) throws ApiException, IOException { + SessionsSettings.Builder sessionsSettingsBuilder = SessionsSettings.newBuilder(); + if (locationId.equals("global")) { + sessionsSettingsBuilder.setEndpoint("dialogflow.googleapis.com:443"); + } else { + sessionsSettingsBuilder.setEndpoint(locationId + "-dialogflow.googleapis.com:443"); + } + SessionsSettings sessionsSettings = sessionsSettingsBuilder.build(); + // Instantiates a client - try (SessionsClient sessionsClient = SessionsClient.create()) { + try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { // Set the session name using the projectID (my-project-id), locationID (global), agentID // (UUID), and sessionId (UUID). // Using the same `sessionId` between requests allows continuation of the conversation. diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateFlowIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateFlowIT.java index f5356828bbc..1c9e02135b5 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateFlowIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateFlowIT.java @@ -20,10 +20,11 @@ import com.google.cloud.dialogflow.cx.v3beta1.Flow; import com.google.cloud.dialogflow.cx.v3beta1.FlowsClient; +import com.google.cloud.dialogflow.cx.v3beta1.FlowsSettings; import com.google.common.collect.ImmutableMap; import java.util.Map; import java.util.UUID; -import org.junit.After; +import org.junit.AfterClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -35,30 +36,67 @@ public class CreateFlowIT { private static String DISPLAY_NAME = "flow-" + UUID.randomUUID().toString(); private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); - private static String LOCATION = "global"; - private static String AGENT_ID = + private static String LOCATION_GLOBAL = "global"; + private static String LOCATION_REGIONAL = "us-central1"; + private static String AGENT_ID_GLOBAL = System.getenv() - .getOrDefault("DIALOGFLOW_CX_AGENT_ID", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_GLOBAL", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String AGENT_ID_REGIONAL = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_REGIONAL", "1ea2bf10-d5ef-4442-b93f-a917d1991014"); private static Map EVENT_TO_FULFILLMENT_MESSAGES = ImmutableMap.of("event-1", "message-1", "event-2", "message-2"); - private static String newFlowName; - @After - public void tearDown() throws Exception { - // Delete the newly created Flow. - if (newFlowName != null) { + private static String newFlowNameGlobal; + private static String newFlowNameRegional; + + @AfterClass + public static void tearDown() throws Exception { + // Delete the newly created Flow in the global location. + if (newFlowNameGlobal != null) { try (FlowsClient flowsClient = FlowsClient.create()) { - flowsClient.deleteFlow(newFlowName); + flowsClient.deleteFlow(newFlowNameGlobal); } } + + // Delete the newly created Flow in the regional location. + if (newFlowNameRegional != null) { + FlowsSettings flowsSettings = + FlowsSettings.newBuilder() + .setEndpoint(LOCATION_REGIONAL + "-dialogflow.googleapis.com:443") + .build(); + try (FlowsClient flowsClient = FlowsClient.create(flowsSettings)) { + flowsClient.deleteFlow(newFlowNameRegional); + } + } + } + + @Test + public void testCreateFlowGlobal() throws Exception { + Flow result = + CreateFlow.createFlow( + DISPLAY_NAME, + PROJECT_ID, + LOCATION_GLOBAL, + AGENT_ID_GLOBAL, + EVENT_TO_FULFILLMENT_MESSAGES); + newFlowNameGlobal = result.getName(); + + assertEquals(result.getDisplayName(), DISPLAY_NAME); + // Number of added event handlers + 2 default event handlers. + assertEquals(result.getEventHandlersCount(), EVENT_TO_FULFILLMENT_MESSAGES.size() + 2); } @Test - public void testCreateFlow() throws Exception { + public void testCreateFlowRegional() throws Exception { Flow result = CreateFlow.createFlow( - DISPLAY_NAME, PROJECT_ID, LOCATION, AGENT_ID, EVENT_TO_FULFILLMENT_MESSAGES); - newFlowName = result.getName(); + DISPLAY_NAME, + PROJECT_ID, + LOCATION_REGIONAL, + AGENT_ID_REGIONAL, + EVENT_TO_FULFILLMENT_MESSAGES); + newFlowNameRegional = result.getName(); assertEquals(result.getDisplayName(), DISPLAY_NAME); // Number of added event handlers + 2 default event handlers. diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateIntentIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateIntentIT.java index 67580d3c4f5..9cd42c025b8 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateIntentIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateIntentIT.java @@ -22,10 +22,11 @@ import com.google.cloud.dialogflow.cx.v3beta1.Intent; import com.google.cloud.dialogflow.cx.v3beta1.Intent.TrainingPhrase; import com.google.cloud.dialogflow.cx.v3beta1.IntentsClient; +import com.google.cloud.dialogflow.cx.v3beta1.IntentsSettings; import java.util.Arrays; import java.util.List; import java.util.UUID; -import org.junit.After; +import org.junit.AfterClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -37,29 +38,62 @@ public class CreateIntentIT { private static String DISPLAY_NAME = "intent-" + UUID.randomUUID().toString(); private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); - private static String LOCATION = "global"; - private static String AGENT_ID = + private static String LOCATION_GLOBAL = "global"; + private static String LOCATION_REGIONAL = "us-central1"; + private static String AGENT_ID_GLOBAL = System.getenv() - .getOrDefault("DIALOGFLOW_CX_AGENT_ID", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_GLOBAL", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String AGENT_ID_REGIONAL = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_REGIONAL", "1ea2bf10-d5ef-4442-b93f-a917d1991014"); private static List TRAINING_PHRASES_PARTS = Arrays.asList("red", "blue", "green"); - private static String newIntentName; - @After - public void tearDown() throws Exception { - // Delete the newly created Intent. - if (newIntentName != null) { + private static String newIntentNameGlobal; + private static String newIntentNameRegional; + + @AfterClass + public static void tearDown() throws Exception { + // Delete the newly created Intent in the global location. + if (newIntentNameGlobal != null) { try (IntentsClient intentsClient = IntentsClient.create()) { - intentsClient.deleteIntent(newIntentName); + intentsClient.deleteIntent(newIntentNameGlobal); + } + } + + // Delete the newly created Intent in the regional location. + if (newIntentNameRegional != null) { + IntentsSettings intentsSettings = + IntentsSettings.newBuilder() + .setEndpoint(LOCATION_REGIONAL + "-dialogflow.googleapis.com:443") + .build(); + try (IntentsClient intentsClient = IntentsClient.create(intentsSettings)) { + intentsClient.deleteIntent(newIntentNameRegional); } } } @Test - public void testCreateIntent() throws Exception { + public void testCreateIntentGlobal() throws Exception { + Intent result = + CreateIntent.createIntent( + DISPLAY_NAME, PROJECT_ID, LOCATION_GLOBAL, AGENT_ID_GLOBAL, TRAINING_PHRASES_PARTS); + newIntentNameGlobal = result.getName(); + + assertEquals(result.getTrainingPhrasesCount(), TRAINING_PHRASES_PARTS.size()); + for (TrainingPhrase trainingPhrase : result.getTrainingPhrasesList()) { + assertEquals(trainingPhrase.getPartsCount(), 1); + String partText = trainingPhrase.getParts(0).getText(); + assertTrue(partText.equals("red") || partText.equals("blue") || partText.equals("green")); + } + } + + @Test + public void testCreateIntentRegional() throws Exception { Intent result = CreateIntent.createIntent( - DISPLAY_NAME, PROJECT_ID, LOCATION, AGENT_ID, TRAINING_PHRASES_PARTS); - newIntentName = result.getName(); + DISPLAY_NAME, PROJECT_ID, LOCATION_REGIONAL, AGENT_ID_REGIONAL, TRAINING_PHRASES_PARTS); + newIntentNameRegional = result.getName(); + System.out.println("intent name new:" + newIntentNameRegional); assertEquals(result.getTrainingPhrasesCount(), TRAINING_PHRASES_PARTS.size()); for (TrainingPhrase trainingPhrase : result.getTrainingPhrasesList()) { diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreatePageIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreatePageIT.java index 4b3c26601ad..649d5a6c8fd 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreatePageIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreatePageIT.java @@ -20,10 +20,11 @@ import com.google.cloud.dialogflow.cx.v3beta1.Page; import com.google.cloud.dialogflow.cx.v3beta1.PagesClient; +import com.google.cloud.dialogflow.cx.v3beta1.PagesSettings; import java.util.Arrays; import java.util.List; import java.util.UUID; -import org.junit.After; +import org.junit.AfterClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -35,30 +36,68 @@ public class CreatePageIT { private static String DISPLAY_NAME = "page-" + UUID.randomUUID().toString(); private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); - private static String LOCATION = "global"; - private static String AGENT_ID = + private static String LOCATION_GLOBAL = "global"; + private static String LOCATION_REGIONAL = "us-central1"; + private static String AGENT_ID_GLOBAL = System.getenv() - .getOrDefault("DIALOGFLOW_CX_AGENT_ID", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_GLOBAL", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String AGENT_ID_REGIONAL = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_REGIONAL", "1ea2bf10-d5ef-4442-b93f-a917d1991014"); private static String DEFAULT_START_FLOW_ID = "00000000-0000-0000-0000-000000000000"; private static List ENTRY_TEXTS = Arrays.asList("Hi", "Hello", "How can I help you?"); - private static String newPageName; - @After - public void tearDown() throws Exception { - // Delete the newly created Page. - if (newPageName != null) { + private static String newPageNameGlobal; + private static String newPageNameRegional; + + @AfterClass + public static void tearDown() throws Exception { + // Delete the newly created Page in the global location. + if (newPageNameGlobal != null) { try (PagesClient pagesClient = PagesClient.create()) { - pagesClient.deletePage(newPageName); + pagesClient.deletePage(newPageNameGlobal); } } + + // Delete the newly created Page in the regional location. + if (newPageNameRegional != null) { + PagesSettings pagesSettings = + PagesSettings.newBuilder() + .setEndpoint(LOCATION_REGIONAL + "-dialogflow.googleapis.com:443") + .build(); + try (PagesClient pagesClient = PagesClient.create(pagesSettings)) { + pagesClient.deletePage(newPageNameRegional); + } + } + } + + @Test + public void testCreatePageGlobal() throws Exception { + Page result = + CreatePage.createPage( + DISPLAY_NAME, + PROJECT_ID, + LOCATION_GLOBAL, + AGENT_ID_GLOBAL, + DEFAULT_START_FLOW_ID, + ENTRY_TEXTS); + newPageNameGlobal = result.getName(); + + assertEquals(result.getDisplayName(), DISPLAY_NAME); + assertEquals(result.getEntryFulfillment().getMessagesCount(), ENTRY_TEXTS.size()); } @Test - public void testCreatePage() throws Exception { + public void testCreatePageRegional() throws Exception { Page result = CreatePage.createPage( - DISPLAY_NAME, PROJECT_ID, LOCATION, AGENT_ID, DEFAULT_START_FLOW_ID, ENTRY_TEXTS); - newPageName = result.getName(); + DISPLAY_NAME, + PROJECT_ID, + LOCATION_REGIONAL, + AGENT_ID_REGIONAL, + DEFAULT_START_FLOW_ID, + ENTRY_TEXTS); + newPageNameRegional = result.getName(); assertEquals(result.getDisplayName(), DISPLAY_NAME); assertEquals(result.getEntryFulfillment().getMessagesCount(), ENTRY_TEXTS.size()); diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java index 2a7e362a561..bf0e300a77d 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java @@ -33,18 +33,35 @@ public class DetectIntentIT { private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); - private static String LOCATION = "global"; - private static String AGENT_ID = + private static String LOCATION_GLOBAL = "global"; + private static String LOCATION_REGIONAL = "us-central1"; + private static String AGENT_ID_GLOBAL = System.getenv() - .getOrDefault("DIALOGFLOW_CX_AGENT_ID", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_GLOBAL", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String AGENT_ID_REGIONAL = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_REGIONAL", "1ea2bf10-d5ef-4442-b93f-a917d1991014"); private static String SESSION_ID = UUID.randomUUID().toString(); private static String LANGUAGE_CODE = "en-US"; private static List TEXTS = Arrays.asList("hello", "book a meeting room"); @Test - public void testDetectIntent() throws Exception { + public void testDetectIntentGlobal() throws Exception { + Map queryResults = + DetectIntent.detectIntent( + PROJECT_ID, LOCATION_GLOBAL, AGENT_ID_GLOBAL, SESSION_ID, TEXTS, LANGUAGE_CODE); + assertEquals(queryResults.size(), TEXTS.size()); + for (int i = 0; i < TEXTS.size(); i++) { + String text = TEXTS.get(i); + assertEquals(queryResults.get(text).getText(), text); + } + } + + @Test + public void testDetectIntentRegional() throws Exception { Map queryResults = - DetectIntent.detectIntent(PROJECT_ID, LOCATION, AGENT_ID, SESSION_ID, TEXTS, LANGUAGE_CODE); + DetectIntent.detectIntent( + PROJECT_ID, LOCATION_REGIONAL, AGENT_ID_REGIONAL, SESSION_ID, TEXTS, LANGUAGE_CODE); assertEquals(queryResults.size(), TEXTS.size()); for (int i = 0; i < TEXTS.size(); i++) { String text = TEXTS.get(i); diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamIT.java index 5a86c6e4fe9..4ef71b0edb7 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamIT.java @@ -35,10 +35,14 @@ public class DetectIntentStreamIT { private static String AUDIO_FILE_PATH = "resources/book_a_room.wav"; private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); - private static String LOCATION = "global"; - private static String AGENT_ID = + private static String LOCATION_GLOBAL = "global"; + private static String LOCATION_REGIONAL = "us-central1"; + private static String AGENT_ID_GLOBAL = System.getenv() - .getOrDefault("DIALOGFLOW_CX_AGENT_ID", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_GLOBAL", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String AGENT_ID_REGIONAL = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_REGIONAL", "1ea2bf10-d5ef-4442-b93f-a917d1991014"); private static String SESSION_ID = UUID.randomUUID().toString(); private ByteArrayOutputStream bout; private PrintStream original; @@ -57,9 +61,20 @@ public void tearDown() { } @Test - public void testDetectIntentStream() throws IOException { + public void testDetectIntentStreamGlobal() throws IOException { + DetectIntentStream.detectIntentStream( + PROJECT_ID, LOCATION_GLOBAL, AGENT_ID_GLOBAL, SESSION_ID, AUDIO_FILE_PATH); + + String output = bout.toString(); + + assertThat(output).contains("Detected Intent"); + assertThat(output).contains("book"); + } + + @Test + public void testDetectIntentStreamRegional() throws IOException { DetectIntentStream.detectIntentStream( - PROJECT_ID, LOCATION, AGENT_ID, SESSION_ID, AUDIO_FILE_PATH); + PROJECT_ID, LOCATION_REGIONAL, AGENT_ID_REGIONAL, SESSION_ID, AUDIO_FILE_PATH); String output = bout.toString(); From 3ab5f10c89b40ce2a2cb68e3b1c88be0c7d026a3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Dec 2020 20:56:12 +0100 Subject: [PATCH 13/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.4.1 (#102) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | patch | `0.4.0` -> `0.4.1` | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.4.1`](https://togithub.com/googleapis/java-dialogflow-cx/blob/master/CHANGELOG.md#​041-httpswwwgithubcomgoogleapisjava-dialogflow-cxcomparev040v041-2020-12-02) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.4.0...v0.4.1)
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index e1acf8c8fef..e417bc286aa 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.4.0 + 0.4.1 From 09a0bd538f9ec76d5d0f2560409f09836e0bf046 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 7 Jan 2021 23:16:08 +0100 Subject: [PATCH 14/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.5.0 (#115) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | minor | `0.4.1` -> `0.5.0` | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.5.0`](https://togithub.com/googleapis/java-dialogflow-cx/blob/master/CHANGELOG.md#​050-httpswwwgithubcomgoogleapisjava-dialogflow-cxcomparev041v050-2020-12-15) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.4.1...v0.5.0) ##### Features - allowed custom to specify webhook headers through query parameters ([#​109](https://www.github.com/googleapis/java-dialogflow-cx/issues/109)) ([329b306](https://www.github.com/googleapis/java-dialogflow-cx/commit/329b306505d291dc9f7b3e9832adf20d0abc30a8)) ##### Bug Fixes - change location in IT to be 'global' ([#​103](https://www.github.com/googleapis/java-dialogflow-cx/issues/103)) ([4053872](https://www.github.com/googleapis/java-dialogflow-cx/commit/405387236262b9d04b074304f78f1cc1da4b662b)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.16.1 ([e0830ab](https://www.github.com/googleapis/java-dialogflow-cx/commit/e0830ab54843fce058aa9bdcf0e228e7c5b827fb)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.17.0 ([#​114](https://www.github.com/googleapis/java-dialogflow-cx/issues/114)) ([772e3e6](https://www.github.com/googleapis/java-dialogflow-cx/commit/772e3e616d169e7ca496d80a49b46d272169ada8)) ##### [0.4.1](https://www.github.com/googleapis/java-dialogflow-cx/compare/v0.4.0...v0.4.1) (2020-12-02) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.16.0 ([#​96](https://www.github.com/googleapis/java-dialogflow-cx/issues/96)) ([a3522ae](https://www.github.com/googleapis/java-dialogflow-cx/commit/a3522ae87ffdc09d26a6b97669b6bb2f86df5eb9))
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index e417bc286aa..24064d44ae4 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.4.1 + 0.5.0 From 17fbd89a1771ee18e6f91c46953d9b4b229c83b6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Feb 2021 19:04:23 +0100 Subject: [PATCH 15/73] test(deps): update dependency junit:junit to v4.13.2 (#140) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [junit:junit](http://junit.org) ([source](https://togithub.com/junit-team/junit4)) | `4.13.1` -> `4.13.2` | [![age](https://badges.renovateapi.com/packages/maven/junit:junit/4.13.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/junit:junit/4.13.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/junit:junit/4.13.2/compatibility-slim/4.13.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/junit:junit/4.13.2/confidence-slim/4.13.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 24064d44ae4..60ac462ba76 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -34,7 +34,7 @@ junit junit - 4.13.1 + 4.13.2 test From f6ba71a17d75b3053e3a34d1d19355729fbb3894 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 25 Feb 2021 01:28:08 +0100 Subject: [PATCH 16/73] test(deps): update dependency com.google.truth:truth to v1.1.2 (#128) --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 60ac462ba76..853e1e5eed7 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -40,7 +40,7 @@ com.google.truth truth - 1.1 + 1.1.2 test From c17d188168760314eff72739a80d4a3974942a15 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 25 Feb 2021 19:36:16 +0100 Subject: [PATCH 17/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.6.0 (#148) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.5.0` -> `0.6.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.6.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.6.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.6.0/compatibility-slim/0.5.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.6.0/confidence-slim/0.5.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.6.0`](https://togithub.com/googleapis/java-dialogflow-cx/blob/master/CHANGELOG.md#​060-httpswwwgithubcomgoogleapisjava-dialogflow-cxcomparev050v060-2021-02-25) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.5.0...v0.6.0) ##### Features - add experiment and security settings API docs: update comments on parameters and agent ([#​124](https://www.github.com/googleapis/java-dialogflow-cx/issues/124)) ([06ee69a](https://www.github.com/googleapis/java-dialogflow-cx/commit/06ee69ac49cdd2f0cc6316e7613d120434dfb65f)) - Add new Experiment service ([a79149b](https://www.github.com/googleapis/java-dialogflow-cx/commit/a79149b73f3c74b7d35ec230702fc9f61c2ede3b)) - added support for test cases and agent validation ([#​141](https://www.github.com/googleapis/java-dialogflow-cx/issues/141)) ([a79149b](https://www.github.com/googleapis/java-dialogflow-cx/commit/a79149b73f3c74b7d35ec230702fc9f61c2ede3b)) - Support transition route group coverage for Test Cases ([a79149b](https://www.github.com/googleapis/java-dialogflow-cx/commit/a79149b73f3c74b7d35ec230702fc9f61c2ede3b)) - supports SentimentAnalysisResult in webhook request ([a79149b](https://www.github.com/googleapis/java-dialogflow-cx/commit/a79149b73f3c74b7d35ec230702fc9f61c2ede3b)) ##### Bug Fixes - don't log downloads ([#​143](https://www.github.com/googleapis/java-dialogflow-cx/issues/143)) ([7cfb674](https://www.github.com/googleapis/java-dialogflow-cx/commit/7cfb6749ede7e7b01d606e83b6ac414466d23378)) - RunTestCase http template. PHP REST client lib can be generated ([a79149b](https://www.github.com/googleapis/java-dialogflow-cx/commit/a79149b73f3c74b7d35ec230702fc9f61c2ede3b)) - update repo name ([#​138](https://www.github.com/googleapis/java-dialogflow-cx/issues/138)) ([5a6c5d1](https://www.github.com/googleapis/java-dialogflow-cx/commit/5a6c5d127d298c4d3acd5fdf13839c17b9f64d08)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v0.19.0 ([#​127](https://www.github.com/googleapis/java-dialogflow-cx/issues/127)) ([0452e5c](https://www.github.com/googleapis/java-dialogflow-cx/commit/0452e5cc405d1fadf4d76f20d92db79375da7cd6)) ##### Documentation - fix languages link ([#​146](https://www.github.com/googleapis/java-dialogflow-cx/issues/146)) ([89f5b49](https://www.github.com/googleapis/java-dialogflow-cx/commit/89f5b49f8b973f626dbe76286b6cf8273d447837)) - generate sample code in the Java microgenerator ([a79149b](https://www.github.com/googleapis/java-dialogflow-cx/commit/a79149b73f3c74b7d35ec230702fc9f61c2ede3b)) - minor doc update on redact field in intent.proto and page.proto ([a79149b](https://www.github.com/googleapis/java-dialogflow-cx/commit/a79149b73f3c74b7d35ec230702fc9f61c2ede3b)) - minor updates in wording ([a79149b](https://www.github.com/googleapis/java-dialogflow-cx/commit/a79149b73f3c74b7d35ec230702fc9f61c2ede3b)) - test cases doc update ([a79149b](https://www.github.com/googleapis/java-dialogflow-cx/commit/a79149b73f3c74b7d35ec230702fc9f61c2ede3b))
--- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 853e1e5eed7..d78fd5253eb 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.5.0 + 0.6.0 From 5ea77f1d66ca27615172255df4b38b8d07aba0c2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 26 Feb 2021 02:18:08 +0100 Subject: [PATCH 18/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.6.1 (#154) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.6.0` -> `0.6.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.6.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.6.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.6.1/compatibility-slim/0.6.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.6.1/confidence-slim/0.6.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index d78fd5253eb..8cd104e5d8d 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.6.0 + 0.6.1 From c0226c14771c0cc923c0a145f4d65df6288f9619 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Apr 2021 19:52:32 +0200 Subject: [PATCH 19/73] chore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.22 (#172) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | com.google.cloud.samples:shared-configuration | `1.0.21` -> `1.0.22` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.0.22/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.0.22/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.0.22/compatibility-slim/1.0.21)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.0.22/confidence-slim/1.0.21)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 8cd104e5d8d..92225cd316b 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.21 + 1.0.22 From 50272604e6c679bd0c6dd98c05ad1135da4cbef7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 26 May 2021 22:58:13 +0200 Subject: [PATCH 20/73] test(deps): update dependency com.google.truth:truth to v1.1.3 (#223) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | com.google.truth:truth | `1.1.2` -> `1.1.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.truth:truth/1.1.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.truth:truth/1.1.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.truth:truth/1.1.3/compatibility-slim/1.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.truth:truth/1.1.3/confidence-slim/1.1.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 92225cd316b..19629ad87eb 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -40,7 +40,7 @@ com.google.truth truth - 1.1.2 + 1.1.3 test From d51efdb3cd4dd10e87dafd7c9b7c775be3ccc152 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Jun 2021 00:34:07 +0200 Subject: [PATCH 21/73] chore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.23 (#232) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | com.google.cloud.samples:shared-configuration | `1.0.22` -> `1.0.23` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.0.23/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.0.23/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.0.23/compatibility-slim/1.0.22)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.0.23/confidence-slim/1.0.22)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 19629ad87eb..f4beeb78a5e 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.22 + 1.0.23 From 15ba4c3d4c21bbd4fb878dce61182f9ac8b397d4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 17 Jun 2021 20:13:36 +0200 Subject: [PATCH 22/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.7.0 (#241) --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index f4beeb78a5e..c06078f0383 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.6.1 + 0.7.0 From bfb34d05caa059fae3c4984f75f10cfee4e0d146 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Jul 2021 18:14:48 +0200 Subject: [PATCH 23/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.8.0 (#251) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.7.0` -> `0.8.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.8.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.8.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.8.0/compatibility-slim/0.7.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.8.0/confidence-slim/0.7.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.8.0`](https://togithub.com/googleapis/java-dialogflow-cx/blob/master/CHANGELOG.md#​080-httpswwwgithubcomgoogleapisjava-dialogflow-cxcomparev070v080-2021-07-08) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.7.0...v0.8.0) ##### ⚠ BREAKING CHANGES - Set agent default language code as required ([#​238](https://togithub.com/googleapis/java-dialogflow-cx/issues/238)) ##### Features - add return_partial response to Fulfillment ([a3432ed](https://www.github.com/googleapis/java-dialogflow-cx/commit/a3432ed7f9364d21a9b0bfd5e605dbe9feade2ea)) - added API for running continuous test ([#​226](https://www.github.com/googleapis/java-dialogflow-cx/issues/226)) ([97f71ab](https://www.github.com/googleapis/java-dialogflow-cx/commit/97f71abf7b6ffc6ea89dfdfdf1e7a7a0c79a0590)) - mark agent.default_language_code as required ([#​246](https://www.github.com/googleapis/java-dialogflow-cx/issues/246)) ([a3432ed](https://www.github.com/googleapis/java-dialogflow-cx/commit/a3432ed7f9364d21a9b0bfd5e605dbe9feade2ea)) - Support partial response feature ([d14161e](https://www.github.com/googleapis/java-dialogflow-cx/commit/d14161eb59c050b0a612a9c1aab3bab5c2166581)) ##### Bug Fixes - Add `shopt -s nullglob` to dependencies script ([#​1130](https://www.github.com/googleapis/java-dialogflow-cx/issues/1130)) ([#​245](https://www.github.com/googleapis/java-dialogflow-cx/issues/245)) ([ae502ce](https://www.github.com/googleapis/java-dialogflow-cx/commit/ae502ce2ddf4b22e22261aafa576068ed9039d01)) - Set agent default language code as required ([#​238](https://www.github.com/googleapis/java-dialogflow-cx/issues/238)) ([d14161e](https://www.github.com/googleapis/java-dialogflow-cx/commit/d14161eb59c050b0a612a9c1aab3bab5c2166581)) ##### Documentation - add notes to train agent before sending queries ([a3432ed](https://www.github.com/googleapis/java-dialogflow-cx/commit/a3432ed7f9364d21a9b0bfd5e605dbe9feade2ea)) - added notes to train agent before sending queries ([#​244](https://www.github.com/googleapis/java-dialogflow-cx/issues/244)) ([dbbc03f](https://www.github.com/googleapis/java-dialogflow-cx/commit/dbbc03f917bb4970c2838a35c639385b7725bece)) - Update docs of Agents, Fulfillments, SecuritySettings and Sessions ([d14161e](https://www.github.com/googleapis/java-dialogflow-cx/commit/d14161eb59c050b0a612a9c1aab3bab5c2166581)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v1.3.0 ([#​229](https://www.github.com/googleapis/java-dialogflow-cx/issues/229)) ([06c8e0e](https://www.github.com/googleapis/java-dialogflow-cx/commit/06c8e0e9921916967e7d67174fc22016c42b925f)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#​247](https://www.github.com/googleapis/java-dialogflow-cx/issues/247)) ([1979783](https://www.github.com/googleapis/java-dialogflow-cx/commit/197978352a49a97440595e1ff3f03e2f06a6c3ad))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index c06078f0383..0265567e90a 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.7.0 + 0.8.0 From c8f3e2ffd2efdd3bbd313b97afe21a35c62c6242 Mon Sep 17 00:00:00 2001 From: Gal Zahavi <38544478+galz10@users.noreply.github.com> Date: Thu, 12 Aug 2021 13:26:19 -0700 Subject: [PATCH 24/73] samples: add update intent code sample (#275) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add update intent samples * Fixed lint * lint fix * lint fix * lint fix * lint fix * lint fix * lint fix * lint fix * fixed failing test * lint fix * failing test fix * Fix failing test * fixed fialing test * Added Agent Builder * removed unused builder * lint fix * lint fix * Fixed comments * Updated main * Lint fix * removed return type * Fix build error * added exception * fixed failing test * added missing include * Rebased * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../main/java/dialogflow/cx/UpdateIntent.java | 74 ++++++++++++++ .../java/dialogflow/cx/UpdateIntentTest.java | 99 +++++++++++++++++++ 2 files changed, 173 insertions(+) create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/UpdateIntent.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/UpdateIntentTest.java diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/UpdateIntent.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/UpdateIntent.java new file mode 100644 index 00000000000..73a87889880 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/UpdateIntent.java @@ -0,0 +1,74 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_update_intent] + +import com.google.cloud.dialogflow.cx.v3.Intent; +import com.google.cloud.dialogflow.cx.v3.Intent.Builder; +import com.google.cloud.dialogflow.cx.v3.IntentsClient; +import com.google.cloud.dialogflow.cx.v3.UpdateIntentRequest; +import com.google.protobuf.FieldMask; +import java.io.IOException; + +public class UpdateIntent { + + public static void main(String[] args) throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String agentId = "my-agent-id"; + String intentId = "my-intent-id"; + String location = "my-location"; + String displayName = "my-display-name"; + updateIntent(projectId, agentId, intentId, location, displayName); + } + + // DialogFlow API Update Intent sample. + public static void updateIntent( + String projectId, String agentId, String intentId, String location, String displayName) + throws IOException { + try (IntentsClient client = IntentsClient.create()) { + String intentPath = + "projects/" + + projectId + + "/locations/" + + location + + "/agents/" + + agentId + + "/intents/" + + intentId; + + Builder intentBuilder = client.getIntent(intentPath).toBuilder(); + + intentBuilder.setDisplayName(displayName); + FieldMask fieldMask = FieldMask.newBuilder().addPaths("display_name").build(); + + Intent intent = intentBuilder.build(); + UpdateIntentRequest request = + UpdateIntentRequest.newBuilder() + .setIntent(intent) + .setLanguageCode("en") + .setUpdateMask(fieldMask) + .build(); + + // Make API request to update intent using fieldmask + Intent response = client.updateIntent(request); + System.out.println(response); + } + } +} +// [END dialogflow_cx_update_intent] diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/UpdateIntentTest.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/UpdateIntentTest.java new file mode 100644 index 00000000000..bb210fa2dc4 --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/UpdateIntentTest.java @@ -0,0 +1,99 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.dialogflow.cx.v3.Agent; +import com.google.cloud.dialogflow.cx.v3.Agent.Builder; +import com.google.cloud.dialogflow.cx.v3.AgentsClient; +import com.google.cloud.dialogflow.cx.v3.AgentsSettings; +import com.google.cloud.dialogflow.cx.v3.Intent; +import com.google.cloud.dialogflow.cx.v3.IntentsClient; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.UUID; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class UpdateIntentTest { + + private static String PROJECT_ID = System.getenv().get("GOOGLE_CLOUD_PROJECT"); + private static String parent = ""; + private static String intentID = ""; + private static String intentPath = ""; + private static String agentID = ""; + + private ByteArrayOutputStream stdOut; + + @Before + public void setUp() throws IOException { + + stdOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(stdOut)); + + Builder build = Agent.newBuilder(); + build.setDefaultLanguageCode("en"); + build.setDisplayName("temp_agent_" + UUID.randomUUID().toString()); + build.setTimeZone("America/Los_Angeles"); + + Agent agent = build.build(); + + String apiEndpoint = "global-dialogflow.googleapis.com:443"; + String parentPath = "projects/" + PROJECT_ID + "/locations/global"; + + AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); + AgentsClient client = AgentsClient.create(agentsSettings); + + parent = client.createAgent(parentPath, agent).getName(); + UpdateIntentTest.agentID = parent.split("/")[5]; + + try (IntentsClient intentsClient = IntentsClient.create()) { + com.google.cloud.dialogflow.cx.v3.Intent.Builder intent = Intent.newBuilder(); + intent.setDisplayName("temp_intent_" + UUID.randomUUID().toString()); + + UpdateIntentTest.intentPath = intentsClient.createIntent(parent, intent.build()).getName(); + UpdateIntentTest.intentID = UpdateIntentTest.intentPath.split("/")[7]; + } + } + + @After + public void tearDown() throws IOException { + stdOut = null; + System.setOut(null); + String apiEndpoint = "global-dialogflow.googleapis.com:443"; + String parentPath = "projects/" + PROJECT_ID + "/locations/global"; + + AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); + AgentsClient client = AgentsClient.create(agentsSettings); + + client.deleteAgent(parent); + } + + @Test + public void testUpdateIntent() throws IOException { + + String fakeIntent = "fake_intent_" + UUID.randomUUID().toString(); + + UpdateIntent.updateIntent( + PROJECT_ID, UpdateIntentTest.agentID, UpdateIntentTest.intentID, "global", fakeIntent); + + assertThat(stdOut.toString()).contains(fakeIntent); + } +} From c5c6e7c59a9ff0525f095ae3ccf5efcaae1e2d55 Mon Sep 17 00:00:00 2001 From: Gal Zahavi <38544478+galz10@users.noreply.github.com> Date: Mon, 23 Aug 2021 09:57:55 -0700 Subject: [PATCH 25/73] samples: add create agent code sample (#279) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * samples: add create agent code sample * Lint fix * Fix failing test * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Rebased * Revised Code per comments * lint fix * Added Comment for timezone * Fixed lint * Used String.format * Added stdOut Var * removed parent variable * Update Tests * lint fix * removed parentPath * removed unreachable statemt * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Revised Code Per Comments * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../main/java/dialogflow/cx/CreateAgent.java | 62 ++++++++++++++++++ .../java/dialogflow/cx/CreateAgentIT.java | 64 +++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateAgent.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateAgentIT.java diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateAgent.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateAgent.java new file mode 100644 index 00000000000..2ab019c1e9c --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateAgent.java @@ -0,0 +1,62 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_create_agent] + +import com.google.cloud.dialogflow.cx.v3.Agent; +import com.google.cloud.dialogflow.cx.v3.Agent.Builder; +import com.google.cloud.dialogflow.cx.v3.AgentsClient; +import com.google.cloud.dialogflow.cx.v3.AgentsSettings; +import java.io.IOException; + +public class CreateAgent { + + public static void main(String[] args) throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String displayName = "my-display-name"; + + createAgent(projectId, displayName); + } + + public static Agent createAgent(String parent, String displayName) throws IOException { + + String apiEndpoint = "global-dialogflow.googleapis.com:443"; + + AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); + try (AgentsClient client = AgentsClient.create(agentsSettings)) { + // Set the details of the Agent to create + Builder build = Agent.newBuilder(); + + build.setDefaultLanguageCode("en"); + build.setDisplayName(displayName); + // Correct format for timezone is location/city + // For example America/Los_Angeles, Europe/Madrid, Asia/Tokyo + build.setTimeZone("America/Los_Angeles"); + + Agent agent = build.build(); + String parentPath = String.format("projects/%s/locations/%s", parent, "global"); + + // Calls the create agent api and returns the created Agent + Agent response = client.createAgent(parentPath, agent); + System.out.println(response); + return response; + } + } +} +// [END dialogflow_cx_create_agent] diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateAgentIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateAgentIT.java new file mode 100644 index 00000000000..b479c0eb876 --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateAgentIT.java @@ -0,0 +1,64 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.dialogflow.cx.v3.AgentsClient; +import com.google.cloud.dialogflow.cx.v3.AgentsSettings; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.UUID; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class CreateAgentIT { + + private static String PROJECT_ID = System.getenv().get("GOOGLE_CLOUD_PROJECT"); + private static String agentPath = ""; + private ByteArrayOutputStream stdOut; + private static PrintStream originalOut; + + @Before + public void setUp() throws IOException { + originalOut = System.out; + stdOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(stdOut)); + } + + @After + public void tearDown() throws IOException { + System.setOut(originalOut); + String apiEndpoint = "global-dialogflow.googleapis.com:443"; + + AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); + AgentsClient client = AgentsClient.create(agentsSettings); + + client.deleteAgent(CreateAgentIT.agentPath); + } + + @Test + public void testCreateAgent() throws IOException { + String fakeAgent = String.format("fake_agent_%s", UUID.randomUUID().toString()); + + CreateAgentIT.agentPath = CreateAgent.createAgent(PROJECT_ID, fakeAgent).getName(); + + assertThat(stdOut.toString()).contains(fakeAgent); + } +} From 5f69721fd3f7981726fc8bad620e727f7dcbf7af Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 14 Sep 2021 05:19:51 +0200 Subject: [PATCH 26/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.9.0 (#285) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.9.0 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Emily Ball --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 0265567e90a..35e64564e97 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.8.0 + 0.9.0 From fd7d74c66329c8183a8a33304a6cc14e6f645879 Mon Sep 17 00:00:00 2001 From: Gal Zahavi <38544478+galz10@users.noreply.github.com> Date: Tue, 14 Sep 2021 16:38:07 -0700 Subject: [PATCH 27/73] samples: add page management code samples (#300) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * samples: add page management code samples * Lint Fix * Lint Fix * lint fix * lint fix * failing test fix * Failing Test Fix * change private to public for agentID * lint fix * lint fix * lint fix * Failing Test Fix * failing test fix * fix lint * called getName instead of name for page * Failing test fix * added parameters to variables * Added return type to create page * lint fix * Fixed failing test * Fix java failing tests * fix test * Test Fix * test fix * changed to afterall beforeall * Changed before and after all * Lint fix * test fail fix * lint fix * chagned stdout to static * failing test fix * added stdout setup * removed loop * updated list tests * lint fix * moved stdout * Added return type to listpage * lint fix * changed list test * update test * lint fix * lint fix * Fix testListPage * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Revised code per comments * Lint fix * CreateSimplePage builder import fix * CreateSimplePage test fix * moved region tags * Revised code per commments * lint fix * Returned response * changed testListPage * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * removed results string Co-authored-by: Owl Bot --- .../java/dialogflow/cx/CreateSimplePage.java | 69 ++++++++++++ .../main/java/dialogflow/cx/DeletePage.java | 64 +++++++++++ .../main/java/dialogflow/cx/ListPages.java | 62 +++++++++++ .../java/dialogflow/cx/PageManagementIT.java | 105 ++++++++++++++++++ 4 files changed, 300 insertions(+) create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateSimplePage.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/DeletePage.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListPages.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/PageManagementIT.java diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateSimplePage.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateSimplePage.java new file mode 100644 index 00000000000..e18b60eeb98 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateSimplePage.java @@ -0,0 +1,69 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_create_page] +import com.google.cloud.dialogflow.cx.v3.CreatePageRequest; +import com.google.cloud.dialogflow.cx.v3.Page; +import com.google.cloud.dialogflow.cx.v3.PagesClient; +import java.io.IOException; + +public class CreateSimplePage { + + public static void main(String[] args) throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String agentId = "my-agent-id"; + String flowId = "my-flow-id"; + String location = "my-location"; + String displayName = "my-display-name"; + + createPage(projectId, agentId, flowId, location, displayName); + } + + // DialogFlow API Create Page Sample. + // Creates a page from the provided parameters + public static Page createPage( + String projectId, String agentId, String flowId, String location, String displayName) + throws IOException { + Page response; + CreatePageRequest.Builder createRequestBuilder = CreatePageRequest.newBuilder(); + Page.Builder pageBuilder = Page.newBuilder(); + + pageBuilder.setDisplayName(displayName); + + createRequestBuilder + .setParent( + "projects/" + + projectId + + "/locations/" + + location + + "/agents/" + + agentId + + "/flows/" + + flowId) + .setPage(pageBuilder); + + // Make API request to create page + try (PagesClient client = PagesClient.create()) { + response = client.createPage(createRequestBuilder.build()); + System.out.println("Successfully created page!"); + return response; + } + } + // [END dialogflow_cx_create_page] +} diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DeletePage.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DeletePage.java new file mode 100644 index 00000000000..98bd5e1fdea --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DeletePage.java @@ -0,0 +1,64 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_delete_page] +import com.google.cloud.dialogflow.cx.v3.DeletePageRequest; +import com.google.cloud.dialogflow.cx.v3.DeletePageRequest.Builder; +import com.google.cloud.dialogflow.cx.v3.PagesClient; +import java.io.IOException; + +public class DeletePage { + + public static void main(String[] args) throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String agentId = "my-agent-id"; + String flowId = "my-flow-id"; + String pageId = "my-page-id"; + String location = "my-location"; + + deletePage(projectId, agentId, flowId, pageId, location); + } + + // DialogFlow API Delete Page Sample. + // Deletes a page from the provided parameters + public static void deletePage( + String projectId, String agentId, String flowId, String pageId, String location) + throws IOException { + try (PagesClient client = PagesClient.create()) { + Builder deleteRequestBuilder = DeletePageRequest.newBuilder(); + + deleteRequestBuilder.setName( + "projects/" + + projectId + + "/locations/" + + location + + "/agents/" + + agentId + + "/flows/" + + flowId + + "/pages/" + + pageId); + + // Make API request to delete page + client.deletePage(deleteRequestBuilder.build()); + System.out.println("Successfully deleted page!"); + } + } + // [END dialogflow_cx_delete_page] +} diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListPages.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListPages.java new file mode 100644 index 00000000000..f935b638911 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListPages.java @@ -0,0 +1,62 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_list_pages] +import com.google.cloud.dialogflow.cx.v3.ListPagesRequest; +import com.google.cloud.dialogflow.cx.v3.ListPagesRequest.Builder; +import com.google.cloud.dialogflow.cx.v3.Page; +import com.google.cloud.dialogflow.cx.v3.PagesClient; +import java.io.IOException; + +public class ListPages { + + public static void main(String[] args) throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String agentId = "my-agent-id"; + String flowId = "my-flow-id"; + String location = "my-location"; + + listPages(projectId, agentId, flowId, location); + } + + // DialogFlow API List Pages Sample. + // Lists all pages from the provided parameters + public static void listPages(String projectId, String agentId, String flowId, String location) + throws IOException { + PagesClient client = PagesClient.create(); + Builder listRequestBuilder = ListPagesRequest.newBuilder(); + + listRequestBuilder.setParent( + "projects/" + + projectId + + "/locations/" + + location + + "/agents/" + + agentId + + "/flows/" + + flowId); + listRequestBuilder.setLanguageCode("en"); + + // Make API request to list all pages in the project + for (Page element : client.listPages(listRequestBuilder.build()).iterateAll()) { + System.out.println(element); + } + } + // [END dialogflow_cx_list_pages] +} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/PageManagementIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/PageManagementIT.java new file mode 100644 index 00000000000..d0e8fac930a --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/PageManagementIT.java @@ -0,0 +1,105 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.dialogflow.cx.v3.Agent; +import com.google.cloud.dialogflow.cx.v3.Agent.Builder; +import com.google.cloud.dialogflow.cx.v3.AgentsClient; +import com.google.cloud.dialogflow.cx.v3.AgentsSettings; +import com.google.cloud.dialogflow.cx.v3.Page; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.UUID; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +/** Integration (system) tests for {@link PageManagment}. */ +public class PageManagementIT { + + private static String PROJECT_ID = System.getenv().get("GOOGLE_CLOUD_PROJECT"); + private static String flowID = "00000000-0000-0000-0000-000000000000"; + private static String location = "global"; + private static String displayName = "temp_page_" + UUID.randomUUID().toString(); + private static String parent; + private static String agentID; + private static String pageID; + private static ByteArrayOutputStream stdOut; + + @BeforeClass + public static void setUp() throws IOException { + stdOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(stdOut)); + Builder build = Agent.newBuilder(); + build.setDefaultLanguageCode("en"); + build.setDisplayName("temp_agent_" + UUID.randomUUID().toString()); + build.setTimeZone("America/Los_Angeles"); + + Agent agent = build.build(); + + String apiEndpoint = "global-dialogflow.googleapis.com:443"; + String parentPath = "projects/" + PROJECT_ID + "/locations/global"; + + AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); + AgentsClient client = AgentsClient.create(agentsSettings); + + parent = client.createAgent(parentPath, agent).getName(); + agentID = parent.split("/")[5]; + } + + @AfterClass + public static void tearDown() throws IOException { + String apiEndpoint = "global-dialogflow.googleapis.com:443"; + String parentPath = "projects/" + PROJECT_ID + "/locations/global"; + + AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); + AgentsClient client = AgentsClient.create(agentsSettings); + + client.deleteAgent(parent); + } + + @Test + public void testCreatePage() throws IOException { + Page p = CreateSimplePage.createPage(PROJECT_ID, agentID, flowID, location, displayName); + pageID = p.getName().split("/")[9]; + + assertThat(p.getDisplayName()).isEqualTo(displayName); + } + + @Test + public void testListPages() throws IOException { + String name = "temp_page_" + UUID.randomUUID().toString(); + + Page p = CreateSimplePage.createPage(PROJECT_ID, agentID, flowID, location, name); + + ListPages.listPages(PROJECT_ID, agentID, flowID, location); + assertThat(stdOut.toString()).contains(name); + } + + @Test + public void testDeletePage() throws IOException { + try { + DeletePage.deletePage(PROJECT_ID, agentID, flowID, pageID, location); + assertThat(1).isEqualTo(1); + } catch (Exception e) { + assertThat(e).isEqualTo(""); + } + } +} From faf1b042c02ee1ab8787be8df3f6c7b77c395e7d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 27 Sep 2021 23:04:24 +0200 Subject: [PATCH 28/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.10.0 (#314) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.9.0` -> `0.10.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.10.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.10.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.10.0/compatibility-slim/0.9.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.10.0/confidence-slim/0.9.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.10.0`](https://togithub.com/googleapis/java-dialogflow-cx/blob/master/CHANGELOG.md#​0100-httpswwwgithubcomgoogleapisjava-dialogflow-cxcomparev090v0100-2021-09-15) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.9.0...v0.10.0) ##### Features - Remove use of deprecated gradle command in java README ([#​1196](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/1196)) ([#​295](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/295)) ([886ff84](https://www.github.com/googleapis/java-dialogflow-cx/commit/886ff84dcd53330e2593439c26f2caf51702c4ac)) ##### Documentation - clarified some LRO types docs: fixed some wrong update mask descriptions ([#​296](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/296)) ([fcb3c26](https://www.github.com/googleapis/java-dialogflow-cx/commit/fcb3c2618dfdda7f6b994c7ca129dc604e1ef173)) - clarified some LRO types docs: fixed some wrong update mask descriptions ([#​298](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/298)) ([2095640](https://www.github.com/googleapis/java-dialogflow-cx/commit/20956402f7dee061d9267162810182d656975a1b)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.1.0 ([#​291](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/291)) ([64a0ae9](https://www.github.com/googleapis/java-dialogflow-cx/commit/64a0ae9a877de8e0850f427bc1f7a2066fb6fb5b)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.0 ([#​299](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/299)) ([ad04d9f](https://www.github.com/googleapis/java-dialogflow-cx/commit/ad04d9fcfaec30834119f6429e2fa8f19130e450)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.2.1 ([#​309](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/309)) ([d6fd1bb](https://www.github.com/googleapis/java-dialogflow-cx/commit/d6fd1bbb65b07215c93bfe558a1f8f611330f1c5))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 35e64564e97..287afa19b4c 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.9.0 + 0.10.0 From 7bce2b7c9f7f470c489446b9c4bc3fd9b31f3fb0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 28 Sep 2021 22:58:47 +0200 Subject: [PATCH 29/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.10.1 (#324) --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 287afa19b4c..5fc006bd103 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.10.0 + 0.10.1 From 627b481e89eb342715fecd999cabc05f47411f98 Mon Sep 17 00:00:00 2001 From: Gal Zahavi <38544478+galz10@users.noreply.github.com> Date: Wed, 6 Oct 2021 13:02:29 -0700 Subject: [PATCH 30/73] samples: added list testcase result sample (#315) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * samples: added list testcase result sample * Added agent ids * Lint fix * lint fix * lint fix * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../dialogflow/cx/ListTestCaseResults.java | 67 +++++++++++++++++++ .../dialogflow/cx/ListTestCaseResultsIT.java | 55 +++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTestCaseResults.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTestCaseResultsIT.java diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTestCaseResults.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTestCaseResults.java new file mode 100644 index 00000000000..3519c5c983c --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTestCaseResults.java @@ -0,0 +1,67 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_list_testcase_result_sample] + +import com.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest; +import com.google.cloud.dialogflow.cx.v3.ListTestCaseResultsRequest.Builder; +import com.google.cloud.dialogflow.cx.v3.TestCaseResult; +import com.google.cloud.dialogflow.cx.v3.TestCasesClient; +import com.google.cloud.dialogflow.cx.v3.TestCasesSettings; +import java.io.IOException; + +public class ListTestCaseResults { + + public static void main(String[] args) throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String agentId = "my-agent-id"; + String testId = "my-test-id"; + String location = "my-location"; + listTestCaseResults(projectId, agentId, testId, location); + } + + public static void listTestCaseResults( + String projectId, String agentId, String testId, String location) throws IOException { + String parent = + "projects/" + + projectId + + "/locations/" + + location + + "/agents/" + + agentId + + "/testCases/" + + testId; + + Builder req = ListTestCaseResultsRequest.newBuilder(); + + req.setParent(parent); + req.setFilter("environment=draft"); + + TestCasesSettings testCasesSettings = + TestCasesSettings.newBuilder() + .setEndpoint(location + "-dialogflow.googleapis.com:443") + .build(); + TestCasesClient client = TestCasesClient.create(testCasesSettings); + + for (TestCaseResult element : client.listTestCaseResults(req.build()).iterateAll()) { + System.out.println(element); + } + } +} +// [END dialogflow_cx_list_testcase_result_sample] diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTestCaseResultsIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTestCaseResultsIT.java new file mode 100644 index 00000000000..57a7fd32c7c --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTestCaseResultsIT.java @@ -0,0 +1,55 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class ListTestCaseResultsIT { + + private static String PROJECT_ID = System.getenv().get("GOOGLE_CLOUD_PROJECT"); + private static String agentId = "1499b8e1-ab7d-43fd-9b08-30ee57194fc1"; + private static String testId = "694a5447-6c40-4752-944e-e3e70580b273"; + private static String location = "global"; + + private ByteArrayOutputStream stdOut; + private static PrintStream originalOut; + + @Before + public void setUp() throws IOException { + originalOut = System.out; + stdOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(stdOut)); + } + + @After + public void tearDown() throws IOException { + System.setOut(originalOut); + } + + @Test + public void testListTestCaseResults() throws IOException { + ListTestCaseResults.listTestCaseResults(PROJECT_ID, agentId, testId, location); + assertThat(stdOut.toString()).contains(testId); + } +} From 0b965f023b0e830d050c46f455f8326d414d9885 Mon Sep 17 00:00:00 2001 From: Gal Zahavi <38544478+galz10@users.noreply.github.com> Date: Thu, 14 Oct 2021 15:20:40 -0700 Subject: [PATCH 31/73] samples: add voice selection (#333) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * samples: add voice selection * added imports * add ssmlvoicegender * lint fix * lint fix * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Added comments * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../dialogflow/cx/DetectIntentStream.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java index 125581c83e0..b09609aea45 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java @@ -23,13 +23,18 @@ import com.google.cloud.dialogflow.cx.v3beta1.AudioEncoding; import com.google.cloud.dialogflow.cx.v3beta1.AudioInput; import com.google.cloud.dialogflow.cx.v3beta1.InputAudioConfig; +import com.google.cloud.dialogflow.cx.v3beta1.OutputAudioConfig; +import com.google.cloud.dialogflow.cx.v3beta1.OutputAudioEncoding; import com.google.cloud.dialogflow.cx.v3beta1.QueryInput; import com.google.cloud.dialogflow.cx.v3beta1.QueryResult; import com.google.cloud.dialogflow.cx.v3beta1.SessionName; import com.google.cloud.dialogflow.cx.v3beta1.SessionsClient; import com.google.cloud.dialogflow.cx.v3beta1.SessionsSettings; +import com.google.cloud.dialogflow.cx.v3beta1.SsmlVoiceGender; import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest; import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse; +import com.google.cloud.dialogflow.cx.v3beta1.SynthesizeSpeechConfig; +import com.google.cloud.dialogflow.cx.v3beta1.VoiceSelectionParams; import com.google.protobuf.ByteString; import java.io.FileInputStream; import java.io.IOException; @@ -78,11 +83,33 @@ public static void detectIntentStream( BidiStream bidiStream = sessionsClient.streamingDetectIntentCallable().call(); + // Specify sssml name and gender + VoiceSelectionParams voiceSelection = + // Voices that are available https://cloud.google.com/text-to-speech/docs/voices + VoiceSelectionParams.newBuilder() + .setName("en-GB-Standard-A") + .setSsmlGender(SsmlVoiceGender.SSML_VOICE_GENDER_FEMALE) + .build(); + + SynthesizeSpeechConfig speechConfig = + SynthesizeSpeechConfig.newBuilder().setVoice(voiceSelection).build(); + + // Setup audio config + OutputAudioConfig audioConfig = + // Output enconding explanation + // https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#outputaudioencoding + OutputAudioConfig.newBuilder() + .setAudioEncoding(OutputAudioEncoding.OUTPUT_AUDIO_ENCODING_UNSPECIFIED) + .setAudioEncodingValue(1) + .setSynthesizeSpeechConfig(speechConfig) + .build(); + // The first request must **only** contain the audio configuration: bidiStream.send( StreamingDetectIntentRequest.newBuilder() .setSession(session.toString()) .setQueryInput(queryInput) + .setOutputAudioConfig(audioConfig) .build()); try (FileInputStream audioStream = new FileInputStream(audioFilePath)) { From 4b252099125c06d7e3a6465eac931b97f1432462 Mon Sep 17 00:00:00 2001 From: Franklin Nunez <69214580+b-loved-dreamer@users.noreply.github.com> Date: Fri, 15 Oct 2021 12:19:11 -0700 Subject: [PATCH 32/73] docs(samples): adds list training phrases sample (#336) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(samples): adds list training phrases sample * docs(samples): removed testing resources * docs(samples): removed testing resources * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../dialogflow/cx/ListTrainingPhrases.java | 62 +++++++++++++++++++ .../cx/ListTrainingPhrasesTest.java | 53 ++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTrainingPhrases.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTrainingPhrasesTest.java diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTrainingPhrases.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTrainingPhrases.java new file mode 100644 index 00000000000..2bd0e73ae9e --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTrainingPhrases.java @@ -0,0 +1,62 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_list_training_phrases] +import com.google.cloud.dialogflow.cx.v3.GetIntentRequest; +import com.google.cloud.dialogflow.cx.v3.Intent; +import com.google.cloud.dialogflow.cx.v3.IntentName; +import com.google.cloud.dialogflow.cx.v3.IntentsClient; +import java.io.IOException; +import java.util.List; + +public class ListTrainingPhrases { + public static void main(String[] args) throws IOException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String location = "location"; + String agentId = "my-agent-id"; + String intentId = "my-intent-id"; + + listTrainingPhrases(projectId, location, agentId, intentId); + } + + // DialogFlow API List Training Phrases sample. + public static void listTrainingPhrases( + String projectId, String location, String agentId, String intentId) throws IOException { + try (IntentsClient client = IntentsClient.create()) { + // Set the intent name + IntentName name = IntentName.of(projectId, location, agentId, intentId); + + // Compose the get-intent request + GetIntentRequest request = GetIntentRequest.newBuilder().setName(name.toString()).build(); + + // Make API request to get intent + Intent response = client.getIntent(request); + + // Loop through the results + for (Intent.TrainingPhrase phrase : response.getTrainingPhrasesList()) { + System.out.println("***********************************************"); + List parts = phrase.getPartsList(); + for (Intent.TrainingPhrase.Part part : parts) { + System.out.println(String.format("Training Phrase: %s", part.getText())); + } + } + } + } +} +// [END dialogflow_list_training_phrases] diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTrainingPhrasesTest.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTrainingPhrasesTest.java new file mode 100644 index 00000000000..e3389ed166c --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTrainingPhrasesTest.java @@ -0,0 +1,53 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +public class ListTrainingPhrasesTest { + private static String PROJECT_ID = System.getenv().get("GOOGLE_CLOUD_PROJECT"); + private static String LOCATION = "global"; + private static String AGENT_ID = "b8d0e85d-0741-4e6d-a66a-3671184b7b93"; + private static String INTENT_ID = "45974f75-9412-445a-9863-47bfdfa3d96d"; + + private ByteArrayOutputStream stdOut; + + @Before + public void setUp() throws IOException { + stdOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(stdOut)); + } + + @After + public void tearDown() throws IOException { + stdOut = null; + System.setOut(null); + } + + @Test + public void testListTrainingPhrases() throws IOException { + ListTrainingPhrases.listTrainingPhrases(PROJECT_ID, LOCATION, AGENT_ID, INTENT_ID); + assertThat(stdOut.toString()).contains("green"); + } +} From 2cf13226bd0b150a4e60287dbf7cdae9147335df Mon Sep 17 00:00:00 2001 From: Gal Zahavi <38544478+galz10@users.noreply.github.com> Date: Thu, 11 Nov 2021 10:28:08 -0800 Subject: [PATCH 33/73] samples: added webhook sample (#313) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * samples: added webhook sample * fixed lint * added cloud function dependecy * moved cloud function dependecy * changed pom file * moved maven dependency * changed dependecy * added scope * added mocks * added dependency * Added plugin * Orginized code * modified pom file * removed httprequest from test * added to poms * Changed test to include functions * removed scope * change cloud function version * reverted version * changed cloud function version to 1.0.4 * added dependency to more pom files * added plugin * removed dependency from install-wo-bom * removed plugin * added dependency * added plugin * Added Dependency to samples pom file * lint fix * changed dependencies * Added Dependencies * added dependency * lint fix * lint fix * removed dependency * removed dependency * added snapshot dependency * samples: added webhook sample * fixed lint * added cloud function dependecy * moved cloud function dependecy * changed pom file * moved maven dependency * changed dependecy * added scope * added mocks * added dependency * Added plugin * Orginized code * modified pom file * removed httprequest from test * added to poms * Changed test to include functions * removed scope * change cloud function version * reverted version * changed cloud function version to 1.0.4 * added dependency to more pom files * added plugin * removed dependency from install-wo-bom * removed plugin * added dependency * added plugin * Added Dependency to samples pom file * lint fix * changed dependencies * Added Dependencies * added dependency * lint fix * lint fix * removed dependency * removed dependency * added snapshot dependency * Add debugging flags * debug * debug * Update build.sh * Update build.sh * Update build.sh * Update build.sh * Update build.sh * Update build.sh * Update build.sh * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update pom.xml add the closing magic tag Co-authored-by: averikitsch Co-authored-by: Owl Bot Co-authored-by: Les Vogel --- dialogflow-cx/snippets/pom.xml | 23 +++++- .../src/main/java/dialogflow/cx/Example.java | 67 +++++++++++++++++ .../test/java/dialogflow/cx/ExampleIT.java | 72 +++++++++++++++++++ 3 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/Example.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExampleIT.java diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 5fc006bd103..a1f8bc350ed 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -30,13 +30,34 @@ google-cloud-dialogflow-cx 0.10.1 - + + com.google.code.gson + gson + 2.8.7 + + + com.google.cloud.functions + functions-framework-api + 1.0.4 + junit junit 4.13.2 test + + com.google.cloud.functions + function-maven-plugin + 0.9.7 + test + + + org.mockito + mockito-core + 3.12.4 + test + com.google.truth truth diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/Example.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/Example.java new file mode 100644 index 00000000000..f91c8362a4a --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/Example.java @@ -0,0 +1,67 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_webhook] + +// TODO: add GSON dependency to Pom file +// (https://mvnrepository.com/artifact/com.google.code.gson/gson/2.8.5) +// TODO: Uncomment the line bellow before running cloud function +// package com.example; + +import com.google.cloud.functions.HttpFunction; +import com.google.cloud.functions.HttpRequest; +import com.google.cloud.functions.HttpResponse; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import java.io.BufferedWriter; + +public class Example implements HttpFunction { + + public void service(HttpRequest request, HttpResponse response) throws Exception { + JsonParser parser = new JsonParser(); + Gson gson = new GsonBuilder().create(); + + JsonObject job = gson.fromJson(request.getReader(), JsonObject.class); + String str = job.getAsJsonObject("fulfillmentInfo").getAsJsonPrimitive("tag").toString(); + JsonObject o = null; + String a = '"' + "Default Welcome Intent" + '"'; + String b = '"' + "get-agent-name" + '"'; + String responseText = ""; + + if (str.equals(a)) { + responseText = '"' + "Hello from a Java GCF Webhook" + '"'; + } else if (str.equals(b)) { + responseText = '"' + "My name is Flowhook" + '"'; + } else { + responseText = '"' + "Sorry I didn't get that" + '"'; + } + + o = + parser + .parse( + "{ \"fulfillment_response\": { \"messages\": [ { \"text\": { \"text\": [" + + responseText + + "] } } ] } }") + .getAsJsonObject(); + BufferedWriter writer = response.getWriter(); + writer.write(o.toString()); + } +} +// [END dialogflow_webhook] diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExampleIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExampleIT.java new file mode 100644 index 00000000000..a62338c1772 --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExampleIT.java @@ -0,0 +1,72 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.when; + +import com.google.cloud.functions.HttpRequest; +import com.google.cloud.functions.HttpResponse; +import com.google.gson.Gson; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +public class ExampleIT { + + @Mock private HttpRequest request; + @Mock private HttpResponse response; + + private BufferedWriter writerOut; + private StringWriter responseOut; + private static final Gson gson = new Gson(); + + @Before + public void beforeTest() throws IOException { + MockitoAnnotations.initMocks(this); + + // use an empty string as the default request content + BufferedReader reader = new BufferedReader(new StringReader("")); + when(request.getReader()).thenReturn(reader); + + responseOut = new StringWriter(); + writerOut = new BufferedWriter(responseOut); + when(response.getWriter()).thenReturn(writerOut); + } + + @Test + public void helloHttp_bodyParamsPost() throws IOException, Exception { + + String firstHalf = "{\fulfillmentInfo\": {\"tag\": \"Default Welcome Intent\",}"; + String secondHalf = ",\"text\": \"hi\",\"languageCode\": \"en\",}"; + + BufferedReader jsonReader = new BufferedReader(new StringReader(firstHalf + secondHalf)); + + when(request.getReader()).thenReturn(jsonReader); + + new Example().service(request, response); + writerOut.flush(); + + assertThat(responseOut.toString()).contains("Hello from a Java GCF Webhook"); + } +} From 153ae09ca8c225b160acc8dfd6c445a1680cd40b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 15 Nov 2021 17:02:11 +0100 Subject: [PATCH 34/73] test(deps): update dependency org.mockito:mockito-core to v4 (#359) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `3.12.4` -> `4.0.0` | [![age](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.0.0/compatibility-slim/3.12.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.0.0/confidence-slim/3.12.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
mockito/mockito ### [`v4.0.0`](https://togithub.com/mockito/mockito/releases/v4.0.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v3.12.4...v4.0.0) ### Mockito 4: Removing deprecated APIs. All of these APIs have been marked as deprecated and have been present in Mockito for quite a while. An overview of now-deleted classes/methods: - `org.mockito.Matchers` which was an alias for `org.mockito.ArgumentMatchers` - `org.mockito.ArgumentMatchers#{anyObject,anyVararg}` both which were aliases for `org.mockito.ArgumentMatchers#any` - `org.mockito.ArgumentMatchers#any*Of`, which were aliases for the same method name without the Of and the generic parameters (which were ignored) - `org.mockito.ArgumentMatchers#{is}{Not}Null(Class)` which took a class which was ignored. Aliases for the same methods without the parameter - `org.mockito.MockedStatic#verify` which had the parameter types reversed - `org.mockito.Mockito#verifyZeroInteractions` an alias of `verifyNoMoreInteractions` - `org.mockito.Mockito#debug` framework integration API that we later refactored - `org.mockito.configuration.AnnotationEngine` which was leaking internal APIs and instead users should use `org.mockito.plugins.AnnotationEngine` - `org.mockito.exceptions.verification.TooLittleActualInvocations` fixed the grammar from "Little" to "Few" - Numerous internal APIs that we never officially supported and can now remove - `org.mockito.plugins.InstantiatorProvider` which was leaking internal APIs and instead users should use InstantiatorProvider2 (we should probably rename back to remove the number in a future major release) - `org.mockito.runners` a package that hosted several old JUnit runners which were no longer supported. Users should instead use `org.mockito.junit.MockitoJUnitRunner` which is our official JUnit4 runner.
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index a1f8bc350ed..4c4626d39b6 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -55,7 +55,7 @@ org.mockito mockito-core - 3.12.4 + 4.0.0 test From 20c3074d35008815b26ca3fb2a71c487f58114f5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 15 Nov 2021 17:04:25 +0100 Subject: [PATCH 35/73] deps: update dependency com.google.cloud.functions:function-maven-plugin to v0.10.0 (#358) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud.functions:function-maven-plugin](http://maven.apache.org) ([source](https://togithub.com/GoogleCloudPlatform/functions-framework-java)) | `0.9.7` -> `0.10.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud.functions:function-maven-plugin/0.10.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud.functions:function-maven-plugin/0.10.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud.functions:function-maven-plugin/0.10.0/compatibility-slim/0.9.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud.functions:function-maven-plugin/0.10.0/confidence-slim/0.9.7)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 4c4626d39b6..6a6d5498703 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -49,7 +49,7 @@ com.google.cloud.functions function-maven-plugin - 0.9.7 + 0.10.0 test From 9600f6ec51596c2ba9e513c148283cd039338ae6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 15 Nov 2021 17:10:19 +0100 Subject: [PATCH 36/73] deps: update dependency com.google.code.gson:gson to v2.8.9 (#357) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.code.gson:gson](https://togithub.com/google/gson) | `2.8.7` -> `2.8.9` | [![age](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.8.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.8.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.8.9/compatibility-slim/2.8.7)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.8.9/confidence-slim/2.8.7)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
google/gson ### [`v2.8.9`](https://togithub.com/google/gson/blob/master/CHANGELOG.md#Version-289) - Make OSGi bundle's dependency on `sun.misc` optional ([#​1993](https://togithub.com/google/gson/issues/1993)). - Deprecate `Gson.excluder()` exposing internal `Excluder` class ([#​1986](https://togithub.com/google/gson/issues/1986)). - Prevent Java deserialization of internal classes ([#​1991](https://togithub.com/google/gson/issues/1991)). - Improve number strategy implementation ([#​1987](https://togithub.com/google/gson/issues/1987)). - Fix LongSerializationPolicy null handling being inconsistent with Gson ([#​1990](https://togithub.com/google/gson/issues/1990)). - Support arbitrary Number implementation for Object and Number deserialization ([#​1290](https://togithub.com/google/gson/issues/1290)). - Bump proguard-maven-plugin from 2.4.0 to 2.5.1 ([#​1980](https://togithub.com/google/gson/issues/1980)). - Don't exclude static local classes ([#​1969](https://togithub.com/google/gson/issues/1969)). - Fix `RuntimeTypeAdapterFactory` depending on internal `Streams` class ([#​1959](https://togithub.com/google/gson/issues/1959)). - Improve Maven build ([#​1964](https://togithub.com/google/gson/issues/1964)). - Make dependency on `java.sql` optional ([#​1707](https://togithub.com/google/gson/issues/1707)). ### [`v2.8.8`](https://togithub.com/google/gson/blob/master/CHANGELOG.md#Version-288) - Fixed issue with recursive types ([#​1390](https://togithub.com/google/gson/issues/1390)). - Better behaviour with Java 9+ and `Unsafe` if there is a security manager ([#​1712](https://togithub.com/google/gson/issues/1712)). - `EnumTypeAdapter` now works better when ProGuard has obfuscated enum fields ([#​1495](https://togithub.com/google/gson/issues/1495)).
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 6a6d5498703..df3cb5229e3 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -33,7 +33,7 @@ com.google.code.gson gson - 2.8.7 + 2.8.9 com.google.cloud.functions From 9ca6274aa45f9dafb28a619eee9f65aafb4ea0ff Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 19 Nov 2021 20:48:23 +0100 Subject: [PATCH 37/73] test(deps): update dependency org.mockito:mockito-core to v4.1.0 (#364) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `4.0.0` -> `4.1.0` | [![age](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.1.0/compatibility-slim/4.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.1.0/confidence-slim/4.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
mockito/mockito ### [`v4.1.0`](https://togithub.com/mockito/mockito/releases/v4.1.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v4.0.0...v4.1.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 4.1.0 - 2021-11-19 - [20 commit(s)](https://togithub.com/mockito/mockito/compare/v4.0.0...v4.1.0) by Lars Vogel, Mikaël Francoeur, S.YAMAMOTO, Tim van der Lippe, dependabot\[bot] - Disable memory test [(#​2480)](https://togithub.com/mockito/mockito/pull/2480) - Bump appcompat from 1.3.1 to 1.4.0 [(#​2477)](https://togithub.com/mockito/mockito/pull/2477) - Bump kotlinVersion from 1.5.31 to 1.6.0 [(#​2474)](https://togithub.com/mockito/mockito/pull/2474) - Bump versions.bytebuddy from 1.12.0 to 1.12.1 [(#​2472)](https://togithub.com/mockito/mockito/pull/2472) - Bump com.diffplug.gradle.spotless from 4.5.1 to 6.0.0 [(#​2471)](https://togithub.com/mockito/mockito/pull/2471) - Bump versions.bytebuddy from 1.11.22 to 1.12.0 [(#​2469)](https://togithub.com/mockito/mockito/pull/2469) - Bump versions.errorprone from 2.9.0 to 2.10.0 [(#​2466)](https://togithub.com/mockito/mockito/pull/2466) - Bump auto-service from 1.0 to 1.0.1 [(#​2463)](https://togithub.com/mockito/mockito/pull/2463) - Bump actions/checkout from 2.3.5 to 2.4.0 [(#​2462)](https://togithub.com/mockito/mockito/pull/2462) - Fixes [#​2460](https://togithub.com/mockito/mockito/issues/2460): Remove a sentence commits to a particular version [(#​2461)](https://togithub.com/mockito/mockito/pull/2461) - Clarify Javadoc of RETURNS_SMART_NULLS, default answer in Mockito 4.0.0? [(#​2460)](https://togithub.com/mockito/mockito/issues/2460) - Bump versions.bytebuddy from 1.11.21 to 1.11.22 [(#​2458)](https://togithub.com/mockito/mockito/pull/2458) - Updated readme with the latest Mockito version [(#​2456)](https://togithub.com/mockito/mockito/pull/2456) - Bump core-ktx from 1.6.0 to 1.7.0 [(#​2454)](https://togithub.com/mockito/mockito/pull/2454) - Bump google-java-format from 1.11.0 to 1.12.0 [(#​2450)](https://togithub.com/mockito/mockito/pull/2450) - Bump versions.bytebuddy from 1.11.20 to 1.11.21 [(#​2448)](https://togithub.com/mockito/mockito/pull/2448) - Use new CodeCov uploader [(#​2447)](https://togithub.com/mockito/mockito/pull/2447) - Bump actions/checkout from 2.3.4 to 2.3.5 [(#​2445)](https://togithub.com/mockito/mockito/pull/2445) - Fixes [#​2389](https://togithub.com/mockito/mockito/issues/2389) : Parallel use of mocks with deep stubbing may lead to ConcurrentModificationException [(#​2444)](https://togithub.com/mockito/mockito/pull/2444) - Bump versions.bytebuddy from 1.11.19 to 1.11.20 [(#​2443)](https://togithub.com/mockito/mockito/pull/2443) - Parallel use of mocks with deep stubbing may lead to ConcurrentModificationException [(#​2389)](https://togithub.com/mockito/mockito/issues/2389) - Add annotation to mark a type as DoNotMock [(#​1833)](https://togithub.com/mockito/mockito/pull/1833) - Cannot mock this class: class java.io.InputStream with Java 13 [(#​1827)](https://togithub.com/mockito/mockito/issues/1827) - Cannot mock wrapper types, String.class or Class.class [(#​1734)](https://togithub.com/mockito/mockito/issues/1734)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index df3cb5229e3..3ad9be651d8 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -55,7 +55,7 @@ org.mockito mockito-core - 4.0.0 + 4.1.0 test From 7c5796c2a770377020590ad7502719c5b48b3b28 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 7 Dec 2021 00:16:25 +0100 Subject: [PATCH 38/73] chore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.2.0 (#373) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud.samples:shared-configuration](https://togithub.com/GoogleCloudPlatform/java-repo-tools) | `1.0.23` -> `1.2.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/compatibility-slim/1.0.23)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud.samples:shared-configuration/1.2.0/confidence-slim/1.0.23)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
GoogleCloudPlatform/java-repo-tools ### [`v1.2.0`](https://togithub.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.24...v1.2.0) [Compare Source](https://togithub.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.24...v1.2.0) ### [`v1.0.24`](https://togithub.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.23...v1.0.24) [Compare Source](https://togithub.com/GoogleCloudPlatform/java-repo-tools/compare/v1.0.23...v1.0.24)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 3ad9be651d8..5a0a7a1260f 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -14,7 +14,7 @@ com.google.cloud.samples shared-configuration - 1.0.23 + 1.2.0 From 37be464170665f9e7477c6d243e6651f6fdc251f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 12 Jan 2022 17:48:27 +0100 Subject: [PATCH 39/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.11.0 (#391) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.10.1` -> `0.11.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.0/compatibility-slim/0.10.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.0/confidence-slim/0.10.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.11.0`](https://togithub.com/googleapis/java-dialogflow-cx/blob/HEAD/CHANGELOG.md#​0110-httpswwwgithubcomgoogleapisjava-dialogflow-cxcomparev0101v0110-2022-01-07) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.10.1...v0.11.0) ##### Features - added `TelephonyTransferCall` in response message ([#​376](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/376)) ([d7345a8](https://www.github.com/googleapis/java-dialogflow-cx/commit/d7345a81820c125be231afdd23d9d4203e904bfe)) - added API for changelogs ([#​342](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/342)) ([67198cb](https://www.github.com/googleapis/java-dialogflow-cx/commit/67198cb851833bcb1aacb63d037a30522732ade4)) - added API for changelogs ([#​343](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/343)) ([ff46df6](https://www.github.com/googleapis/java-dialogflow-cx/commit/ff46df6f537c8173bca42335403505cd014583c3)) - added deployment API ([#​330](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/330)) ([a68fde8](https://www.github.com/googleapis/java-dialogflow-cx/commit/a68fde8ec9db92185d71abb399cbc3cfae5f94d2)) - added support for comparing between versions docs: clarified security settings API reference ([#​347](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/347)) ([68c3471](https://www.github.com/googleapis/java-dialogflow-cx/commit/68c34714905a783e2979f5a616bb4f5ce1e1a67c)) - added support for custom content types docs: reformat comments ([#​375](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/375)) ([b1affa6](https://www.github.com/googleapis/java-dialogflow-cx/commit/b1affa660f9d88dcc9e54b4f950d80a16eb61c03)) - added support for Deployments with ListDeployments and GetDeployment apis ([#​327](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/327)) ([9000ad2](https://www.github.com/googleapis/java-dialogflow-cx/commit/9000ad2e5183f6e8156382b7a87519823c630d90)) - added the display name of the current page in webhook requests ([#​380](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/380)) ([cbd425f](https://www.github.com/googleapis/java-dialogflow-cx/commit/cbd425f624139064f4b7700a2d7502a42f8dc92f)) - added the display name of the current page in webhook requests ([#​381](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/381)) ([e65c733](https://www.github.com/googleapis/java-dialogflow-cx/commit/e65c7333f2f272137d5dfe4ec4cdaab1e7dbe0f8)) - allow setting custom CA for generic webhooks ([#​355](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/355)) ([66a8c4a](https://www.github.com/googleapis/java-dialogflow-cx/commit/66a8c4ab01c5ec91f6e2d431eff779ceb4b57c41)) - allow setting custom CA for generic webhooks and release CompareVersions API docs: clarify DLP template reader usage ([#​362](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/362)) ([1d581ad](https://www.github.com/googleapis/java-dialogflow-cx/commit/1d581ad83fbd373087bbbcee3cbe55c204a553f3)) - expose dtmf input info in the query result ([#​329](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/329)) ([1c25f27](https://www.github.com/googleapis/java-dialogflow-cx/commit/1c25f2752427d92f169fb7b9bfede3fdda00ba8e)) - exposed DTMF input info in the query result ([a68fde8](https://www.github.com/googleapis/java-dialogflow-cx/commit/a68fde8ec9db92185d71abb399cbc3cfae5f94d2)) ##### Bug Fixes - **java:** add -ntp flag to native image testing command ([#​1299](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/1299)) ([#​377](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/377)) ([41651be](https://www.github.com/googleapis/java-dialogflow-cx/commit/41651be08f9f8b3f9d13295cea8b7f264f58b00e)) - **java:** java 17 dependency arguments ([#​1266](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/1266)) ([#​345](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/345)) ([8cbd520](https://www.github.com/googleapis/java-dialogflow-cx/commit/8cbd52027091460f1bf4b39ed1a0849f1ca8bad3)) - **java:** run Maven in plain console-friendly mode ([#​1301](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/1301)) ([#​384](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/384)) ([331bf72](https://www.github.com/googleapis/java-dialogflow-cx/commit/331bf72103b8fca89d24cf599fcaa43b282be8e3)) ##### Documentation - added notes on long running operation ([a68fde8](https://www.github.com/googleapis/java-dialogflow-cx/commit/a68fde8ec9db92185d71abb399cbc3cfae5f94d2)) - clarified semantic of the streaming APIs ([ff46df6](https://www.github.com/googleapis/java-dialogflow-cx/commit/ff46df6f537c8173bca42335403505cd014583c3)) - clarified semantic of the streaming APIs ([67198cb](https://www.github.com/googleapis/java-dialogflow-cx/commit/67198cb851833bcb1aacb63d037a30522732ade4)) - **samples:** adds list training phrases sample ([#​336](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/336)) ([2810eb2](https://www.github.com/googleapis/java-dialogflow-cx/commit/2810eb29af292fd91cd622757510e44d0560e1eb)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.4.0 ([#​340](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/340)) ([fa55873](https://www.github.com/googleapis/java-dialogflow-cx/commit/fa55873d9e046f351392c285206e5e324c0fd608)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.0 ([#​360](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/360)) ([d0319e4](https://www.github.com/googleapis/java-dialogflow-cx/commit/d0319e432c787c711bc91343ba49789c84ea23a9)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.5.1 ([#​374](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/374)) ([5c970ff](https://www.github.com/googleapis/java-dialogflow-cx/commit/5c970ffe34d4378232da42b9eb2b0dc8b7987100)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.6.0 ([#​388](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/388)) ([3bdb3fc](https://www.github.com/googleapis/java-dialogflow-cx/commit/3bdb3fc91327ad2f84e0d236aee2fc63d9bad7ac)) - update dependency com.google.cloud.functions:function-maven-plugin to v0.10.0 ([#​358](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/358)) ([ee7d1af](https://www.github.com/googleapis/java-dialogflow-cx/commit/ee7d1af400e483b4ce87c8f6bcd5369970af5706)) - update dependency com.google.code.gson:gson to v2.8.9 ([#​357](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/357)) ([0cfc996](https://www.github.com/googleapis/java-dialogflow-cx/commit/0cfc996c1bd321e4b1f845d8c56197cd97faef4d)) ##### [0.10.1](https://www.github.com/googleapis/java-dialogflow-cx/compare/v0.10.0...v0.10.1) (2021-09-22) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.3.0 ([#​318](https://www.togithub.com/googleapis/java-dialogflow-cx/issues/318)) ([eab6a65](https://www.github.com/googleapis/java-dialogflow-cx/commit/eab6a6525011d00e68bdc16c2684ef5f456ffde3))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 5a0a7a1260f..6fd99a588ad 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.10.1 + 0.11.0 com.google.code.gson From 14e2da1210020b28c46a57b8814c83c899841f43 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 24 Jan 2022 21:34:11 +0100 Subject: [PATCH 40/73] test(deps): update dependency org.mockito:mockito-core to v4.3.0 (#378) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `4.1.0` -> `4.3.0` | [![age](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.3.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.3.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.3.0/compatibility-slim/4.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.3.0/confidence-slim/4.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
mockito/mockito ### [`v4.3.0`](https://togithub.com/mockito/mockito/releases/v4.3.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v4.2.0...v4.3.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 4.3.0 - 2022-01-24 - [20 commit(s)](https://togithub.com/mockito/mockito/compare/v4.2.0...v4.3.0) by Andrew Kozel, John Pyeatt, Liam Miller-Cushon, Thomas Keller, Tim van der Lippe, dependabot\[bot], temp-droid - Fixes [#​2489](https://togithub.com/mockito/mockito/issues/2489) : Fixed issue related to exceptions thrown from the nested spies [(#​2546)](https://togithub.com/mockito/mockito/pull/2546) - Issue 2544 [(#​2545)](https://togithub.com/mockito/mockito/pull/2545) - Bump versions.bytebuddy from 1.12.6 to 1.12.7 [(#​2543)](https://togithub.com/mockito/mockito/pull/2543) - Bump com.diffplug.spotless from 6.1.2 to 6.2.0 [(#​2542)](https://togithub.com/mockito/mockito/pull/2542) - Bump material from 1.4.0 to 1.5.0 [(#​2541)](https://togithub.com/mockito/mockito/pull/2541) - Bump appcompat from 1.4.0 to 1.4.1 [(#​2539)](https://togithub.com/mockito/mockito/pull/2539) - Bump com.diffplug.spotless from 6.1.1 to 6.1.2 [(#​2536)](https://togithub.com/mockito/mockito/pull/2536) - Remove an `@link` [(#​2535)](https://togithub.com/mockito/mockito/pull/2535) - Bump com.diffplug.spotless from 6.1.0 to 6.1.1 [(#​2534)](https://togithub.com/mockito/mockito/pull/2534) - Bump com.github.ben-manes.versions from 0.40.0 to 0.41.0 [(#​2533)](https://togithub.com/mockito/mockito/pull/2533) - Bump assertj-core from 3.21.0 to 3.22.0 [(#​2531)](https://togithub.com/mockito/mockito/pull/2531) - Bump com.github.ben-manes.versions from 0.39.0 to 0.40.0 [(#​2529)](https://togithub.com/mockito/mockito/pull/2529) - Bump com.diffplug.spotless from 6.0.5 to 6.1.0 [(#​2527)](https://togithub.com/mockito/mockito/pull/2527) - Bump kotlinx-coroutines-core from 1.5.2-native-mt to 1.6.0-native-mt [(#​2526)](https://togithub.com/mockito/mockito/pull/2526) - Bump versions.bytebuddy from 1.12.5 to 1.12.6 [(#​2524)](https://togithub.com/mockito/mockito/pull/2524) - Bump com.diffplug.spotless from 6.0.4 to 6.0.5 [(#​2520)](https://togithub.com/mockito/mockito/pull/2520) - Bump versions.bytebuddy from 1.12.4 to 1.12.5 [(#​2519)](https://togithub.com/mockito/mockito/pull/2519) - Fixes [#​2510](https://togithub.com/mockito/mockito/issues/2510): Remove ExpectedException from internal test suite [(#​2518)](https://togithub.com/mockito/mockito/pull/2518) - Fix JavaDoc warnings and enforce zero errors in Gradle [(#​2513)](https://togithub.com/mockito/mockito/pull/2513) - Remove `ExpectedException` from internal test suite [(#​2510)](https://togithub.com/mockito/mockito/issues/2510) - Incomplete stack trace returned from spy inside another spy [(#​2489)](https://togithub.com/mockito/mockito/issues/2489) - Introduce a BOM for Mockito's artifacts (closes [#​2321](https://togithub.com/mockito/mockito/issues/2321)) [(#​2323)](https://togithub.com/mockito/mockito/pull/2323) - Provide a bill of materials (BOM) [(#​2321)](https://togithub.com/mockito/mockito/issues/2321) ### [`v4.2.0`](https://togithub.com/mockito/mockito/releases/v4.2.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v4.1.0...v4.2.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 4.2.0 - 2021-12-16 - [21 commit(s)](https://togithub.com/mockito/mockito/compare/v4.1.0...v4.2.0) by Liam Miller-Cushon, Rafael Winterhalter, Tim van der Lippe, dependabot\[bot], temp-droid - Update ByteBuddy to 1.12.4 [(#​2515)](https://togithub.com/mockito/mockito/pull/2515) - Bump kotlinVersion from 1.6.0 to 1.6.10 [(#​2514)](https://togithub.com/mockito/mockito/pull/2514) - Add DoNotMock mention to main JavaDoc [(#​2512)](https://togithub.com/mockito/mockito/pull/2512) - Replace ExpectedException in MissingInvocationInOrderCheckerTest [(#​2511)](https://togithub.com/mockito/mockito/pull/2511) - Update Gradle to version 7.3.1 [(#​2509)](https://togithub.com/mockito/mockito/pull/2509) - Fixes [#​2497](https://togithub.com/mockito/mockito/issues/2497): Throw exception on invalid matchers for `mockStatic` [(#​2506)](https://togithub.com/mockito/mockito/pull/2506) - Make sure interface types are initialized before inline mocking to avoid blocking code of static initializers. [(#​2505)](https://togithub.com/mockito/mockito/pull/2505) - Bump org.eclipse.osgi from 3.17.0 to 3.17.100 [(#​2504)](https://togithub.com/mockito/mockito/pull/2504) - Bump com.diffplug.spotless from 6.0.2 to 6.0.4 [(#​2501)](https://togithub.com/mockito/mockito/pull/2501) - Bump com.diffplug.spotless from 6.0.1 to 6.0.2 [(#​2498)](https://togithub.com/mockito/mockito/pull/2498) - ArgumentMatchers not working for Mockito.mockStatic [(#​2497)](https://togithub.com/mockito/mockito/issues/2497) - Bump versions.bytebuddy from 1.12.2 to 1.12.3 [(#​2496)](https://togithub.com/mockito/mockito/pull/2496) - Bump com.diffplug.spotless from 6.0.0 to 6.0.1 [(#​2495)](https://togithub.com/mockito/mockito/pull/2495) - Remove the recommendation to import ArgumentMatchers methods using Mockito [(#​2494)](https://togithub.com/mockito/mockito/pull/2494) - Bump versions.junitJupiter from 5.8.1 to 5.8.2 [(#​2491)](https://togithub.com/mockito/mockito/pull/2491) - Bump junit-platform-launcher from 1.8.1 to 1.8.2 [(#​2490)](https://togithub.com/mockito/mockito/pull/2490) - Fix typo 'DoNoMock' should be 'DoNotMock' [(#​2487)](https://togithub.com/mockito/mockito/pull/2487) - Bump biz.aQute.bnd.gradle from 6.0.0 to 6.1.0 [(#​2486)](https://togithub.com/mockito/mockito/pull/2486) - Bump biz.aQute.bnd.builder from 6.0.0 to 6.1.0 [(#​2485)](https://togithub.com/mockito/mockito/pull/2485) - Bump versions.bytebuddy from 1.12.1 to 1.12.2 [(#​2484)](https://togithub.com/mockito/mockito/pull/2484) - Bump google-java-format from 1.12.0 to 1.13.0 [(#​2483)](https://togithub.com/mockito/mockito/pull/2483) - Add annotation to mark a type as DoNotMock [(#​1833)](https://togithub.com/mockito/mockito/pull/1833)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 6fd99a588ad..426e9f949b2 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -55,7 +55,7 @@ org.mockito mockito-core - 4.1.0 + 4.3.0 test From 204ab0c8301ef3c9c5928a44fd1c14d142146bd8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 2 Feb 2022 05:46:53 +0100 Subject: [PATCH 41/73] test(deps): update dependency org.mockito:mockito-core to v4.3.1 (#406) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `4.3.0` -> `4.3.1` | [![age](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.3.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.3.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.3.1/compatibility-slim/4.3.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.3.1/confidence-slim/4.3.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
mockito/mockito ### [`v4.3.1`](https://togithub.com/mockito/mockito/releases/v4.3.1) [Compare Source](https://togithub.com/mockito/mockito/compare/v4.3.0...v4.3.1) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 4.3.1 - 2022-01-25 - [1 commit(s)](https://togithub.com/mockito/mockito/compare/v4.3.0...v4.3.1) by Stefano Cordio - Add `mockito-core` to the BOM [(#​2550)](https://togithub.com/mockito/mockito/pull/2550)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 426e9f949b2..163cdde94b5 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -55,7 +55,7 @@ org.mockito mockito-core - 4.3.0 + 4.3.1 test From 4bf85d139fd3fb14afaae22f03191ddada4e57e4 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 15 Feb 2022 19:50:51 +0100 Subject: [PATCH 42/73] deps: update dependency com.google.code.gson:gson to v2.9.0 (#422) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.code.gson:gson](https://togithub.com/google/gson) | `2.8.9` -> `2.9.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.9.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.9.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.9.0/compatibility-slim/2.8.9)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.9.0/confidence-slim/2.8.9)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
google/gson ### [`v2.9.0`](https://togithub.com/google/gson/blob/HEAD/CHANGELOG.md#Version-290) **The minimum supported Java version changes from 6 to 7.** - Change target Java version to 7 ([#​2043](https://togithub.com/google/gson/issues/2043)) - Put `module-info.class` into Multi-Release JAR folder ([#​2013](https://togithub.com/google/gson/issues/2013)) - Improve error message when abstract class cannot be constructed ([#​1814](https://togithub.com/google/gson/issues/1814)) - Support EnumMap deserialization ([#​2071](https://togithub.com/google/gson/issues/2071)) - Add LazilyParsedNumber default adapter ([#​2060](https://togithub.com/google/gson/issues/2060)) - Fix JsonReader.hasNext() returning true at end of document ([#​2061](https://togithub.com/google/gson/issues/2061)) - Remove Gradle build support. Build script was outdated and not actively maintained anymore ([#​2063](https://togithub.com/google/gson/issues/2063)) - Add `GsonBuilder.disableJdkUnsafe()` ([#​1904](https://togithub.com/google/gson/issues/1904)) - Add `UPPER_CASE_WITH_UNDERSCORES` in FieldNamingPolicy ([#​2024](https://togithub.com/google/gson/issues/2024)) - Fix failing to serialize Collection or Map with inaccessible constructor ([#​1902](https://togithub.com/google/gson/issues/1902)) - Improve TreeTypeAdapter thread-safety ([#​1976](https://togithub.com/google/gson/issues/1976)) - Fix `Gson.newJsonWriter` ignoring lenient and HTML-safe setting ([#​1989](https://togithub.com/google/gson/issues/1989)) - Delete unused LinkedHashTreeMap ([#​1992](https://togithub.com/google/gson/issues/1992)) - Make default adapters stricter; improve exception messages ([#​2000](https://togithub.com/google/gson/issues/2000)) - Fix `FieldNamingPolicy.upperCaseFirstLetter` uppercasing non-letter ([#​2004](https://togithub.com/google/gson/issues/2004))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 163cdde94b5..1cce6169b54 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -33,7 +33,7 @@ com.google.code.gson gson - 2.8.9 + 2.9.0 com.google.cloud.functions From 64b294af4c33d56e493fa670bacb105821aea802 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 17 Feb 2022 17:14:59 +0100 Subject: [PATCH 43/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.11.1 (#413) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.11.0` -> `0.11.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.1/compatibility-slim/0.11.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.1/confidence-slim/0.11.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.11.1`](https://togithub.com/googleapis/java-dialogflow-cx/blob/HEAD/CHANGELOG.md#​0111-httpsgithubcomgoogleapisjava-dialogflow-cxcomparev0110v0111-2022-02-03) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.11.0...v0.11.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 1cce6169b54..e908fb906ae 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.11.0 + 0.11.1 com.google.code.gson From f796db268c26917825ece8703e13d328d4a20242 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 18 Feb 2022 23:58:51 +0100 Subject: [PATCH 44/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.11.3 (#428) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.11.1` -> `0.11.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.3/compatibility-slim/0.11.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.3/confidence-slim/0.11.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.11.3`](https://togithub.com/googleapis/java-dialogflow-cx/blob/HEAD/CHANGELOG.md#​0113-httpsgithubcomgoogleapisjava-dialogflow-cxcomparev0112v0113-2022-02-17) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.11.2...v0.11.3) ### [`v0.11.2`](https://togithub.com/googleapis/java-dialogflow-cx/blob/HEAD/CHANGELOG.md#​0112-httpsgithubcomgoogleapisjava-dialogflow-cxcomparev0111v0112-2022-02-11) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.11.1...v0.11.2)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index e908fb906ae..3ad238def76 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.11.1 + 0.11.3 com.google.code.gson From 1131f07bb4df9ff380c322992a89be713c54f8d5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 1 Mar 2022 18:48:20 +0100 Subject: [PATCH 45/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.11.4 (#436) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.11.3` -> `0.11.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.4/compatibility-slim/0.11.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.11.4/confidence-slim/0.11.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.11.4`](https://togithub.com/googleapis/java-dialogflow-cx/blob/HEAD/CHANGELOG.md#​0114-httpsgithubcomgoogleapisjava-dialogflow-cxcomparev0113v0114-2022-02-28) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.11.3...v0.11.4)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 3ad238def76..0c53c22636b 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.11.3 + 0.11.4 com.google.code.gson From 3044fad2d011ddbdafc45e58e5a462b6f05b0fbb Mon Sep 17 00:00:00 2001 From: Gal Zahavi <38544478+galz10@users.noreply.github.com> Date: Tue, 1 Mar 2022 10:19:07 -0800 Subject: [PATCH 46/73] samples: added lro code snippet and removed webhook snippet (#408) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * samples: added lro code snippet and removed webhook snippet * changed intent id for list intent id due to deletion * moved then random test name creation into each test * tried to solve nullExceptionPointer * revert testing changes * reverted pom changes * lint fix * lint fix * added shutdowns * fixed lint * commented print statements * uncommented print code * Commented Print Statements * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../main/java/dialogflow/cx/CreateFlow.java | 4 +- .../main/java/dialogflow/cx/CreateIntent.java | 4 +- .../main/java/dialogflow/cx/CreatePage.java | 5 +- .../main/java/dialogflow/cx/DetectIntent.java | 19 ++-- .../src/main/java/dialogflow/cx/Example.java | 67 ------------- .../main/java/dialogflow/cx/ExportAgent.java | 66 +++++++++++++ .../test/java/dialogflow/cx/ExampleIT.java | 72 -------------- .../java/dialogflow/cx/ExportAgentIT.java | 93 +++++++++++++++++++ .../cx/ListTrainingPhrasesTest.java | 2 +- 9 files changed, 182 insertions(+), 150 deletions(-) delete mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/Example.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/ExportAgent.java delete mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExampleIT.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExportAgentIT.java diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java index 7098aa861fb..3f2b707ddb4 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java @@ -79,8 +79,10 @@ public static Flow createFlow( // Performs the create flow request. Flow response = flowsClient.createFlow(parent, flow); - System.out.format("Flow created: %s\n", response); + // TODO : Uncomment if you want to print response + // System.out.format("Flow created: %s\n", response.toString()); + flowsClient.shutdown(); return response; } } diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java index d9e473585bc..603034d8f56 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java @@ -72,7 +72,9 @@ public static Intent createIntent( // Performs the create intent request. Intent response = intentsClient.createIntent(parent, intent); - System.out.format("Intent created: %s\n", response); + + // TODO : Uncomment if you want to print response + // System.out.format("Intent created: %s\n", response); return response; } diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java index 4418e8970f8..14162bf8d09 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java @@ -101,8 +101,11 @@ public static Page createPage( // Performs the create page request. Page response = pagesClient.createPage(parent, page); - System.out.format("Page created: %s\n", response); + // TODO : Uncomment if you want to print response + // System.out.format("Page created: %s\n", response.toString()); + + pagesClient.shutdown(); return response; } } diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java index d89067ad8ce..703f7a77393 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java @@ -56,8 +56,11 @@ public static Map detectIntent( try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { // Set the session name using the projectID (my-project-id), locationID (global), agentID // (UUID), and sessionId (UUID). - SessionName session = SessionName.of(projectId, locationId, agentId, sessionId); - System.out.println("Session Path: " + session.toString()); + SessionName session = + SessionName.ofProjectLocationAgentSessionName(projectId, locationId, agentId, sessionId); + + // TODO : Uncomment if you want to print session path + // System.out.println("Session Path: " + session.toString()); // Detect intents for each text input. for (String text : texts) { @@ -81,11 +84,13 @@ public static Map detectIntent( // Display the query result. QueryResult queryResult = response.getQueryResult(); - System.out.println("===================="); - System.out.format("Query Text: '%s'\n", queryResult.getText()); - System.out.format( - "Detected Intent: %s (confidence: %f)\n", - queryResult.getIntent().getDisplayName(), queryResult.getIntentDetectionConfidence()); + // TODO : Uncomment if you want to print queryResult + // System.out.println("===================="); + // System.out.format("Query Text: '%s'\n", queryResult.getText()); + // System.out.format( + // "Detected Intent: %s (confidence: %f)\n", + // queryResult.getIntent().getDisplayName(), + // queryResult.getIntentDetectionConfidence()); queryResults.put(text, queryResult); } diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/Example.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/Example.java deleted file mode 100644 index f91c8362a4a..00000000000 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/Example.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dialogflow.cx; - -// [START dialogflow_webhook] - -// TODO: add GSON dependency to Pom file -// (https://mvnrepository.com/artifact/com.google.code.gson/gson/2.8.5) -// TODO: Uncomment the line bellow before running cloud function -// package com.example; - -import com.google.cloud.functions.HttpFunction; -import com.google.cloud.functions.HttpRequest; -import com.google.cloud.functions.HttpResponse; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import java.io.BufferedWriter; - -public class Example implements HttpFunction { - - public void service(HttpRequest request, HttpResponse response) throws Exception { - JsonParser parser = new JsonParser(); - Gson gson = new GsonBuilder().create(); - - JsonObject job = gson.fromJson(request.getReader(), JsonObject.class); - String str = job.getAsJsonObject("fulfillmentInfo").getAsJsonPrimitive("tag").toString(); - JsonObject o = null; - String a = '"' + "Default Welcome Intent" + '"'; - String b = '"' + "get-agent-name" + '"'; - String responseText = ""; - - if (str.equals(a)) { - responseText = '"' + "Hello from a Java GCF Webhook" + '"'; - } else if (str.equals(b)) { - responseText = '"' + "My name is Flowhook" + '"'; - } else { - responseText = '"' + "Sorry I didn't get that" + '"'; - } - - o = - parser - .parse( - "{ \"fulfillment_response\": { \"messages\": [ { \"text\": { \"text\": [" - + responseText - + "] } } ] } }") - .getAsJsonObject(); - BufferedWriter writer = response.getWriter(); - writer.write(o.toString()); - } -} -// [END dialogflow_webhook] diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ExportAgent.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ExportAgent.java new file mode 100644 index 00000000000..ba908af542e --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ExportAgent.java @@ -0,0 +1,66 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_export_agent] + +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.dialogflow.cx.v3.AgentName; +import com.google.cloud.dialogflow.cx.v3.AgentsClient; +import com.google.cloud.dialogflow.cx.v3.AgentsSettings; +import com.google.cloud.dialogflow.cx.v3.ExportAgentRequest; +import com.google.cloud.dialogflow.cx.v3.ExportAgentResponse; +import com.google.protobuf.Struct; +import java.io.IOException; +import java.util.concurrent.ExecutionException; + +public class ExportAgent { + + public static void main(String[] args) + throws IOException, InterruptedException, ExecutionException { + // TODO(developer): Replace these variables before running the sample. + String projectId = "my-project-id"; + String agentId = "my-agent-id"; + String location = "my-location"; + + exportAgent(projectId, agentId, location); + } + + public static void exportAgent(String projectId, String agentId, String location) + throws IOException, InterruptedException, ExecutionException { + + // Sets the api endpoint to specified location + String apiEndpoint = String.format("%s-dialogflow.googleapis.com:443", location); + + AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); + try (AgentsClient agentsClient = AgentsClient.create(agentsSettings)) { + ExportAgentRequest request = + ExportAgentRequest.newBuilder() + .setName(AgentName.of(projectId, location, agentId).toString()) + .build(); + + // Returns a future of the operation + OperationFuture future = + agentsClient.exportAgentOperationCallable().futureCall(request); + + // get the export agent response after the operation is completed + ExportAgentResponse response = future.get(); + System.out.println(response); + } + } +} +// [END dialogflow_cx_export_agent] diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExampleIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExampleIT.java deleted file mode 100644 index a62338c1772..00000000000 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExampleIT.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2021 Google LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dialogflow.cx; - -import static com.google.common.truth.Truth.assertThat; -import static org.mockito.Mockito.when; - -import com.google.cloud.functions.HttpRequest; -import com.google.cloud.functions.HttpResponse; -import com.google.gson.Gson; -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; - -public class ExampleIT { - - @Mock private HttpRequest request; - @Mock private HttpResponse response; - - private BufferedWriter writerOut; - private StringWriter responseOut; - private static final Gson gson = new Gson(); - - @Before - public void beforeTest() throws IOException { - MockitoAnnotations.initMocks(this); - - // use an empty string as the default request content - BufferedReader reader = new BufferedReader(new StringReader("")); - when(request.getReader()).thenReturn(reader); - - responseOut = new StringWriter(); - writerOut = new BufferedWriter(responseOut); - when(response.getWriter()).thenReturn(writerOut); - } - - @Test - public void helloHttp_bodyParamsPost() throws IOException, Exception { - - String firstHalf = "{\fulfillmentInfo\": {\"tag\": \"Default Welcome Intent\",}"; - String secondHalf = ",\"text\": \"hi\",\"languageCode\": \"en\",}"; - - BufferedReader jsonReader = new BufferedReader(new StringReader(firstHalf + secondHalf)); - - when(request.getReader()).thenReturn(jsonReader); - - new Example().service(request, response); - writerOut.flush(); - - assertThat(responseOut.toString()).contains("Hello from a Java GCF Webhook"); - } -} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExportAgentIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExportAgentIT.java new file mode 100644 index 00000000000..018ad27608d --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExportAgentIT.java @@ -0,0 +1,93 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.dialogflow.cx.v3.Agent; +import com.google.cloud.dialogflow.cx.v3.Agent.Builder; +import com.google.cloud.dialogflow.cx.v3.AgentsClient; +import com.google.cloud.dialogflow.cx.v3.AgentsSettings; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +public class ExportAgentIT { + + private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static String parent = ""; + private static String agentPath = ""; + private static String agentID = ""; + + private ByteArrayOutputStream stdOut; + + @BeforeClass + public static void beforeAll() { + assertThat(PROJECT_ID).isNotNull(); + } + + @Before + public void setUp() throws IOException { + stdOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(stdOut)); + + Builder build = Agent.newBuilder(); + build.setDefaultLanguageCode("en"); + build.setDisplayName("temp_agent_" + UUID.randomUUID().toString()); + build.setTimeZone("America/Los_Angeles"); + + Agent agent = build.build(); + + String apiEndpoint = "global-dialogflow.googleapis.com:443"; + String parentPath = "projects/" + PROJECT_ID + "/locations/global"; + + AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); + AgentsClient client = AgentsClient.create(agentsSettings); + + parent = client.createAgent(parentPath, agent).getName(); + ExportAgentIT.agentPath = parent; + ExportAgentIT.agentID = parent.split("/")[5]; + client.close(); + } + + @After + public void tearDown() throws IOException { + stdOut = null; + System.setOut(null); + String apiEndpoint = "global-dialogflow.googleapis.com:443"; + + AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); + AgentsClient client = AgentsClient.create(agentsSettings); + + client.deleteAgent(ExportAgentIT.agentPath); + client.close(); + } + + @Test + public void testUpdateExportAgent() throws IOException, InterruptedException, ExecutionException { + + ExportAgent.exportAgent(PROJECT_ID, ExportAgentIT.agentID, "global"); + + assertThat(stdOut.toString()).contains(ExportAgentIT.agentID); + } +} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTrainingPhrasesTest.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTrainingPhrasesTest.java index e3389ed166c..e0f528560a9 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTrainingPhrasesTest.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTrainingPhrasesTest.java @@ -29,7 +29,7 @@ public class ListTrainingPhrasesTest { private static String PROJECT_ID = System.getenv().get("GOOGLE_CLOUD_PROJECT"); private static String LOCATION = "global"; private static String AGENT_ID = "b8d0e85d-0741-4e6d-a66a-3671184b7b93"; - private static String INTENT_ID = "45974f75-9412-445a-9863-47bfdfa3d96d"; + private static String INTENT_ID = "e2d688a6-c8b4-448e-a7d6-208f147ae689"; private ByteArrayOutputStream stdOut; From e5508c778b55d08db163dd815ed079af351ee3a5 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 8 Mar 2022 21:46:20 +0100 Subject: [PATCH 47/73] test(deps): update dependency org.mockito:mockito-core to v4.4.0 (#446) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `4.3.1` -> `4.4.0` | [![age](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.4.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.4.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.4.0/compatibility-slim/4.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.4.0/confidence-slim/4.3.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
mockito/mockito ### [`v4.4.0`](https://togithub.com/mockito/mockito/releases/v4.4.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v4.3.1...v4.4.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 4.4.0 - 2022-03-08 - [16 commit(s)](https://togithub.com/mockito/mockito/compare/v4.3.1...v4.4.0) by Andrew Kozel, Brice Dutheil, Jean-Baptiste Mille, Mirko Alicastro, dependabot\[bot] - Bump groovy from 3.0.9 to 3.0.10 [(#​2586)](https://togithub.com/mockito/mockito/pull/2586) - Bump google-java-format from 1.14.0 to 1.15.0 [(#​2585)](https://togithub.com/mockito/mockito/pull/2585) - Bump actions/checkout from 2.4.0 to 3 [(#​2582)](https://togithub.com/mockito/mockito/pull/2582) - Bump shipkit-auto-version from 1.1.19 to 1.1.20 [(#​2580)](https://togithub.com/mockito/mockito/pull/2580) - Bump biz.aQute.bnd.builder from 6.1.0 to 6.2.0 [(#​2579)](https://togithub.com/mockito/mockito/pull/2579) - Bump biz.aQute.bnd.gradle from 6.1.0 to 6.2.0 [(#​2578)](https://togithub.com/mockito/mockito/pull/2578) - Adds a Google Java Format for JDK17 [(#​2572)](https://togithub.com/mockito/mockito/pull/2572) - Clean up JUnit3 references [(#​2570)](https://togithub.com/mockito/mockito/pull/2570) - Bump com.diffplug.spotless from 6.2.2 to 6.3.0 [(#​2567)](https://togithub.com/mockito/mockito/pull/2567) - Bump google-java-format from 1.13.0 to 1.14.0 [(#​2565)](https://togithub.com/mockito/mockito/pull/2565) - Bump versions.bytebuddy from 1.12.7 to 1.12.8 [(#​2564)](https://togithub.com/mockito/mockito/pull/2564) - Bump com.diffplug.spotless from 6.2.1 to 6.2.2 [(#​2562)](https://togithub.com/mockito/mockito/pull/2562) - Bump com.github.ben-manes.versions from 0.41.0 to 0.42.0 [(#​2559)](https://togithub.com/mockito/mockito/pull/2559) - Bump com.diffplug.spotless from 6.2.0 to 6.2.1 [(#​2556)](https://togithub.com/mockito/mockito/pull/2556) - Fixes [#​2548](https://togithub.com/mockito/mockito/issues/2548) : Makes InOrder able to verify static methods [(#​2549)](https://togithub.com/mockito/mockito/pull/2549) - \[PR open] Add feature to verify static methods calls in order [(#​2548)](https://togithub.com/mockito/mockito/issues/2548) - Fixes [#​2201](https://togithub.com/mockito/mockito/issues/2201) : Fixed checking of declared exceptions. [(#​2547)](https://togithub.com/mockito/mockito/pull/2547) - Calling getExceptionTypes() on concrete object that is used as interface doesn't return exception types from interface [(#​2201)](https://togithub.com/mockito/mockito/issues/2201)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 0c53c22636b..b77e8351f4a 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -55,7 +55,7 @@ org.mockito mockito-core - 4.3.1 + 4.4.0 test From 76541b03b36507735ecc2ee7792f1879cc10cf56 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 30 Mar 2022 01:37:19 +0200 Subject: [PATCH 48/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.11.5 (#449) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.11.5 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index b77e8351f4a..9ce224e2a2d 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.11.4 + 0.11.5 com.google.code.gson From ac99e05748ac6654300845f96656b9609b6de0d0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 1 Apr 2022 18:40:10 +0200 Subject: [PATCH 49/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.12.0 (#457) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.11.5` -> `0.12.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.12.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.12.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.12.0/compatibility-slim/0.11.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.12.0/confidence-slim/0.11.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.12.0`](https://togithub.com/googleapis/java-dialogflow-cx/blob/HEAD/CHANGELOG.md#​0120-httpsgithubcomgoogleapisjava-dialogflow-cxcomparev0115v0120-2022-03-29) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.11.5...v0.12.0) ##### Features - added page in TestConfig ([d19cb06](https://togithub.com/googleapis/java-dialogflow-cx/commit/d19cb06a4d2d7665e766d0c1d37b481802ed5f0d)) - added page in TestConfig ([#​447](https://togithub.com/googleapis/java-dialogflow-cx/issues/447)) ([d19cb06](https://togithub.com/googleapis/java-dialogflow-cx/commit/d19cb06a4d2d7665e766d0c1d37b481802ed5f0d)) - added support for locking an agent for changes ([#​453](https://togithub.com/googleapis/java-dialogflow-cx/issues/453)) ([8a903ff](https://togithub.com/googleapis/java-dialogflow-cx/commit/8a903ff6a6126f05c5401306674f4215bd84c464)) ##### Documentation - added explanation for uri fields in resources ([#​451](https://togithub.com/googleapis/java-dialogflow-cx/issues/451)) ([0c506ce](https://togithub.com/googleapis/java-dialogflow-cx/commit/0c506ceef415d32a418427c0b24c2e7c3332a325)) - clarified wording around Cloud Storage usage ([d19cb06](https://togithub.com/googleapis/java-dialogflow-cx/commit/d19cb06a4d2d7665e766d0c1d37b481802ed5f0d)) - improved docs format ([0c506ce](https://togithub.com/googleapis/java-dialogflow-cx/commit/0c506ceef415d32a418427c0b24c2e7c3332a325)) - improved docs format ([#​452](https://togithub.com/googleapis/java-dialogflow-cx/issues/452)) ([6edb0d6](https://togithub.com/googleapis/java-dialogflow-cx/commit/6edb0d6056e9652e3a47ce0a3bf34976eaece81b)) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.9.0 ([#​455](https://togithub.com/googleapis/java-dialogflow-cx/issues/455)) ([2ce68e2](https://togithub.com/googleapis/java-dialogflow-cx/commit/2ce68e237d9afcfb721a1271b59531bb2d333539)) ##### [0.11.5](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.11.4...v0.11.5) (2022-03-02) ##### Dependencies - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.8.0 ([#​438](https://togithub.com/googleapis/java-dialogflow-cx/issues/438)) ([02e972d](https://togithub.com/googleapis/java-dialogflow-cx/commit/02e972dff0604c87dc48f4ce350415e33de81c7d)) ##### [0.11.4](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.11.3...v0.11.4) (2022-02-28) ##### Dependencies - update actions/setup-java action to v3 ([#​430](https://togithub.com/googleapis/java-dialogflow-cx/issues/430)) ([fefdae5](https://togithub.com/googleapis/java-dialogflow-cx/commit/fefdae522e67f6705be82a75966126b3d25a5b04)) ##### [0.11.3](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.11.2...v0.11.3) (2022-02-17) ##### Dependencies - update dependency com.google.code.gson:gson to v2.9.0 ([#​422](https://togithub.com/googleapis/java-dialogflow-cx/issues/422)) ([a21bd94](https://togithub.com/googleapis/java-dialogflow-cx/commit/a21bd9412412ffc6fb8d9732ece8c19f1bc8e42b)) ##### [0.11.2](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.11.1...v0.11.2) (2022-02-11) ##### Dependencies - update actions/github-script action to v6 ([#​419](https://togithub.com/googleapis/java-dialogflow-cx/issues/419)) ([4dc4b97](https://togithub.com/googleapis/java-dialogflow-cx/commit/4dc4b97a85fd67c8465bfab4bc6eba110e2c454c)) ##### [0.11.1](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.11.0...v0.11.1) (2022-02-03) ##### Dependencies - **java:** update actions/github-script action to v5 ([#​1339](https://togithub.com/googleapis/java-dialogflow-cx/issues/1339)) ([#​404](https://togithub.com/googleapis/java-dialogflow-cx/issues/404)) ([e771445](https://togithub.com/googleapis/java-dialogflow-cx/commit/e7714453239ea5c1f81ce8ca221076ad967ede5f)) - update dependency com.google.cloud:google-cloud-shared-dependencies to v2.7.0 ([#​407](https://togithub.com/googleapis/java-dialogflow-cx/issues/407)) ([a5bcbe9](https://togithub.com/googleapis/java-dialogflow-cx/commit/a5bcbe979a23a28131d14ba611e4e9637b615ed1))
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 9ce224e2a2d..50a956e4147 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.11.5 + 0.12.0 com.google.code.gson From ad23f35060607e1ddb132bf4087d433523262e03 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 21 Apr 2022 21:38:20 +0200 Subject: [PATCH 50/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.12.1 (#465) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.12.0` -> `0.12.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.12.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.12.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.12.1/compatibility-slim/0.12.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.12.1/confidence-slim/0.12.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.12.1`](https://togithub.com/googleapis/java-dialogflow-cx/blob/HEAD/CHANGELOG.md#​0121-httpsgithubcomgoogleapisjava-dialogflow-cxcomparev0120v0121-2022-04-18) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.12.0...v0.12.1)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 50a956e4147..696726dccef 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.12.0 + 0.12.1 com.google.code.gson From b9758f12ad28089d71d091ad90e28baacc374421 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 22 Apr 2022 01:18:16 +0200 Subject: [PATCH 51/73] test(deps): update dependency org.mockito:mockito-core to v4.5.0 (#467) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `4.4.0` -> `4.5.0` | [![age](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.5.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.5.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.5.0/compatibility-slim/4.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.5.0/confidence-slim/4.4.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
mockito/mockito ### [`v4.5.0`](https://togithub.com/mockito/mockito/releases/v4.5.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v4.4.0...v4.5.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 4.5.0 - 2022-04-19 - [15 commit(s)](https://togithub.com/mockito/mockito/compare/v4.4.0...v4.5.0) by Andrei Silviu Dragnea, Rafael Winterhalter, Rick Ossendrijver, dependabot\[bot] - Bump versions.errorprone from 2.13.0 to 2.13.1 [(#​2621)](https://togithub.com/mockito/mockito/pull/2621) - Bump versions.errorprone from 2.12.1 to 2.13.0 [(#​2619)](https://togithub.com/mockito/mockito/pull/2619) - Groovy inline [(#​2618)](https://togithub.com/mockito/mockito/pull/2618) - Bump actions/setup-java from 2 to 3 [(#​2615)](https://togithub.com/mockito/mockito/pull/2615) - Bump versions.bytebuddy from 1.12.8 to 1.12.9 [(#​2614)](https://togithub.com/mockito/mockito/pull/2614) - Support subclass mocks on Graal VM. [(#​2613)](https://togithub.com/mockito/mockito/pull/2613) - Bump com.diffplug.spotless from 6.4.1 to 6.4.2 [(#​2611)](https://togithub.com/mockito/mockito/pull/2611) - Bump kotlinx-coroutines-core from 1.6.0-native-mt to 1.6.1-native-mt [(#​2609)](https://togithub.com/mockito/mockito/pull/2609) - Bump versions.errorprone from 2.10.0 to 2.12.1 [(#​2608)](https://togithub.com/mockito/mockito/pull/2608) - Bump kotlinVersion from 1.6.10 to 1.6.20 [(#​2607)](https://togithub.com/mockito/mockito/pull/2607) - Bump com.diffplug.spotless from 6.4.0 to 6.4.1 [(#​2606)](https://togithub.com/mockito/mockito/pull/2606) - Bump com.diffplug.spotless from 6.3.0 to 6.4.0 [(#​2605)](https://togithub.com/mockito/mockito/pull/2605) - Bump org.eclipse.osgi from 3.17.100 to 3.17.200 [(#​2597)](https://togithub.com/mockito/mockito/pull/2597) - Deprecate ListUtil and Fields classes [(#​2593)](https://togithub.com/mockito/mockito/pull/2593) - mockito-errorprone seems not compatible with ErrorProne 2.11.0 [(#​2554)](https://togithub.com/mockito/mockito/issues/2554) - NullPointerException from Groovy metaclass methods when using mockito-inline (but not mockito-core) [(#​2522)](https://togithub.com/mockito/mockito/issues/2522)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 696726dccef..3381f7e7010 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -55,7 +55,7 @@ org.mockito mockito-core - 4.4.0 + 4.5.0 test From 26394865d63e0d80900c5b9ef531f9b384abdb92 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 22 Apr 2022 16:12:29 +0200 Subject: [PATCH 52/73] test(deps): update dependency org.mockito:mockito-core to v4.5.1 (#471) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `4.5.0` -> `4.5.1` | [![age](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.5.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.5.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.5.1/compatibility-slim/4.5.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.5.1/confidence-slim/4.5.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
mockito/mockito ### [`v4.5.1`](https://togithub.com/mockito/mockito/releases/v4.5.1) [Compare Source](https://togithub.com/mockito/mockito/compare/v4.5.0...v4.5.1) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 4.5.1 - 2022-04-21 - [2 commit(s)](https://togithub.com/mockito/mockito/compare/v4.5.0...v4.5.1) by Jeremy Landis, dependabot\[bot] - Fixes [#​2623](https://togithub.com/mockito/mockito/issues/2623): Use zulu distribution and java 11 for release GHA job [(#​2624)](https://togithub.com/mockito/mockito/pull/2624) - Missing errorprone module for 4.5.0 in central as release was done with jdk 8 [(#​2623)](https://togithub.com/mockito/mockito/issues/2623) - Bump kotlinVersion from 1.6.20 to 1.6.21 [(#​2622)](https://togithub.com/mockito/mockito/pull/2622)
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 3381f7e7010..2ff00a7a850 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -55,7 +55,7 @@ org.mockito mockito-core - 4.5.0 + 4.5.1 test From bb6e850a6bc6f984a5283b8a117bc996bd0f0ba3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 26 May 2022 17:00:49 +0200 Subject: [PATCH 53/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.13.0 (#484) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.12.1` -> `0.13.0` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.13.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.13.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.13.0/compatibility-slim/0.12.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.13.0/confidence-slim/0.12.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 2ff00a7a850..940bafc97f0 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.12.1 + 0.13.0 com.google.code.gson From a1bf0c3818af2288aed773cd9da3c76250a22412 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 6 Jun 2022 19:16:16 +0200 Subject: [PATCH 54/73] test(deps): update dependency org.mockito:mockito-core to v4.6.1 (#486) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `4.5.1` -> `4.6.1` | [![age](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.6.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.6.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.6.1/compatibility-slim/4.5.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.6.1/confidence-slim/4.5.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
mockito/mockito ### [`v4.6.1`](https://togithub.com/mockito/mockito/releases/tag/v4.6.1) [Compare Source](https://togithub.com/mockito/mockito/compare/v4.6.0...v4.6.1) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 4.6.1 - 2022-06-02 - [6 commit(s)](https://togithub.com/mockito/mockito/compare/v4.6.0...v4.6.1) by Andy Coates, Chen Ni, dependabot\[bot] - Bump material from 1.6.0 to 1.6.1 [(#​2662)](https://togithub.com/mockito/mockito/pull/2662) - Bump core-ktx from 1.7.0 to 1.8.0 [(#​2661)](https://togithub.com/mockito/mockito/pull/2661) - Bump groovy from 3.0.10 to 3.0.11 [(#​2660)](https://togithub.com/mockito/mockito/pull/2660) - Fix for Issue2656 [(#​2659)](https://togithub.com/mockito/mockito/pull/2659) - Bump assertj-core from 3.22.0 to 3.23.1 [(#​2658)](https://togithub.com/mockito/mockito/pull/2658) - Regression? Strictness set in `@MockitoSettings` ignored after upgrade from 4.5.1 to 4.6.0 [(#​2656)](https://togithub.com/mockito/mockito/issues/2656) - Fix typo [(#​2655)](https://togithub.com/mockito/mockito/pull/2655) ### [`v4.6.0`](https://togithub.com/mockito/mockito/releases/tag/v4.6.0) [Compare Source](https://togithub.com/mockito/mockito/compare/v4.5.1...v4.6.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 4.6.0 - 2022-05-27 - [14 commit(s)](https://togithub.com/mockito/mockito/compare/v4.5.1...v4.6.0) by Hervé Boutemy, K. Siva Prasad Reddy, Rafael Winterhalter, dependabot\[bot] - Bump shipkit-changelog from 1.1.15 to 1.2.0 [(#​2654)](https://togithub.com/mockito/mockito/pull/2654) - Bump versions.errorprone from 2.13.1 to 2.14.0 [(#​2653)](https://togithub.com/mockito/mockito/pull/2653) - Bump shipkit-auto-version from 1.1.20 to 1.2.0 [(#​2651)](https://togithub.com/mockito/mockito/pull/2651) - Fixes [#​2648](https://togithub.com/mockito/mockito/issues/2648) : Add support for customising strictness via [@​Mock](https://togithub.com/Mock) annotation and MockSettings [(#​2650)](https://togithub.com/mockito/mockito/pull/2650) - Any way to enable Strict Stubbing when using Mockito.mock() without using [@​Mock](https://togithub.com/Mock)? [(#​2648)](https://togithub.com/mockito/mockito/issues/2648) - Reintroduce inheriting type annotations from interfaces if only one interface is mocked, including additional interfaces. [(#​2645)](https://togithub.com/mockito/mockito/pull/2645) - Bump com.diffplug.spotless from 6.6.0 to 6.6.1 [(#​2643)](https://togithub.com/mockito/mockito/pull/2643) - fix Reproducible Build issue [(#​2642)](https://togithub.com/mockito/mockito/pull/2642) - Bump com.diffplug.spotless from 6.5.2 to 6.6.0 [(#​2641)](https://togithub.com/mockito/mockito/pull/2641) - Mockito mock of interfaces lost annotation information [(#​2640)](https://togithub.com/mockito/mockito/issues/2640) - Bump material from 1.5.0 to 1.6.0 [(#​2637)](https://togithub.com/mockito/mockito/pull/2637) - Bump com.diffplug.spotless from 6.5.1 to 6.5.2 [(#​2636)](https://togithub.com/mockito/mockito/pull/2636) - Bump versions.bytebuddy from 1.12.9 to 1.12.10 [(#​2635)](https://togithub.com/mockito/mockito/pull/2635) - Bump com.diffplug.spotless from 6.5.0 to 6.5.1 [(#​2632)](https://togithub.com/mockito/mockito/pull/2632) - Bump com.diffplug.spotless from 6.4.2 to 6.5.0 [(#​2631)](https://togithub.com/mockito/mockito/pull/2631)
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 940bafc97f0..5a32a4ec68e 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -55,7 +55,7 @@ org.mockito mockito-core - 4.5.1 + 4.6.1 test From 30e5286a650f2f576f977ac3b26820cc616c3f2c Mon Sep 17 00:00:00 2001 From: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com> Date: Fri, 1 Jul 2022 13:57:06 -0500 Subject: [PATCH 55/73] test: remove extra println causing NPE in test (#495) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: remove extra println causing NPE in test * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * test: add delays to prevent quota issue * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * test: update import in DetectIntentIT * test: tests declare they throw InterruptedException Co-authored-by: Owl Bot --- .../src/test/java/dialogflow/cx/CreateAgentIT.java | 5 ++++- .../snippets/src/test/java/dialogflow/cx/CreateFlowIT.java | 3 +++ .../src/test/java/dialogflow/cx/CreateIntentIT.java | 4 +++- .../snippets/src/test/java/dialogflow/cx/CreatePageIT.java | 3 +++ .../src/test/java/dialogflow/cx/DetectIntentIT.java | 7 +++++++ .../src/test/java/dialogflow/cx/DetectIntentStreamIT.java | 5 ++++- .../src/test/java/dialogflow/cx/ExportAgentIT.java | 5 ++++- .../src/test/java/dialogflow/cx/ListTestCaseResultsIT.java | 5 ++++- .../test/java/dialogflow/cx/ListTrainingPhrasesTest.java | 5 ++++- .../src/test/java/dialogflow/cx/PageManagementIT.java | 5 ++++- .../src/test/java/dialogflow/cx/UpdateIntentTest.java | 5 ++++- 11 files changed, 44 insertions(+), 8 deletions(-) diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateAgentIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateAgentIT.java index b479c0eb876..69723e127bb 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateAgentIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateAgentIT.java @@ -43,7 +43,7 @@ public void setUp() throws IOException { } @After - public void tearDown() throws IOException { + public void tearDown() throws IOException, InterruptedException { System.setOut(originalOut); String apiEndpoint = "global-dialogflow.googleapis.com:443"; @@ -51,6 +51,9 @@ public void tearDown() throws IOException { AgentsClient client = AgentsClient.create(agentsSettings); client.deleteAgent(CreateAgentIT.agentPath); + + // Small delay to prevent reaching quota limit of requests per minute + Thread.sleep(250); } @Test diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateFlowIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateFlowIT.java index 1c9e02135b5..7bbe9de68d6 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateFlowIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateFlowIT.java @@ -68,6 +68,9 @@ public static void tearDown() throws Exception { try (FlowsClient flowsClient = FlowsClient.create(flowsSettings)) { flowsClient.deleteFlow(newFlowNameRegional); } + + // Small delay to prevent reaching quota limit of requests per minute + Thread.sleep(250); } } diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateIntentIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateIntentIT.java index 9cd42c025b8..6f317122f69 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateIntentIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateIntentIT.java @@ -70,6 +70,9 @@ public static void tearDown() throws Exception { intentsClient.deleteIntent(newIntentNameRegional); } } + + // Small delay to prevent reaching quota limit of requests per minute + Thread.sleep(250); } @Test @@ -93,7 +96,6 @@ public void testCreateIntentRegional() throws Exception { CreateIntent.createIntent( DISPLAY_NAME, PROJECT_ID, LOCATION_REGIONAL, AGENT_ID_REGIONAL, TRAINING_PHRASES_PARTS); newIntentNameRegional = result.getName(); - System.out.println("intent name new:" + newIntentNameRegional); assertEquals(result.getTrainingPhrasesCount(), TRAINING_PHRASES_PARTS.size()); for (TrainingPhrase trainingPhrase : result.getTrainingPhrasesList()) { diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreatePageIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreatePageIT.java index 649d5a6c8fd..b392be98cba 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreatePageIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreatePageIT.java @@ -57,6 +57,9 @@ public static void tearDown() throws Exception { try (PagesClient pagesClient = PagesClient.create()) { pagesClient.deletePage(newPageNameGlobal); } + + // Small delay to prevent reaching quota limit of requests per minute + Thread.sleep(250); } // Delete the newly created Page in the regional location. diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java index bf0e300a77d..2d85f6dc973 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; +import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -45,6 +46,12 @@ public class DetectIntentIT { private static String LANGUAGE_CODE = "en-US"; private static List TEXTS = Arrays.asList("hello", "book a meeting room"); + @After + public void tearDown() throws InterruptedException { + // Small delay to prevent reaching quota limit of requests per minute + Thread.sleep(250); + } + @Test public void testDetectIntentGlobal() throws Exception { Map queryResults = diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamIT.java index 4ef71b0edb7..b941420f055 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamIT.java @@ -55,9 +55,12 @@ public void setUp() { } @After - public void tearDown() { + public void tearDown() throws InterruptedException { System.setOut(original); bout.reset(); + + // Small delay to prevent reaching quota limit of requests per minute + Thread.sleep(250); } @Test diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExportAgentIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExportAgentIT.java index 018ad27608d..e499fe726d7 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExportAgentIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ExportAgentIT.java @@ -71,7 +71,7 @@ public void setUp() throws IOException { } @After - public void tearDown() throws IOException { + public void tearDown() throws IOException, InterruptedException { stdOut = null; System.setOut(null); String apiEndpoint = "global-dialogflow.googleapis.com:443"; @@ -81,6 +81,9 @@ public void tearDown() throws IOException { client.deleteAgent(ExportAgentIT.agentPath); client.close(); + + // Small delay to prevent reaching quota limit of requests per minute + Thread.sleep(250); } @Test diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTestCaseResultsIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTestCaseResultsIT.java index 57a7fd32c7c..2214356f1c9 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTestCaseResultsIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTestCaseResultsIT.java @@ -43,8 +43,11 @@ public void setUp() throws IOException { } @After - public void tearDown() throws IOException { + public void tearDown() throws IOException, InterruptedException { System.setOut(originalOut); + + // Small delay to prevent reaching quota limit of requests per minute + Thread.sleep(250); } @Test diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTrainingPhrasesTest.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTrainingPhrasesTest.java index e0f528560a9..347b3980410 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTrainingPhrasesTest.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ListTrainingPhrasesTest.java @@ -40,9 +40,12 @@ public void setUp() throws IOException { } @After - public void tearDown() throws IOException { + public void tearDown() throws IOException, InterruptedException { stdOut = null; System.setOut(null); + + // Small delay to prevent reaching quota limit of requests per minute + Thread.sleep(250); } @Test diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/PageManagementIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/PageManagementIT.java index d0e8fac930a..ab1b2ca6032 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/PageManagementIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/PageManagementIT.java @@ -65,7 +65,7 @@ public static void setUp() throws IOException { } @AfterClass - public static void tearDown() throws IOException { + public static void tearDown() throws IOException, InterruptedException { String apiEndpoint = "global-dialogflow.googleapis.com:443"; String parentPath = "projects/" + PROJECT_ID + "/locations/global"; @@ -73,6 +73,9 @@ public static void tearDown() throws IOException { AgentsClient client = AgentsClient.create(agentsSettings); client.deleteAgent(parent); + + // Small delay to prevent reaching quota limit of requests per minute + Thread.sleep(250); } @Test diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/UpdateIntentTest.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/UpdateIntentTest.java index bb210fa2dc4..0443ec40cb7 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/UpdateIntentTest.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/UpdateIntentTest.java @@ -74,7 +74,7 @@ public void setUp() throws IOException { } @After - public void tearDown() throws IOException { + public void tearDown() throws IOException, InterruptedException { stdOut = null; System.setOut(null); String apiEndpoint = "global-dialogflow.googleapis.com:443"; @@ -84,6 +84,9 @@ public void tearDown() throws IOException { AgentsClient client = AgentsClient.create(agentsSettings); client.deleteAgent(parent); + + // Small delay to prevent reaching quota limit of requests per minute + Thread.sleep(250); } @Test From a0833c716a25168489507883a0bf666fac1de18a Mon Sep 17 00:00:00 2001 From: Karl Weinmeister <11586922+kweinmeister@users.noreply.github.com> Date: Mon, 11 Jul 2022 17:25:26 -0500 Subject: [PATCH 56/73] ci: use Java 11 for samples testing (#505) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: use Java 11 for samples testing * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * ci: Update pom.xml files for Java 11 * ci: Update pom.xml * ci: Update image to Java 11 * ci: revert pom.xml changes * ci: test adding GCF library * ci: fix lint issue * ci: updated samples pom.xml to use Java 11 * ci: Update owlbot.py * ci: Remove temporary changes * ci: Update owlbot to replace pom.xml params * ci: remove unnecessary space * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * ci: revert createagent test * ci: update owlbot.py * ci: changed owlbot exclusion to substitution * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * ci: letting Owlbot change the samples.cfg files * ci: update regex * ci: update to owlbot.py * ci: update to owlbot.py * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- dialogflow-cx/snippets/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 5a32a4ec68e..5c723ddd6e3 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -18,8 +18,8 @@ - 1.8 - 1.8 + 11 + 11 UTF-8 From 5f5066dff24a2260d103802998c7fdeae9fe384b Mon Sep 17 00:00:00 2001 From: aribray <45905583+aribray@users.noreply.github.com> Date: Tue, 12 Jul 2022 07:50:28 -0500 Subject: [PATCH 57/73] docs: add DetectIntent samples (#500) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs:add configure webhook to set form parameter as optional or required sample and test Change-Id: I75bed489bd8abefca60263acb266501810c0e856 * docs: fix checkstyle Change-Id: I18be2a5c1d46ac9838cf4a15ab87dcf331ee26ee * fix checkstyle Change-Id: Ia85899f678ef1382718c2443a682770417340af2 * fix checkstyle Change-Id: I4dd56107a3197027f287980fa87a15e962154783 * fix multiline string Change-Id: I8dcdb0dcaad486a2fb69e0737df99bda49b28839 * fix checkstyle violations Change-Id: I5f4521b3e50660f30f9f73da3d939da213084d28 * fix checkstyle violations Change-Id: I39dedfba1b62be5cb4580a42dde270146f3b6f97 * remove unused variable Change-Id: Ic54ae0d1f091079661f3fa67097cdcd2e888dc90 * fix checkstyle violations Change-Id: Ifd303b7395844240dca0b29cde9b791112fcabe5 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix checkstyle violations Change-Id: I59e45da9f9e57b327a527f1405816ac1275fe1c8 * fix checkstyle violations Change-Id: I70ff4118cc8b3111a3ed55a2fae32258d3f6819c * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * remove unnecessary samples Change-Id: I395dd5abc9a48733126ab0ecdc2a974fbf9eb471 * add webhook configure session parameter sample and test Change-Id: Ia599ab7f4d432477d9952b4e12c709845f1ad97b * add webhook validate form parameter sample and test Change-Id: I8cdf93fd9e21161757d198b1338c5ab77bb3a236 * fix checkstyle violations Change-Id: I90f1f626588fd59c116d119348054c914945cd1d * fix checkstyle violations Change-Id: I5ff686ab2ffc94b358bdf87b8dfc3d00f5e45657 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add detectintent with intent input sample and test Change-Id: I4a2bef88da7ed04d343da63544563130182e6aaf * docs: add detect intent samples and tests Change-Id: I8e6a26441a79b1ed44def4877c822040cb143e33 * add detectintent with audio input sample and test Change-Id: I741c73d3f14bfe5f9b4ff6ec55d43f2687ac51dd * fix checkstyle violations Change-Id: I216ade5c8bca9e85850b6ab84b2a70eab0d4fd53 * add detectintent with event input sample and test Change-Id: Ie0846bd780f20cd1a8406f8a1278ccf45824b646 * add detectintent with sentiment analysis sample and test Change-Id: I7d8c855bd0e1a0bc19288abd968a4602a909b3df * add detectintent with webhook disabled sample and test Change-Id: Idf6c2005b7a1970e3c8227080bb91a1d408474b0 * add detectintentstreamingpartialresponse sample and test Change-Id: Id1a0017757da3eee5e0556f0c7ba8954f9907ca3 * add detectintentsynthesizettsoutput sample and test Change-Id: I389daae0a1b5b7fb858dd8c81ceba99475ce3ca3 * fix checkstyle violations Change-Id: Ic247c4b7d50df1a6a5eb74fe0899defc63478b0e * rename detectintent with text input sample and test Change-Id: Ic9b54f74723f716cd688e780675ce878487251aa * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * change the name back Change-Id: I153f94d5c9c1c53d96365fb05c02625c2dc5f745 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix comments Change-Id: I02c0ce2e61ab74026d04103774de02fc2bb0ae6b * remove old webhook samples Change-Id: I6d2872aa1b3c77c0f08cd62a508d351066490f25 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * v3beta1 to v3 Change-Id: I3850ed76ea36def3cf215c7261fa1bffba274d6e * v3beta1 to v3 Change-Id: Ie0539f4a6ca8d5c9cb21ac528e09ce8f992a0486 * add flag to kokoro build script Change-Id: I5c3862c61931b28772e408b5e2d68e7cc5af72d2 * fix test assertion Change-Id: I2bffb8d973362d032265f7bd7b89aa88555de819 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * remove flag Change-Id: Ie3c449bdb635180653237745a8cc282afb088a57 * hardcode parameters Change-Id: Iac48159892b0b6a34f31b013d446dfd66e62b8a7 * move sessionID comments Change-Id: I8e3fcea6a24739cb7a1e49d7572688e22d4d0147 * add main and hardcode variables Change-Id: I29f4cb587b10f46576aa36a56cde8c8fcb6e1acb * add session path comments and path format Change-Id: I327b7e90d8562c9698bc1fc4324ec249c6326436 * checkstyle Change-Id: If9937d41cefcff2fa0480524d036aecf5a1fda40 * checkstyle Change-Id: I9980a07e9c2ca377f669f0b80bbf16a42033d634 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix list construction Change-Id: I5115e749e47427c50e2ed0ad494525dc6f9be66a * import ArrayList Change-Id: Ibe5abeee5b6b003fc8c77eb53eb432a340629255 Co-authored-by: Owl Bot --- .../dialogflow/cx/DetectIntentAudioInput.java | 128 +++++++++++++++ .../cx/DetectIntentDisableWebhook.java | 120 ++++++++++++++ .../dialogflow/cx/DetectIntentEventInput.java | 98 +++++++++++ .../cx/DetectIntentIntentInput.java | 100 ++++++++++++ .../cx/DetectIntentSentimentAnalysis.java | 117 +++++++++++++ .../dialogflow/cx/DetectIntentStream.java | 7 +- .../DetectIntentStreamingPartialResponse.java | 154 ++++++++++++++++++ ...ectIntentSynthesizeTextToSpeechOutput.java | 131 +++++++++++++++ .../cx/DetectIntentAudioInputTest.java | 72 ++++++++ .../cx/DetectIntentDisableWebhookTest.java | 74 +++++++++ .../cx/DetectIntentEventInputTest.java | 66 ++++++++ .../java/dialogflow/cx/DetectIntentIT.java | 2 +- .../cx/DetectIntentIntentInputTest.java | 75 +++++++++ .../cx/DetectIntentSentimentAnalysisTest.java | 56 +++++++ ...ectIntentStreamingPartialResponseTest.java | 68 ++++++++ ...ntentSynthesizeTextToSpeechOutputTest.java | 72 ++++++++ 16 files changed, 1335 insertions(+), 5 deletions(-) create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentAudioInput.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentDisableWebhook.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentEventInput.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentIntentInput.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSentimentAnalysis.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStreamingPartialResponse.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSynthesizeTextToSpeechOutput.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentAudioInputTest.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentDisableWebhookTest.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentEventInputTest.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIntentInputTest.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentSentimentAnalysisTest.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamingPartialResponseTest.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentSynthesizeTextToSpeechOutputTest.java diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentAudioInput.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentAudioInput.java new file mode 100644 index 00000000000..e864f381a03 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentAudioInput.java @@ -0,0 +1,128 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_v3_detect_intent_audio_input] + +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.dialogflow.cx.v3.AudioEncoding; +import com.google.cloud.dialogflow.cx.v3.AudioInput; +import com.google.cloud.dialogflow.cx.v3.DetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3.DetectIntentResponse; +import com.google.cloud.dialogflow.cx.v3.InputAudioConfig; +import com.google.cloud.dialogflow.cx.v3.QueryInput; +import com.google.cloud.dialogflow.cx.v3.QueryResult; +import com.google.cloud.dialogflow.cx.v3.SessionName; +import com.google.cloud.dialogflow.cx.v3.SessionsClient; +import com.google.cloud.dialogflow.cx.v3.SessionsSettings; +import com.google.protobuf.ByteString; +import java.io.FileInputStream; +import java.io.IOException; + +public class DetectIntentAudioInput { + + // DialogFlow API Detect Intent sample with Audio input. + public static void main(String[] args) throws IOException, ApiException { + /** TODO (developer): replace these values with your own values */ + String projectId = "my-project-id"; + String locationId = "global"; + String agentId = "my-agent-id"; + String audioFileName = "resources/book_a_room.wav"; + int sampleRateHertz = 16000; + /* + * A session ID is a string of at most 36 bytes in size. + * Your system is responsible for generating unique session IDs. + * They can be random numbers, hashed end-user identifiers, + * or any other values that are convenient for you to generate. + */ + String sessionId = "my-UUID"; + String languageCode = "en"; + + detectIntent( + projectId, locationId, agentId, audioFileName, sampleRateHertz, sessionId, languageCode); + } + + public static void detectIntent( + String projectId, + String locationId, + String agentId, + String audioFileName, + int sampleRateHertz, + String sessionId, + String languageCode) + throws IOException, ApiException { + + SessionsSettings.Builder sessionsSettingsBuilder = SessionsSettings.newBuilder(); + if (locationId.equals("global")) { + sessionsSettingsBuilder.setEndpoint("dialogflow.googleapis.com:443"); + } else { + sessionsSettingsBuilder.setEndpoint(locationId + "-dialogflow.googleapis.com:443"); + } + SessionsSettings sessionsSettings = sessionsSettingsBuilder.build(); + + // Instantiates a client by setting the session name. + // Format:`projects//locations//agents//sessions/` + try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { + SessionName session = + SessionName.ofProjectLocationAgentSessionName(projectId, locationId, agentId, sessionId); + + // TODO : Uncomment if you want to print session path + // System.out.println("Session Path: " + session.toString()); + InputAudioConfig inputAudioConfig = + InputAudioConfig.newBuilder() + .setAudioEncoding(AudioEncoding.AUDIO_ENCODING_LINEAR_16) + .setSampleRateHertz(sampleRateHertz) + .build(); + + try (FileInputStream audioStream = new FileInputStream(audioFileName)) { + // Subsequent requests must **only** contain the audio data. + // Following messages: audio chunks. We just read the file in fixed-size chunks. In reality + // you would split the user input by time. + byte[] buffer = new byte[4096]; + int bytes = audioStream.read(buffer); + AudioInput audioInput = + AudioInput.newBuilder() + .setAudio(ByteString.copyFrom(buffer, 0, bytes)) + .setConfig(inputAudioConfig) + .build(); + QueryInput queryInput = + QueryInput.newBuilder() + .setAudio(audioInput) + .setLanguageCode("en-US") // languageCode = "en-US" + .build(); + + DetectIntentRequest request = + DetectIntentRequest.newBuilder() + .setSession(session.toString()) + .setQueryInput(queryInput) + .build(); + + // Performs the detect intent request. + DetectIntentResponse response = sessionsClient.detectIntent(request); + + // Display the query result. + QueryResult queryResult = response.getQueryResult(); + + System.out.println("===================="); + System.out.format( + "Detected Intent: %s (confidence: %f)\n", + queryResult.getTranscript(), queryResult.getIntentDetectionConfidence()); + } + } + } +} +// [END dialogflow_cx_v3_detect_intent_audio_input] diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentDisableWebhook.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentDisableWebhook.java new file mode 100644 index 00000000000..c0cf470fefa --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentDisableWebhook.java @@ -0,0 +1,120 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_v3_detect_intent_disable_webhook] + +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.dialogflow.cx.v3.DetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3.DetectIntentResponse; +import com.google.cloud.dialogflow.cx.v3.QueryInput; +import com.google.cloud.dialogflow.cx.v3.QueryParameters; +import com.google.cloud.dialogflow.cx.v3.QueryResult; +import com.google.cloud.dialogflow.cx.v3.SessionName; +import com.google.cloud.dialogflow.cx.v3.SessionsClient; +import com.google.cloud.dialogflow.cx.v3.SessionsSettings; +import com.google.cloud.dialogflow.cx.v3.TextInput; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class DetectIntentDisableWebhook { + + public static void main(String[] args) throws IOException, ApiException { + String projectId = "my-project-id"; + String locationId = "global"; + String agentId = "my-agent-id"; + String sessionId = "my-UUID"; + List texts = new ArrayList<>(List.of("my-list", "of-texts")); + String languageCode = "en"; + + detectIntent(projectId, locationId, agentId, sessionId, texts, languageCode); + } + + // DialogFlow API Detect Intent sample with webhook disabled. + public static Map detectIntent( + String projectId, + String locationId, + String agentId, + String sessionId, + List texts, + String languageCode) + throws IOException, ApiException { + SessionsSettings.Builder sessionsSettingsBuilder = SessionsSettings.newBuilder(); + if (locationId.equals("global")) { + sessionsSettingsBuilder.setEndpoint("dialogflow.googleapis.com:443"); + } else { + sessionsSettingsBuilder.setEndpoint(locationId + "-dialogflow.googleapis.com:443"); + } + SessionsSettings sessionsSettings = sessionsSettingsBuilder.build(); + + Map queryResults = Maps.newHashMap(); + + // Instantiates a client by setting the session name. + // Format:`projects//locations//agents//sessions/` + try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { + SessionName session = + SessionName.ofProjectLocationAgentSessionName(projectId, locationId, agentId, sessionId); + + // TODO : Uncomment if you want to print session path + // System.out.println("Session Path: " + session.toString()); + + // Detect intents for each text input. + for (String text : texts) { + // Set the text (hello) for the query. + TextInput.Builder textInput = TextInput.newBuilder().setText(text); + + // Build the query with the TextInput and language code (en-US). + QueryInput queryInput = + QueryInput.newBuilder().setText(textInput).setLanguageCode(languageCode).build(); + + // Build the query parameters and setDisableWebhook to true. + QueryParameters queryParameters = + QueryParameters.newBuilder().setDisableWebhook(true).build(); + + // Build the DetectIntentRequest with the SessionName, QueryInput, and QueryParameters. + DetectIntentRequest request = + DetectIntentRequest.newBuilder() + .setSession(session.toString()) + .setQueryInput(queryInput) + .setQueryParams(queryParameters) + .build(); + System.out.println(request.toString()); + + // Performs the detect intent request. + DetectIntentResponse response = sessionsClient.detectIntent(request); + + // Display the query result. + QueryResult queryResult = response.getQueryResult(); + + // TODO : Uncomment if you want to print queryResult + // System.out.println("===================="); + // System.out.format("Query Text: '%s'\n", queryResult.getText()); + // System.out.format( + // "Detected Intent: %s (confidence: %f)\n", + // queryResult.getIntent().getDisplayName(), + // queryResult.getIntentDetectionConfidence()); + + queryResults.put(text, queryResult); + } + } + return queryResults; + } +} +// [END dialogflow_cx_v3_detect_intent_disable_webhook] diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentEventInput.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentEventInput.java new file mode 100644 index 00000000000..5f92199e9b9 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentEventInput.java @@ -0,0 +1,98 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_v3_detect_intent_event_input] + +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.dialogflow.cx.v3.DetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3.DetectIntentResponse; +import com.google.cloud.dialogflow.cx.v3.EventInput; +import com.google.cloud.dialogflow.cx.v3.QueryInput; +import com.google.cloud.dialogflow.cx.v3.QueryResult; +import com.google.cloud.dialogflow.cx.v3.SessionName; +import com.google.cloud.dialogflow.cx.v3.SessionsClient; +import com.google.cloud.dialogflow.cx.v3.SessionsSettings; +import java.io.IOException; + +public class DetectIntentEventInput { + + // DialogFlow API Detect Intent sample with Event input. + public static void main(String[] args) throws IOException, ApiException { + String projectId = "my-project-id"; + String locationId = "global"; + String agentId = "my-agent-id"; + String sessionId = "my-UUID"; + String event = "my-event-id"; + String languageCode = "en"; + + detectIntent(projectId, locationId, agentId, sessionId, event, languageCode); + } + + public static void detectIntent( + String projectId, + String locationId, + String agentId, + String sessionId, + String event, + String languageCode) + throws IOException, ApiException { + + SessionsSettings.Builder sessionsSettingsBuilder = SessionsSettings.newBuilder(); + if (locationId.equals("global")) { + sessionsSettingsBuilder.setEndpoint("dialogflow.googleapis.com:443"); + } else { + sessionsSettingsBuilder.setEndpoint(locationId + "-dialogflow.googleapis.com:443"); + } + SessionsSettings sessionsSettings = sessionsSettingsBuilder.build(); + + // Instantiates a client by setting the session name. + // Format:`projects//locations//agents//sessions/` + try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { + SessionName session = + SessionName.ofProjectLocationAgentSessionName(projectId, locationId, agentId, sessionId); + + // TODO : Uncomment if you want to print session path + // System.out.println("Session Path: " + session.toString()); + + EventInput.Builder eventInput = EventInput.newBuilder().setEvent(event); + + // Build the query with the EventInput and language code (en-US). + QueryInput queryInput = + QueryInput.newBuilder().setEvent(eventInput).setLanguageCode(languageCode).build(); + + // Build the DetectIntentRequest with the SessionName and QueryInput. + DetectIntentRequest request = + DetectIntentRequest.newBuilder() + .setSession(session.toString()) + .setQueryInput(queryInput) + .build(); + + // Performs the detect intent request. + DetectIntentResponse response = sessionsClient.detectIntent(request); + + // Display the query result. + QueryResult queryResult = response.getQueryResult(); + + // TODO : Uncomment if you want to print queryResult + System.out.println("===================="); + System.out.format("Triggering Event: %s \n", queryResult.getTriggerEvent()); + } + } +} + +// [END dialogflow_cx_v3_detect_intent_event_input] diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentIntentInput.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentIntentInput.java new file mode 100644 index 00000000000..45af3c56795 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentIntentInput.java @@ -0,0 +1,100 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_v3_detect_intent_intent_input] + +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.dialogflow.cx.v3.DetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3.DetectIntentResponse; +import com.google.cloud.dialogflow.cx.v3.IntentInput; +import com.google.cloud.dialogflow.cx.v3.QueryInput; +import com.google.cloud.dialogflow.cx.v3.QueryResult; +import com.google.cloud.dialogflow.cx.v3.SessionName; +import com.google.cloud.dialogflow.cx.v3.SessionsClient; +import com.google.cloud.dialogflow.cx.v3.SessionsSettings; +import java.io.IOException; + +public class DetectIntentIntentInput { + + // DialogFlow API Detect Intent sample with Intent input. + public static void main(String[] args) throws IOException, ApiException { + String projectId = "my-project-id"; + String locationId = "global"; + String agentId = "my-agent-id"; + String sessionId = "my-UUID"; + String intent = "my-intent-id"; + String languageCode = "en"; + + detectIntent(projectId, locationId, agentId, sessionId, intent, languageCode); + } + + public static void detectIntent( + String projectId, + String locationId, + String agentId, + String sessionId, + String intent, + String languageCode) + throws IOException, ApiException { + + SessionsSettings.Builder sessionsSettingsBuilder = SessionsSettings.newBuilder(); + if (locationId.equals("global")) { + sessionsSettingsBuilder.setEndpoint("dialogflow.googleapis.com:443"); + } else { + sessionsSettingsBuilder.setEndpoint(locationId + "-dialogflow.googleapis.com:443"); + } + SessionsSettings sessionsSettings = sessionsSettingsBuilder.build(); + + // Instantiates a client by setting the session name. + // Format:`projects//locations//agents//sessions/` + try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { + SessionName session = + SessionName.ofProjectLocationAgentSessionName(projectId, locationId, agentId, sessionId); + + // TODO : Uncomment if you want to print session path + // System.out.println("Session Path: " + session.toString()); + + IntentInput.Builder intentInput = IntentInput.newBuilder().setIntent(intent); + + // Build the query with the IntentInput and language code (en-US). + QueryInput queryInput = + QueryInput.newBuilder().setIntent(intentInput).setLanguageCode(languageCode).build(); + + // Build the DetectIntentRequest with the SessionName and QueryInput. + DetectIntentRequest request = + DetectIntentRequest.newBuilder() + .setSession(session.toString()) + .setQueryInput(queryInput) + .build(); + + // Performs the detect intent request. + DetectIntentResponse response = sessionsClient.detectIntent(request); + + // Display the query result. + QueryResult queryResult = response.getQueryResult(); + + // TODO : Uncomment if you want to print queryResult + System.out.println("===================="); + System.out.format( + "Detected Intent: %s (confidence: %f)\n", + queryResult.getIntent().getDisplayName(), queryResult.getIntentDetectionConfidence()); + } + } +} + +// [END dialogflow_cx_v3_detect_intent_intent_input] diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSentimentAnalysis.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSentimentAnalysis.java new file mode 100644 index 00000000000..318242c4fb5 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSentimentAnalysis.java @@ -0,0 +1,117 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_v3_detect_intent_sentiment_analysis] + +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.dialogflow.cx.v3.DetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3.DetectIntentResponse; +import com.google.cloud.dialogflow.cx.v3.QueryInput; +import com.google.cloud.dialogflow.cx.v3.QueryParameters; +import com.google.cloud.dialogflow.cx.v3.QueryResult; +import com.google.cloud.dialogflow.cx.v3.SessionName; +import com.google.cloud.dialogflow.cx.v3.SessionsClient; +import com.google.cloud.dialogflow.cx.v3.SessionsSettings; +import com.google.cloud.dialogflow.cx.v3.TextInput; +import com.google.common.collect.Maps; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class DetectIntentSentimentAnalysis { + + public static void main(String[] args) throws IOException, ApiException { + String projectId = "my-project-id"; + String locationId = "global"; + String agentId = "my-agent-id"; + String sessionId = "my-UUID"; + List texts = new ArrayList<>(List.of("my-list", "of-texts")); + String languageCode = "en"; + + detectIntent(projectId, locationId, agentId, sessionId, texts, languageCode); + } + + // DialogFlow API Detect Intent sample with sentiment analysis. + public static Map detectIntent( + String projectId, + String locationId, + String agentId, + String sessionId, + List texts, + String languageCode) + throws IOException, ApiException { + SessionsSettings.Builder sessionsSettingsBuilder = SessionsSettings.newBuilder(); + if (locationId.equals("global")) { + sessionsSettingsBuilder.setEndpoint("dialogflow.googleapis.com:443"); + } else { + sessionsSettingsBuilder.setEndpoint(locationId + "-dialogflow.googleapis.com:443"); + } + SessionsSettings sessionsSettings = sessionsSettingsBuilder.build(); + + Map queryResults = Maps.newHashMap(); + + // Instantiates a client by setting the session name. + // Format:`projects//locations//agents//sessions/` + try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { + SessionName session = + SessionName.ofProjectLocationAgentSessionName(projectId, locationId, agentId, sessionId); + + // TODO : Uncomment if you want to print session path + // System.out.println("Session Path: " + session.toString()); + + // Detect intents for each text input. + for (String text : texts) { + // Set the text (hello) for the query. + TextInput.Builder textInput = TextInput.newBuilder().setText(text); + + // Build the query with the TextInput and language code (en-US). + QueryInput queryInput = + QueryInput.newBuilder().setText(textInput).setLanguageCode(languageCode).build(); + + // Build the query parameters to analyze the sentiment of the query. + QueryParameters queryParameters = + QueryParameters.newBuilder().setAnalyzeQueryTextSentiment(true).build(); + + // Build the DetectIntentRequest with the SessionName, QueryInput, and QueryParameters. + DetectIntentRequest request = + DetectIntentRequest.newBuilder() + .setSession(session.toString()) + .setQueryInput(queryInput) + .setQueryParams(queryParameters) + .build(); + + // Performs the detect intent request. + DetectIntentResponse response = sessionsClient.detectIntent(request); + + // Display the query result. + QueryResult queryResult = response.getQueryResult(); + + // TODO : Uncomment if you want to print queryResult + // System.out.println("===================="); + // SentimentAnalysisResult sentimentAnalysisResult = + // queryResult.getSentimentAnalysisResult(); + // Float score = sentimentAnalysisResult.getScore(); + + queryResults.put(text, queryResult); + } + } + return queryResults; + } +} +// [END dialogflow_cx_v3_detect_intent_sentiment_analysis] diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java index b09609aea45..96b1799a5bd 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java @@ -53,11 +53,10 @@ public static void detectIntentStream( } SessionsSettings sessionsSettings = sessionsSettingsBuilder.build(); - // Instantiates a client + // Instantiates a client by setting the session name. + // Format: `projects//locations//agents//sessions/` + // Using the same `sessionId` between requests allows continuation of the conversation. try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { - // Set the session name using the projectID (my-project-id), locationID (global), agentID - // (UUID), and sessionId (UUID). - // Using the same `sessionId` between requests allows continuation of the conversation. SessionName session = SessionName.of(projectId, locationId, agentId, sessionId); // Instructs the speech recognizer how to process the audio content. diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStreamingPartialResponse.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStreamingPartialResponse.java new file mode 100644 index 00000000000..81cb534e285 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStreamingPartialResponse.java @@ -0,0 +1,154 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_v3_detect_intent_streaming_partial_response] + +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.dialogflow.cx.v3.AudioEncoding; +import com.google.cloud.dialogflow.cx.v3.AudioInput; +import com.google.cloud.dialogflow.cx.v3.InputAudioConfig; +import com.google.cloud.dialogflow.cx.v3.OutputAudioConfig; +import com.google.cloud.dialogflow.cx.v3.OutputAudioEncoding; +import com.google.cloud.dialogflow.cx.v3.QueryInput; +import com.google.cloud.dialogflow.cx.v3.SessionName; +import com.google.cloud.dialogflow.cx.v3.SessionsClient; +import com.google.cloud.dialogflow.cx.v3.SessionsSettings; +import com.google.cloud.dialogflow.cx.v3.SsmlVoiceGender; +import com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse; +import com.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig; +import com.google.cloud.dialogflow.cx.v3.VoiceSelectionParams; +import com.google.protobuf.ByteString; +import java.io.FileInputStream; +import java.io.IOException; + +public class DetectIntentStreamingPartialResponse { + + // DialogFlow API Detect Intent sample with audio files + // that processes as an audio stream. + public static void detectIntentStreamingPartialResponse( + String projectId, String locationId, String agentId, String sessionId, String audioFilePath) + throws ApiException, IOException { + SessionsSettings.Builder sessionsSettingsBuilder = SessionsSettings.newBuilder(); + if (locationId.equals("global")) { + sessionsSettingsBuilder.setEndpoint("dialogflow.googleapis.com:443"); + } else { + sessionsSettingsBuilder.setEndpoint(locationId + "-dialogflow.googleapis.com:443"); + } + SessionsSettings sessionsSettings = sessionsSettingsBuilder.build(); + + // Instantiates a client by setting the session name. + // Format:`projects//locations//agents//sessions/` + // Using the same `sessionId` between requests allows continuation of the conversation. + try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { + SessionName session = SessionName.of(projectId, locationId, agentId, sessionId); + + // Instructs the speech recognizer how to process the audio content. + // Note: hard coding audioEncoding and sampleRateHertz for simplicity. + // Audio encoding of the audio content sent in the query request. + InputAudioConfig inputAudioConfig = + InputAudioConfig.newBuilder() + .setAudioEncoding(AudioEncoding.AUDIO_ENCODING_LINEAR_16) + .setSampleRateHertz(16000) // sampleRateHertz = 16000 + .build(); + + // Build the AudioInput with the InputAudioConfig. + AudioInput audioInput = AudioInput.newBuilder().setConfig(inputAudioConfig).build(); + + // Build the query with the InputAudioConfig. + QueryInput queryInput = + QueryInput.newBuilder() + .setAudio(audioInput) + .setLanguageCode("en-US") // languageCode = "en-US" + .build(); + + // Create the Bidirectional stream + BidiStream bidiStream = + sessionsClient.streamingDetectIntentCallable().call(); + + // Specify sssml name and gender + VoiceSelectionParams voiceSelection = + // Voices that are available https://cloud.google.com/text-to-speech/docs/voices + VoiceSelectionParams.newBuilder() + .setName("en-GB-Standard-A") + .setSsmlGender(SsmlVoiceGender.SSML_VOICE_GENDER_FEMALE) + .build(); + + SynthesizeSpeechConfig speechConfig = + SynthesizeSpeechConfig.newBuilder().setVoice(voiceSelection).build(); + + // Setup audio config + OutputAudioConfig audioConfig = + // Output encoding explanation + // https://cloud.google.com/dialogflow/cx/docs/reference/rpc/google.cloud.dialogflow.cx.v3#outputaudioencoding + OutputAudioConfig.newBuilder() + .setAudioEncoding(OutputAudioEncoding.OUTPUT_AUDIO_ENCODING_UNSPECIFIED) + .setAudioEncodingValue(1) + .setSynthesizeSpeechConfig(speechConfig) + .build(); + + StreamingDetectIntentRequest streamingDetectIntentRequest = + StreamingDetectIntentRequest.newBuilder() + .setSession(session.toString()) + .setQueryInput(queryInput) + .setEnablePartialResponse(true) + .setOutputAudioConfig(audioConfig) + .build(); + System.out.println(streamingDetectIntentRequest.toString()); + + // The first request must **only** contain the audio configuration: + bidiStream.send(streamingDetectIntentRequest); + + try (FileInputStream audioStream = new FileInputStream(audioFilePath)) { + // Subsequent requests must **only** contain the audio data. + // Following messages: audio chunks. We just read the file in fixed-size chunks. In reality + // you would split the user input by time. + byte[] buffer = new byte[4096]; + int bytes; + while ((bytes = audioStream.read(buffer)) != -1) { + AudioInput subAudioInput = + AudioInput.newBuilder().setAudio(ByteString.copyFrom(buffer, 0, bytes)).build(); + QueryInput subQueryInput = + QueryInput.newBuilder() + .setAudio(subAudioInput) + .setLanguageCode("en-US") // languageCode = "en-US" + .build(); + bidiStream.send( + StreamingDetectIntentRequest.newBuilder().setQueryInput(subQueryInput).build()); + } + } + + // Tell the service you are done sending data. + bidiStream.closeSend(); + + // TODO: Uncomment to print detectIntentResponse. + + // for (StreamingDetectIntentResponse response : bidiStream) { + // QueryResult queryResult = response.getDetectIntentResponse().getQueryResult(); + // System.out.println("===================="); + // System.out.format("Query Text: '%s'\n", queryResult.getTranscript()); + // System.out.format( + // "Detected Intent: %s (confidence: %f)\n", + // queryResult.getIntent() + // .getDisplayName(), queryResult.getIntentDetectionConfidence()); + // } + } + } +} +// [END dialogflow_cx_v3_detect_intent_streaming_partial_response] diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSynthesizeTextToSpeechOutput.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSynthesizeTextToSpeechOutput.java new file mode 100644 index 00000000000..d26437eefff --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSynthesizeTextToSpeechOutput.java @@ -0,0 +1,131 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// [START dialogflow_cx_v3_detect_intent_synthesize_tts_output] + +import com.google.api.gax.rpc.ApiException; +import com.google.cloud.dialogflow.cx.v3.AudioEncoding; +import com.google.cloud.dialogflow.cx.v3.AudioInput; +import com.google.cloud.dialogflow.cx.v3.DetectIntentRequest; +import com.google.cloud.dialogflow.cx.v3.DetectIntentResponse; +import com.google.cloud.dialogflow.cx.v3.InputAudioConfig; +import com.google.cloud.dialogflow.cx.v3.OutputAudioConfig; +import com.google.cloud.dialogflow.cx.v3.OutputAudioEncoding; +import com.google.cloud.dialogflow.cx.v3.QueryInput; +import com.google.cloud.dialogflow.cx.v3.SessionName; +import com.google.cloud.dialogflow.cx.v3.SessionsClient; +import com.google.cloud.dialogflow.cx.v3.SessionsSettings; +import com.google.cloud.dialogflow.cx.v3.SynthesizeSpeechConfig; +import com.google.protobuf.ByteString; +import java.io.FileInputStream; +import java.io.IOException; + +public class DetectIntentSynthesizeTextToSpeechOutput { + + // DialogFlow API Detect Intent sample with synthesize TTS output. + public static void main(String[] args) throws IOException, ApiException { + String projectId = "my-project-id"; + String locationId = "my-location-id"; + String agentId = "my-agent-id"; + String audioFileName = "my-audio-file-name"; + int sampleRateHertz = 16000; + String sessionId = "my-session-id"; + String languageCode = "my-language-code"; + + detectIntent( + projectId, locationId, agentId, audioFileName, sampleRateHertz, sessionId, languageCode); + } + + public static void detectIntent( + String projectId, + String locationId, + String agentId, + String audioFileName, + int sampleRateHertz, + String sessionId, + String languageCode) + throws IOException, ApiException { + + SessionsSettings.Builder sessionsSettingsBuilder = SessionsSettings.newBuilder(); + if (locationId.equals("global")) { + sessionsSettingsBuilder.setEndpoint("dialogflow.googleapis.com:443"); + } else { + sessionsSettingsBuilder.setEndpoint(locationId + "-dialogflow.googleapis.com:443"); + } + SessionsSettings sessionsSettings = sessionsSettingsBuilder.build(); + + // Instantiates a client by setting the session name. + // Format:`projects//locations//agents//sessions/` + try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { + SessionName session = + SessionName.ofProjectLocationAgentSessionName(projectId, locationId, agentId, sessionId); + + // TODO : Uncomment if you want to print session path + // System.out.println("Session Path: " + session.toString()); + InputAudioConfig inputAudioConfig = + InputAudioConfig.newBuilder() + .setAudioEncoding(AudioEncoding.AUDIO_ENCODING_LINEAR_16) + .setSampleRateHertz(sampleRateHertz) + .build(); + + try (FileInputStream audioStream = new FileInputStream(audioFileName)) { + // Subsequent requests must **only** contain the audio data. + // Following messages: audio chunks. We just read the file in fixed-size chunks. In reality + // you would split the user input by time. + byte[] buffer = new byte[4096]; + int bytes = audioStream.read(buffer); + AudioInput audioInput = + AudioInput.newBuilder() + .setAudio(ByteString.copyFrom(buffer, 0, bytes)) + .setConfig(inputAudioConfig) + .build(); + QueryInput queryInput = + QueryInput.newBuilder() + .setAudio(audioInput) + .setLanguageCode("en-US") // languageCode = "en-US" + .build(); + + SynthesizeSpeechConfig speechConfig = + SynthesizeSpeechConfig.newBuilder().setSpeakingRate(1.25).setPitch(10.0).build(); + + OutputAudioConfig outputAudioConfig = + OutputAudioConfig.newBuilder() + .setAudioEncoding(OutputAudioEncoding.OUTPUT_AUDIO_ENCODING_LINEAR_16) + .setSynthesizeSpeechConfig(speechConfig) + .build(); + + DetectIntentRequest request = + DetectIntentRequest.newBuilder() + .setSession(session.toString()) + .setQueryInput(queryInput) + .setOutputAudioConfig(outputAudioConfig) + .build(); + + // Performs the detect intent request. + DetectIntentResponse response = sessionsClient.detectIntent(request); + + // Display the output audio config retrieved from the response. + OutputAudioConfig audioConfigFromResponse = response.getOutputAudioConfig(); + + System.out.println("===================="); + System.out.format("Output Audio Config: %s \n", audioConfigFromResponse.toString()); + } + } + } +} +// [END dialogflow_cx_v3_detect_intent_synthesize_tts_output] diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentAudioInputTest.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentAudioInputTest.java new file mode 100644 index 00000000000..ffe3619149d --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentAudioInputTest.java @@ -0,0 +1,72 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.UUID; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** Unit test for {@link DetectIntentIntentAudioInput}. */ +@SuppressWarnings("checkstyle:abbreviationaswordinname") +public class DetectIntentAudioInputTest { + + private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static String LOCATION = "global"; + private static String AGENT_ID = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_GLOBAL", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String AUDIO_FILE_NAME = "resources/book_a_room.wav"; + private static int SAMPLE_RATE_HERTZ = 16000; + private static String SESSION_ID = UUID.randomUUID().toString(); + private static String LANGUAGE_CODE = "en"; + + private ByteArrayOutputStream stdOut; + + @Before + public void setUp() throws IOException { + + stdOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(stdOut)); + } + + @After + public void tearDown() throws IOException { + stdOut = null; + System.setOut(null); + } + + @Test + public void testDetectIntentAudioInput() throws Exception { + + DetectIntentAudioInput.detectIntent( + PROJECT_ID, + LOCATION, + AGENT_ID, + AUDIO_FILE_NAME, + SAMPLE_RATE_HERTZ, + SESSION_ID, + LANGUAGE_CODE); + System.out.println(stdOut.toString()); + assertThat(stdOut.toString()).contains("Detected Intent:"); + } +} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentDisableWebhookTest.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentDisableWebhookTest.java new file mode 100644 index 00000000000..3564ed1cc2f --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentDisableWebhookTest.java @@ -0,0 +1,74 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.dialogflow.cx.v3.QueryResult; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** Unit test for {@link DetectIntentDisableWebhook}. */ +@SuppressWarnings("checkstyle:abbreviationaswordinname") +public class DetectIntentDisableWebhookTest { + + private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static String LOCATION = "global"; + private static String AGENT_ID = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_GLOBAL", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String SESSION_ID = UUID.randomUUID().toString(); + private static String LANGUAGE_CODE = "en-US"; + private static List TEXTS = Arrays.asList("hello", "unhappy"); + + private ByteArrayOutputStream stdOut; + + @Before + public void setUp() throws IOException { + + stdOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(stdOut)); + } + + @After + public void tearDown() throws IOException { + stdOut = null; + System.setOut(null); + } + + @Test + public void testDetectIntentDisableWebhook() throws Exception { + Map queryResults = + DetectIntentDisableWebhook.detectIntent( + PROJECT_ID, LOCATION, AGENT_ID, SESSION_ID, TEXTS, LANGUAGE_CODE); + + for (int i = 0; i < TEXTS.size(); i++) { + String text = TEXTS.get(i); + float score = queryResults.get(text).getSentimentAnalysisResult().getScore(); + System.out.println(stdOut.toString()); + assertThat(stdOut.toString()).contains("disable_webhook"); + } + } +} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentEventInputTest.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentEventInputTest.java new file mode 100644 index 00000000000..f6362519411 --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentEventInputTest.java @@ -0,0 +1,66 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.UUID; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** Unit test for {@link DetectIntentEventInput}. */ +@SuppressWarnings("checkstyle:abbreviationaswordinname") +public class DetectIntentEventInputTest { + + private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static String LOCATION = "global"; + private static String AGENT_ID = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_GLOBAL", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String EVENT = "sys.no-match-default"; + private static String SESSION_ID = UUID.randomUUID().toString(); + private static String LANGUAGE_CODE = "en-US"; + + private ByteArrayOutputStream stdOut; + + @Before + public void setUp() throws IOException { + + stdOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(stdOut)); + } + + @After + public void tearDown() throws IOException { + stdOut = null; + System.setOut(null); + } + + @Test + public void testDetectIntentEventInput() throws Exception { + String triggeringEvent = "sys.no-match-default"; + + DetectIntentEventInput.detectIntent( + PROJECT_ID, LOCATION, AGENT_ID, SESSION_ID, EVENT, LANGUAGE_CODE); + System.out.println(stdOut.toString()); + assertThat(stdOut.toString()).contains(triggeringEvent); + } +} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java index 2d85f6dc973..66d356a9b2d 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIT.java @@ -28,7 +28,7 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -/** Integration (system) tests for {@link DetectIntent}. */ +/** Integration (system) tests for {@link DetectIntentText}. */ @RunWith(JUnit4.class) @SuppressWarnings("checkstyle:abbreviationaswordinname") public class DetectIntentIT { diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIntentInputTest.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIntentInputTest.java new file mode 100644 index 00000000000..51dc3a560f8 --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentIntentInputTest.java @@ -0,0 +1,75 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.UUID; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** Unit test for {@link DetectIntentIntentInput}. */ +@SuppressWarnings("checkstyle:abbreviationaswordinname") +public class DetectIntentIntentInputTest { + + private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static String LOCATION = "global"; + private static String AGENT_ID = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_GLOBAL", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String INTENT_ID = "00000000-0000-0000-0000-000000000000"; + private static String SESSION_ID = UUID.randomUUID().toString(); + private static String LANGUAGE_CODE = "en-US"; + private static String INTENT = + "projects/" + + PROJECT_ID + + "/locations/" + + LOCATION + + "/agents/" + + AGENT_ID + + "/intents/" + + INTENT_ID; + + private ByteArrayOutputStream stdOut; + + @Before + public void setUp() throws IOException { + + stdOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(stdOut)); + } + + @After + public void tearDown() throws IOException { + stdOut = null; + System.setOut(null); + } + + @Test + public void testDetectIntentIntentInput() throws Exception { + String intentName = "Default Welcome Intent"; + + DetectIntentIntentInput.detectIntent( + PROJECT_ID, LOCATION, AGENT_ID, SESSION_ID, INTENT, LANGUAGE_CODE); + System.out.println(stdOut.toString()); + assertThat(stdOut.toString()).contains(intentName); + } +} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentSentimentAnalysisTest.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentSentimentAnalysisTest.java new file mode 100644 index 00000000000..2194a9e70b8 --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentSentimentAnalysisTest.java @@ -0,0 +1,56 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static org.junit.Assert.assertTrue; + +import com.google.cloud.dialogflow.cx.v3.QueryResult; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.junit.Test; + +/** Unit test for {@link DetectIntentSentimentAnalysis}. */ +@SuppressWarnings("checkstyle:abbreviationaswordinname") +public class DetectIntentSentimentAnalysisTest { + + private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static String LOCATION = "global"; + private static String AGENT_ID = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_GLOBAL", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String SESSION_ID = UUID.randomUUID().toString(); + private static String LANGUAGE_CODE = "en-US"; + private static List TEXTS = Arrays.asList("hello", "unhappy"); + + @Test + public void testDetectIntentSentimentAnalysis() throws Exception { + int min = -1; + int max = 1; + + Map queryResults = + DetectIntentSentimentAnalysis.detectIntent( + PROJECT_ID, LOCATION, AGENT_ID, SESSION_ID, TEXTS, LANGUAGE_CODE); + + for (int i = 0; i < TEXTS.size(); i++) { + String text = TEXTS.get(i); + float score = queryResults.get(text).getSentimentAnalysisResult().getScore(); + assertTrue(min <= score && score <= max); + } + } +} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamingPartialResponseTest.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamingPartialResponseTest.java new file mode 100644 index 00000000000..7f6f24a2ee4 --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentStreamingPartialResponseTest.java @@ -0,0 +1,68 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.UUID; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** Integration (system) tests for {@link DetectIntentStream}. */ +@RunWith(JUnit4.class) +@SuppressWarnings("checkstyle:abbreviationaswordinname") +public class DetectIntentStreamingPartialResponseTest { + + private static String AUDIO_FILE_PATH = "resources/book_a_room.wav"; + private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static String LOCATION = "global"; + private static String AGENT_ID = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_GLOBAL", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String SESSION_ID = UUID.randomUUID().toString(); + private ByteArrayOutputStream bout; + private PrintStream original; + + @Before + public void setUp() { + original = System.out; + bout = new ByteArrayOutputStream(); + System.setOut(new PrintStream(bout)); + } + + @After + public void tearDown() { + System.setOut(original); + bout.reset(); + } + + @Test + public void testDetectIntentStreamingPartialResponse() throws IOException { + DetectIntentStreamingPartialResponse.detectIntentStreamingPartialResponse( + PROJECT_ID, LOCATION, AGENT_ID, SESSION_ID, AUDIO_FILE_PATH); + + String output = bout.toString(); + + assertThat(output).contains("enable_partial_response"); + } +} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentSynthesizeTextToSpeechOutputTest.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentSynthesizeTextToSpeechOutputTest.java new file mode 100644 index 00000000000..20d84e37a1e --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/DetectIntentSynthesizeTextToSpeechOutputTest.java @@ -0,0 +1,72 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.UUID; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** Unit test for {@link DetectIntentSynthesizeTtSOutput}. */ +@SuppressWarnings("checkstyle:abbreviationaswordinname") +public class DetectIntentSynthesizeTextToSpeechOutputTest { + + private static String PROJECT_ID = System.getenv("GOOGLE_CLOUD_PROJECT"); + private static String LOCATION = "global"; + private static String AGENT_ID = + System.getenv() + .getOrDefault("DIALOGFLOW_CX_AGENT_ID_GLOBAL", "b8d0e85d-0741-4e6d-a66a-3671184b7b93"); + private static String AUDIO_FILE_NAME = "resources/book_a_room.wav"; + private static int SAMPLE_RATE_HERTZ = 16000; + private static String SESSION_ID = UUID.randomUUID().toString(); + private static String LANGUAGE_CODE = "en"; + + private ByteArrayOutputStream stdOut; + + @Before + public void setUp() throws IOException { + + stdOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(stdOut)); + } + + @After + public void tearDown() throws IOException { + stdOut = null; + System.setOut(null); + } + + @Test + public void testDetectIntentSynthesizeTextToSpeechOutput() throws Exception { + + DetectIntentSynthesizeTextToSpeechOutput.detectIntent( + PROJECT_ID, + LOCATION, + AGENT_ID, + AUDIO_FILE_NAME, + SAMPLE_RATE_HERTZ, + SESSION_ID, + LANGUAGE_CODE); + System.out.println(stdOut.toString()); + assertThat(stdOut.toString()).contains("speaking_rate"); + } +} From 7bced2ccce2cc9eab2ecbac58e6b3871d15e14e7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 12 Jul 2022 16:06:23 +0200 Subject: [PATCH 58/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.14.0 (#493) --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 5c723ddd6e3..ad752f8e9df 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.13.0 + 0.14.0 com.google.code.gson From 1bba4dec1558c42cafe379d7b3b6ceb5f22da3ea Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 13 Jul 2022 20:16:57 +0200 Subject: [PATCH 59/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.14.1 (#514) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.14.1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index ad752f8e9df..017cefb791b 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.14.0 + 0.14.1 com.google.code.gson From de67b0d695162661887f08ada438cd1435fdd00c Mon Sep 17 00:00:00 2001 From: aribray <45905583+aribray@users.noreply.github.com> Date: Sat, 16 Jul 2022 13:00:40 -0500 Subject: [PATCH 60/73] docs(samples): add webhook samples (#479) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs:add configure webhook to set form parameter as optional or required sample and test Change-Id: I75bed489bd8abefca60263acb266501810c0e856 * docs: fix checkstyle Change-Id: I18be2a5c1d46ac9838cf4a15ab87dcf331ee26ee * fix checkstyle Change-Id: Ia85899f678ef1382718c2443a682770417340af2 * fix checkstyle Change-Id: I4dd56107a3197027f287980fa87a15e962154783 * fix multiline string Change-Id: I8dcdb0dcaad486a2fb69e0737df99bda49b28839 * fix checkstyle violations Change-Id: I5f4521b3e50660f30f9f73da3d939da213084d28 * fix checkstyle violations Change-Id: I39dedfba1b62be5cb4580a42dde270146f3b6f97 * remove unused variable Change-Id: Ic54ae0d1f091079661f3fa67097cdcd2e888dc90 * fix checkstyle violations Change-Id: Ifd303b7395844240dca0b29cde9b791112fcabe5 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix checkstyle violations Change-Id: I59e45da9f9e57b327a527f1405816ac1275fe1c8 * fix checkstyle violations Change-Id: I70ff4118cc8b3111a3ed55a2fae32258d3f6819c * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * remove unnecessary samples Change-Id: I395dd5abc9a48733126ab0ecdc2a974fbf9eb471 * add webhook configure session parameter sample and test Change-Id: Ia599ab7f4d432477d9952b4e12c709845f1ad97b * add webhook validate form parameter sample and test Change-Id: I8cdf93fd9e21161757d198b1338c5ab77bb3a236 * fix checkstyle violations Change-Id: I90f1f626588fd59c116d119348054c914945cd1d * fix checkstyle violations Change-Id: I5ff686ab2ffc94b358bdf87b8dfc3d00f5e45657 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update to use gson Change-Id: I6f645ff225e42a3485773af1b63e7b3378f95bb2 * update to use gson Change-Id: I155a40ae8def8472b3e08551fc3dc112b06c68ec * update webhook-optional-or-required to use gson Change-Id: I6b4c19023982668c9c5d0c901bb72c41d3ca7457 * update test Change-Id: I43ce833251dadfbc9e6c3e652ff1f278a2f7c2f2 * update to use gson Change-Id: I509e163dcb69161ad8c18147bd2116b7014d4aef * fix checkstyle violations Change-Id: I2f882c298379630b71dbb533173ec3cc9ca4aee1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * v3beta1 to v3 Change-Id: If9d465d862ca5c7ae7f5e1fb03a5b09c878997a8 * add flag to kokoro build script Change-Id: Ib5c9ccd81e1e6fabe1ed79fe6d3c96f455480c16 * remove flag Change-Id: Ie1fc788f64c6dc14763f0c2df3ac9327ee7a1044 * add flag to kokoro build script Change-Id: Ie7821b49ea0b954fdcf6ad7f0a5efd57c865c20c * remove flag Change-Id: I3ae6982f6a4f8dc3b2b4e5a404e5e46c8c8d6aaa * add kokoro flag Change-Id: Id7a7aae81cd43d920fa1fe750fb259b0d2ea0581 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add kokoro flag Change-Id: I3a4733a05b86a135642c4667a52ab7b09f462559 * fix formatting Change-Id: I491c924ed2fc6dff078f1d7944a3590a24b7530f * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * remove extra gson Change-Id: I7f6b52e600a8b2513f59560fe3e727dd5d822319 * fix formatting Change-Id: Icb1ff15957d93fab961b49f05492282c4363fdcd * fix formatting Change-Id: Iabb1e248e03bd5300b9aad10e0504d8d96ea564b * fix formatting Change-Id: Icd6976bd8fc1795accfda722e00270aebf69fa43 * restructure json format Change-Id: I1e919a48b857e4bb4e33fb26265ec7320b1ece24 * restructure json format Change-Id: Ib36de1d54869dad920e1743834be56a84d8398ba * restructure json format Change-Id: I5c7be6894f91e26a8b59a46635a65953728ae591 * restructure mockito stubbing Change-Id: Id67943d85113ba436844fe5b6a39593a030a89cb * restructure mockito stubbing Change-Id: Ib1df6375ec71353f4ab62bf83c6ff7712da59acb * restructure mockito stubbing Change-Id: I3243a7b5b70010d9f181039983bdeb35098c72b2 * restructure mockito stubbing Change-Id: Idd80a7b9a29f0daaabc866b35b685efff1a80f94 * restructure mocks and variables Change-Id: I2faa86d33aaf5d0b8a9941779f2b17934e848c74 * restructure mocks and variables Change-Id: I9accbd7282c92b409c619e717cc05aa694d6e3e7 * restructure mocks and variables Change-Id: I03bdc68502f8deff333e68cd3fb36d080a9f44ca * fix variable names Change-Id: Ic196c389141e834c4d7cc54531de808b0c941801 * fix variable names Change-Id: I5d4ce6132bfdfb1d709e589eaff060520da8fcc0 * remove unnecessary mock Change-Id: Ibff1531d1a6e6de27fee6e409d005d657ad2c86d * remove static Change-Id: Ie67fd74d024957fc8584794f30ccc1f953fb39e4 * add annotations Change-Id: I727e43c0b98c4641414d950658e78c5c30b66506 * add annotations Change-Id: Ib594629756b704a701739188e2d59c0273d68a8f * add runwith import Change-Id: I32b0746e89b2131106ef965b1712981633b8488f * restructure test and mocks Change-Id: I5bdf09bd4c262c20ec84ad4255170b084c0caa69 * fix imports Change-Id: I48b1628e4f60372a767c354dcd78e9c1b3e0f415 * fix imports Change-Id: Icbc59fc1d313a7224c2d472b49ca144f217bbf77 * fix imports Change-Id: I2591dbdd32e3f97e7f61f38d88e222ed11418c25 * rename test files Change-Id: Ifcd47fd1d94f7064a0fa178a36fe3e803a8bb234 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix imports Change-Id: I65c7c53359c87b0c00afe02871f5405ce629d996 * add variable Change-Id: I140b08fdb80654140055e292057c0ddc74d23921 * remove json files and fix checkstyle Change-Id: Idf77efee6e42f430efab1c9aae662756d4feb92c * make public Change-Id: I6bfaf4c002f513b3e517394d745c1548f886de77 * remove print Change-Id: Iff827980844223c3323db37df587a075c1f226c5 * add flag to kokoro build script Change-Id: I7a2d667a3460a59963b592d1504d0a465cc03565 * add mock Change-Id: Iec351ef910c551a5a511454ad8edf3da6aec0734 * move mocks Change-Id: Ic1b22fd72c7e624bff8f19767ce5b15f44356e7d * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- ...SetFormParametersAsOptionalOrRequired.java | 84 ++++++++++++++ .../cx/WebhookConfigureSessionParameters.java | 61 ++++++++++ .../cx/WebhookValidateFormParameter.java | 81 ++++++++++++++ ...tFormParametersAsOptionalOrRequiredIT.java | 98 ++++++++++++++++ .../WebhookConfigureSessionParametersIT.java | 86 ++++++++++++++ .../cx/WebhookValidateFormParameterIT.java | 105 ++++++++++++++++++ 6 files changed, 515 insertions(+) create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequired.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookConfigureSessionParameters.java create mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookValidateFormParameter.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequiredIT.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookConfigureSessionParametersIT.java create mode 100644 dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookValidateFormParameterIT.java diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequired.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequired.java new file mode 100644 index 00000000000..2db56b5ded4 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequired.java @@ -0,0 +1,84 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// The following snippet is used in https://cloud.google.com/dialogflow/cx/docs/concept/webhook + +// [START dialogflow_cx_v3_configure_webhooks_to_set_form_parameter_as_optional_or_required] + +// TODO: Change class name to Example +// TODO: Uncomment the line below before running cloud function +// package com.example; + +import com.google.cloud.functions.HttpFunction; +import com.google.cloud.functions.HttpRequest; +import com.google.cloud.functions.HttpResponse; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import java.io.BufferedWriter; + +public class ConfigureWebhookToSetFormParametersAsOptionalOrRequired implements HttpFunction { + @Override + public void service(HttpRequest request, HttpResponse response) throws Exception { + JsonObject parameterObject = new JsonObject(); + parameterObject.addProperty("display_name", "order_number"); + parameterObject.addProperty("required", "true"); + parameterObject.addProperty("state", "VALID"); + + JsonArray parameterInfoList = new JsonArray(); + parameterInfoList.add(parameterObject); + + JsonObject parameterInfoObject = new JsonObject(); + parameterInfoObject.add("parameter_info", parameterInfoList); + + JsonObject formInfo = new JsonObject(); + formInfo.add("form_info", parameterInfoObject); + + // Constructs the webhook response object + JsonObject webhookResponse = new JsonObject(); + webhookResponse.add("page_info", formInfo); + + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + String jsonResponseObject = gson.toJson(webhookResponse); + + System.out.println("Response Object: \n"); + System.out.println(jsonResponseObject.toString()); + + /* { + * "page_info": { + * "form_info": { + * "parameter_info": [ + * { + * "display_name": "order_number", + * "required": "true", + * "state": "VALID" + * } + * ] + * } + * } + * } + */ + + BufferedWriter writer = response.getWriter(); + + // Sends the responseObject + writer.write(jsonResponseObject.toString()); + } +} +// [END dialogflow_cx_v3_configure_webhooks_to_set_form_parameter_as_optional_or_required] diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookConfigureSessionParameters.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookConfigureSessionParameters.java new file mode 100644 index 00000000000..e9c0263141b --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookConfigureSessionParameters.java @@ -0,0 +1,61 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// The following snippet is used in https://cloud.google.com/dialogflow/cx/docs/concept/webhook +// Configures a webhook to set a session parameter + +// [START dialogflow_cx_v3_webhook_configure_session_parameters] + +// TODO: Change class name to Example +// TODO: Uncomment the line below before running cloud function +// package com.example; + +import com.google.cloud.functions.HttpFunction; +import com.google.cloud.functions.HttpRequest; +import com.google.cloud.functions.HttpResponse; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import java.io.BufferedWriter; + +public class WebhookConfigureSessionParameters implements HttpFunction { + @Override + public void service(HttpRequest request, HttpResponse response) throws Exception { + JsonObject orderParameter = new JsonObject(); + orderParameter.addProperty("order_number", "12345"); + + JsonObject parameterObject = new JsonObject(); + parameterObject.add("parameters", orderParameter); + + // Creates webhook response object + JsonObject webhookResponse = new JsonObject(); + webhookResponse.add("session_info", parameterObject); + + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + String jsonResponseObject = gson.toJson(webhookResponse); + + System.out.println("Session Parameter Info: \n"); + System.out.println(jsonResponseObject.toString()); + + /** { "session_info": { "parameters": { "order_number": "12345" } } } */ + BufferedWriter writer = response.getWriter(); + // Sends the webhookResponseObject + writer.write(jsonResponseObject.toString()); + } +} +// [END dialogflow_cx_v3_webhook_configure_session_parameters] diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookValidateFormParameter.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookValidateFormParameter.java new file mode 100644 index 00000000000..fadbef57360 --- /dev/null +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookValidateFormParameter.java @@ -0,0 +1,81 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +// The following snippet is used in https://cloud.google.com/dialogflow/cx/docs/concept/webhook + +// [START dialogflow_cx_v3_configure_webhooks_to_set_form_parameter_as_optional_or_required] + +// TODO: Change class name to Example +// TODO: Uncomment the line below before running cloud function +// package com.example; + +import com.google.cloud.functions.HttpFunction; +import com.google.cloud.functions.HttpRequest; +import com.google.cloud.functions.HttpResponse; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import java.io.BufferedWriter; + +public class WebhookValidateFormParameter implements HttpFunction { + @Override + public void service(HttpRequest request, HttpResponse response) throws Exception { + JsonObject sessionInfo = new JsonObject(); + JsonObject sessionParameter = new JsonObject(); + + sessionParameter.addProperty("order_number", "null"); + sessionInfo.add("parameters", sessionParameter); + + JsonObject parameterObject = new JsonObject(); + parameterObject.addProperty("display_name", "order_number"); + parameterObject.addProperty("required", "true"); + parameterObject.addProperty("state", "INVALID"); + parameterObject.addProperty("value", "123"); + + JsonArray parameterInfoList = new JsonArray(); + parameterInfoList.add(parameterObject); + + JsonObject parameterInfoObject = new JsonObject(); + parameterInfoObject.add("parameter_info", parameterInfoList); + + JsonObject pageInfo = new JsonObject(); + pageInfo.add("form_info", parameterInfoObject); + + // Constructs the webhook response object + JsonObject webhookResponse = new JsonObject(); + webhookResponse.add("page_info", pageInfo); + webhookResponse.add("session_info", sessionInfo); + + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + String jsonResponseObject = gson.toJson(webhookResponse); + + System.out.println("Response Object: \n"); + System.out.println(jsonResponseObject.toString()); + /** + * { "page_info": { "form_info": { "parameter_info": [ { "display_name": "order_number", + * "required": "true", "state": "INVALID", "value": "123" } ] } }, "session_info": { + * "parameters": { "order_number": "null" } } } + */ + BufferedWriter writer = response.getWriter(); + + // Sends the responseObject + writer.write(jsonResponseObject.toString()); + } +} +// [END dialogflow_cx_v3_configure_webhooks_to_set_form_parameter_as_optional_or_required] diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequiredIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequiredIT.java new file mode 100644 index 00000000000..b9a051bf7b0 --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequiredIT.java @@ -0,0 +1,98 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.when; + +import com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo; +import com.google.cloud.functions.HttpRequest; +import com.google.cloud.functions.HttpResponse; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +public class ConfigureWebhookToSetFormParametersAsOptionalOrRequiredIT { + + @Mock HttpRequest request; + @Mock HttpResponse response; + + BufferedReader jsonReader; + StringReader stringReader; + BufferedWriter writerOut; + StringWriter responseOut; + + @Before + public void beforeTest() throws IOException { + MockitoAnnotations.initMocks(this); + + stringReader = new StringReader("{'fulfillmentInfo': {'tag': 'validate-form-parameter'}}"); + jsonReader = new BufferedReader(stringReader); + + responseOut = new StringWriter(); + writerOut = new BufferedWriter(responseOut); + + when(request.getReader()).thenReturn(jsonReader); + when(response.getWriter()).thenReturn(writerOut); + } + + @Test + public void helloHttp_bodyParamsPost() throws IOException, Exception { + + FulfillmentInfo fulfillmentInfo = + FulfillmentInfo.newBuilder().setTag("configure-session-parameters").build(); + + WebhookRequest webhookRequest = + WebhookRequest.newBuilder().setFulfillmentInfo(fulfillmentInfo).build(); + + new ConfigureWebhookToSetFormParametersAsOptionalOrRequired().service(request, response); + writerOut.flush(); + + JsonObject parameterObject = new JsonObject(); + parameterObject.addProperty("display_name", "order_number"); + parameterObject.addProperty("required", "true"); + parameterObject.addProperty("state", "VALID"); + + JsonArray parameterInfoList = new JsonArray(); + parameterInfoList.add(parameterObject); + + JsonObject parameterInfoObject = new JsonObject(); + parameterInfoObject.add("parameter_info", parameterInfoList); + + JsonObject formInfo = new JsonObject(); + formInfo.add("form_info", parameterInfoObject); + + JsonObject webhookResponse = new JsonObject(); + webhookResponse.add("page_info", formInfo); + + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + String expectedResponse = gson.toJson(webhookResponse); + + assertThat(responseOut.toString()).isEqualTo(expectedResponse); + } +} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookConfigureSessionParametersIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookConfigureSessionParametersIT.java new file mode 100644 index 00000000000..52cd6470d73 --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookConfigureSessionParametersIT.java @@ -0,0 +1,86 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.when; + +import com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo; +import com.google.cloud.functions.HttpRequest; +import com.google.cloud.functions.HttpResponse; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +public class WebhookConfigureSessionParametersIT { + + @Mock HttpRequest request; + @Mock HttpResponse response; + + BufferedReader jsonReader; + StringReader stringReader; + BufferedWriter writerOut; + StringWriter responseOut; + + @Before + public void beforeTest() throws IOException { + MockitoAnnotations.initMocks(this); + + stringReader = new StringReader("{'fulfillmentInfo': {'tag': 'validate-form-parameter'}}"); + jsonReader = new BufferedReader(stringReader); + + responseOut = new StringWriter(); + writerOut = new BufferedWriter(responseOut); + + when(request.getReader()).thenReturn(jsonReader); + when(response.getWriter()).thenReturn(writerOut); + } + + @Test + public void helloHttp_bodyParamsPost() throws IOException, Exception { + FulfillmentInfo fulfillmentInfo = + FulfillmentInfo.newBuilder().setTag("configure-session-parameters").build(); + + WebhookRequest webhookRequest = + WebhookRequest.newBuilder().setFulfillmentInfo(fulfillmentInfo).build(); + + new WebhookConfigureSessionParameters().service(request, response); + writerOut.flush(); + + JsonObject webhookResponse = new JsonObject(); + JsonObject parameterObject = new JsonObject(); + JsonObject orderParameter = new JsonObject(); + orderParameter.addProperty("order_number", "12345"); + parameterObject.add("parameters", orderParameter); + webhookResponse.add("session_info", parameterObject); + + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + String expectedResponse = gson.toJson(webhookResponse); + + assertThat(responseOut.toString()).isEqualTo(expectedResponse); + } +} diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookValidateFormParameterIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookValidateFormParameterIT.java new file mode 100644 index 00000000000..f234c3f3e1c --- /dev/null +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookValidateFormParameterIT.java @@ -0,0 +1,105 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package dialogflow.cx; + +import static com.google.common.truth.Truth.assertThat; +import static org.mockito.Mockito.when; + +import com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest; +import com.google.cloud.dialogflow.cx.v3beta1.WebhookRequest.FulfillmentInfo; +import com.google.cloud.functions.HttpRequest; +import com.google.cloud.functions.HttpResponse; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +public class WebhookValidateFormParameterIT { + + @Mock HttpRequest request; + @Mock HttpResponse response; + + BufferedReader jsonReader; + StringReader stringReader; + BufferedWriter writerOut; + StringWriter responseOut; + + @Before + public void beforeTest() throws IOException { + MockitoAnnotations.initMocks(this); + + stringReader = new StringReader("{'fulfillmentInfo': {'tag': 'validate-form-parameter'}}"); + jsonReader = new BufferedReader(stringReader); + + responseOut = new StringWriter(); + writerOut = new BufferedWriter(responseOut); + + when(request.getReader()).thenReturn(jsonReader); + when(response.getWriter()).thenReturn(writerOut); + } + + @Test + public void helloHttp_bodyParamsPost() throws IOException, Exception { + FulfillmentInfo fulfillmentInfo = + FulfillmentInfo.newBuilder().setTag("configure-session-parameters").build(); + + WebhookRequest webhookRequest = + WebhookRequest.newBuilder().setFulfillmentInfo(fulfillmentInfo).build(); + + new WebhookValidateFormParameter().service(request, response); + writerOut.flush(); + + JsonObject sessionParameter = new JsonObject(); + sessionParameter.addProperty("order_number", "null"); + + JsonObject sessionInfo = new JsonObject(); + sessionInfo.add("parameters", sessionParameter); + + JsonObject parameterObject = new JsonObject(); + parameterObject.addProperty("display_name", "order_number"); + parameterObject.addProperty("required", "true"); + parameterObject.addProperty("state", "INVALID"); + parameterObject.addProperty("value", "123"); + + JsonArray parameterInfoList = new JsonArray(); + parameterInfoList.add(parameterObject); + + JsonObject parameterInfoObject = new JsonObject(); + parameterInfoObject.add("parameter_info", parameterInfoList); + + JsonObject formInfo = new JsonObject(); + formInfo.add("form_info", parameterInfoObject); + + JsonObject webhookResponse = new JsonObject(); + webhookResponse.add("page_info", formInfo); + webhookResponse.add("session_info", sessionInfo); + + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + String expectedResponse = gson.toJson(webhookResponse); + + assertThat(responseOut.toString()).isEqualTo(expectedResponse); + } +} From 382059f8f3e72e9e139ab088e47cdb204e734650 Mon Sep 17 00:00:00 2001 From: aribray <45905583+aribray@users.noreply.github.com> Date: Tue, 19 Jul 2022 13:26:47 -0500 Subject: [PATCH 61/73] docs(samples): add try blocks to clean up resources in samples and sample tests (#521) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add try block to clean up resources Change-Id: Ie68f4715646942d2e78189b3477cb9a5a31713b8 * docs: add try block to clean up resources Change-Id: Ibaa2bd6a9f687b67af61a5f958c37e2faf087434 * add try block to clean up resources Change-Id: I60fff4d6c83d42b8921b4ed4ce6c0eea76a952c6 * add try block to clean up resources Change-Id: I2facb88a81c1d76d5b2316da04cebdffba6634b9 * add Thread.sleep to try blocks, fix checkstyle Change-Id: I0eab8286ac21a8becf64b541100050581016ca5d * add Thread.sleep Change-Id: I94553a4501a6bdfbdcad1360833cd5e4352d9a77 * add Thread.sleep Change-Id: I123c577193306dc4625d2d56637e71e13cd06f70 * add try block to clean up resources Change-Id: I38d51da44e19b7c50d09d3e32aa6b5378c8fc0e2 * change fulfillmentInfo tag Change-Id: I8f0b7e31a2283c5dae7c6b377861ee03e8cbe621 * add try block to clean up resources Change-Id: I3ee67b4c3ce45b18138d9382fd18f5f4646372db * add ; Change-Id: I10cb37ff93f4c28c1f94d8e221c893fe4b74835a * remove try block Change-Id: I9b5f96d7c0ee75745084ed2a277fb9dc8b76a98f * move try block Change-Id: I17eeaf75673cb24682552dd59916c0ad5d68b89a * remove try block Change-Id: I001e1bd68b5c0953d2c634239828d81bf2576a25 * change fulfillmentInfo tag Change-Id: I1454736df9212b36afcd322ef3ce8c677b3500e8 * checkstyle Change-Id: I10d3750668a4acb9ff18f58fdb4f1a19faf6eacc * add try block to clean up resources Change-Id: I2a56b4f9b558fbebb816fb409fdabff4ee194f2f * add catch Change-Id: I7dd46f9543256427e9d86ab4f60b4806bdb8bd9a * remove println Change-Id: Idb0f4d75d0e7902a666248c48ed4fc54aeef5e59 * checkstyle Change-Id: Ie28023c2bf6422a50dc5e09128ede1e49679c95d * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add try-with-resources comment to client object creation lines in snippets Change-Id: Ic1acaa6097e972b2db35cca2f5928e826ef08964 * add string.format Change-Id: I25e7e803c8d0b40e6503b6ed8c5fd1c872c4506b * update parentPath Change-Id: Id387695b0d86c30c74f796e7f57db6e1f8be43bd * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- ...SetFormParametersAsOptionalOrRequired.java | 3 - .../main/java/dialogflow/cx/CreateAgent.java | 3 + .../main/java/dialogflow/cx/CreateFlow.java | 5 +- .../main/java/dialogflow/cx/CreateIntent.java | 3 + .../main/java/dialogflow/cx/CreatePage.java | 3 + .../java/dialogflow/cx/CreateSimplePage.java | 3 + .../main/java/dialogflow/cx/DeletePage.java | 4 ++ .../main/java/dialogflow/cx/DetectIntent.java | 6 +- .../dialogflow/cx/DetectIntentAudioInput.java | 4 ++ .../cx/DetectIntentDisableWebhook.java | 4 ++ .../dialogflow/cx/DetectIntentEventInput.java | 4 ++ .../cx/DetectIntentIntentInput.java | 4 ++ .../cx/DetectIntentSentimentAnalysis.java | 4 ++ .../dialogflow/cx/DetectIntentStream.java | 4 ++ .../DetectIntentStreamingPartialResponse.java | 4 ++ ...ectIntentSynthesizeTextToSpeechOutput.java | 4 ++ .../main/java/dialogflow/cx/ExportAgent.java | 3 + .../main/java/dialogflow/cx/ListPages.java | 33 ++++++----- .../dialogflow/cx/ListTestCaseResults.java | 10 +++- .../dialogflow/cx/ListTrainingPhrases.java | 4 ++ .../main/java/dialogflow/cx/UpdateIntent.java | 4 ++ .../cx/WebhookConfigureSessionParameters.java | 3 - .../cx/WebhookValidateFormParameter.java | 2 - ...tFormParametersAsOptionalOrRequiredIT.java | 5 +- .../java/dialogflow/cx/CreateAgentIT.java | 10 ++-- .../java/dialogflow/cx/PageManagementIT.java | 57 +++++++++++-------- .../java/dialogflow/cx/UpdateIntentTest.java | 38 +++++++------ .../WebhookConfigureSessionParametersIT.java | 3 +- .../cx/WebhookValidateFormParameterIT.java | 1 + 29 files changed, 157 insertions(+), 78 deletions(-) diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequired.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequired.java index 2db56b5ded4..b94c55242ba 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequired.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequired.java @@ -57,9 +57,6 @@ public void service(HttpRequest request, HttpResponse response) throws Exception Gson gson = new GsonBuilder().setPrettyPrinting().create(); String jsonResponseObject = gson.toJson(webhookResponse); - System.out.println("Response Object: \n"); - System.out.println(jsonResponseObject.toString()); - /* { * "page_info": { * "form_info": { diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateAgent.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateAgent.java index 2ab019c1e9c..657abed0ee4 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateAgent.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateAgent.java @@ -39,6 +39,9 @@ public static Agent createAgent(String parent, String displayName) throws IOExce String apiEndpoint = "global-dialogflow.googleapis.com:443"; AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); + // Note: close() needs to be called on the AgentsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (AgentsClient client = AgentsClient.create(agentsSettings)) { // Set the details of the Agent to create Builder build = Agent.newBuilder(); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java index 3f2b707ddb4..1719f152639 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateFlow.java @@ -50,7 +50,10 @@ public static Flow createFlow( } FlowsSettings flowsSettings = flowsSettingsBuilder.build(); - // Instantiates a client + // Instantiates a client. + // Note: close() needs to be called on the FlowsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (FlowsClient flowsClient = FlowsClient.create(flowsSettings)) { // Set the project agent name using the projectID (my-project-id), locationID (global), and // agentID (UUID). diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java index 603034d8f56..3469c184853 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateIntent.java @@ -48,6 +48,9 @@ public static Intent createIntent( IntentsSettings intentsSettings = intentsSettingsBuilder.build(); // Instantiates a client + // Note: close() needs to be called on the IntentsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (IntentsClient intentsClient = IntentsClient.create(intentsSettings)) { // Set the project agent name using the projectID (my-project-id), locationID (global), and // agentID (UUID). diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java index 14162bf8d09..b45bc46f81f 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreatePage.java @@ -52,6 +52,9 @@ public static Page createPage( PagesSettings pagesSettings = pagesSettingsBuilder.build(); // Instantiates a client + // Note: close() needs to be called on the PagesClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (PagesClient pagesClient = PagesClient.create(pagesSettings)) { // Set the flow name using the projectID (my-project-id), locationID (global), agentID (UUID) // and flowID (UUID). diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateSimplePage.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateSimplePage.java index e18b60eeb98..26b10e85422 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateSimplePage.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/CreateSimplePage.java @@ -59,6 +59,9 @@ public static Page createPage( .setPage(pageBuilder); // Make API request to create page + // Note: close() needs to be called on the PagesClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (PagesClient client = PagesClient.create()) { response = client.createPage(createRequestBuilder.build()); System.out.println("Successfully created page!"); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DeletePage.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DeletePage.java index 98bd5e1fdea..8403a690a99 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DeletePage.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DeletePage.java @@ -40,6 +40,10 @@ public static void main(String[] args) throws IOException { public static void deletePage( String projectId, String agentId, String flowId, String pageId, String location) throws IOException { + + // Note: close() needs to be called on the PagesClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (PagesClient client = PagesClient.create()) { Builder deleteRequestBuilder = DeletePageRequest.newBuilder(); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java index 703f7a77393..3109a4fc5a8 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntent.java @@ -52,7 +52,11 @@ public static Map detectIntent( SessionsSettings sessionsSettings = sessionsSettingsBuilder.build(); Map queryResults = Maps.newHashMap(); - // Instantiates a client + // Instantiates a client. + + // Note: close() needs to be called on the SessionsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { // Set the session name using the projectID (my-project-id), locationID (global), agentID // (UUID), and sessionId (UUID). diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentAudioInput.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentAudioInput.java index e864f381a03..36a6a17c727 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentAudioInput.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentAudioInput.java @@ -76,6 +76,10 @@ public static void detectIntent( // Instantiates a client by setting the session name. // Format:`projects//locations//agents//sessions/` + + // Note: close() needs to be called on the SessionsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { SessionName session = SessionName.ofProjectLocationAgentSessionName(projectId, locationId, agentId, sessionId); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentDisableWebhook.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentDisableWebhook.java index c0cf470fefa..ee97aabdab9 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentDisableWebhook.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentDisableWebhook.java @@ -68,6 +68,10 @@ public static Map detectIntent( // Instantiates a client by setting the session name. // Format:`projects//locations//agents//sessions/` + + // Note: close() needs to be called on the SessionsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { SessionName session = SessionName.ofProjectLocationAgentSessionName(projectId, locationId, agentId, sessionId); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentEventInput.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentEventInput.java index 5f92199e9b9..ccd1fe3430c 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentEventInput.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentEventInput.java @@ -62,6 +62,10 @@ public static void detectIntent( // Instantiates a client by setting the session name. // Format:`projects//locations//agents//sessions/` + + // Note: close() needs to be called on the SessionsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { SessionName session = SessionName.ofProjectLocationAgentSessionName(projectId, locationId, agentId, sessionId); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentIntentInput.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentIntentInput.java index 45af3c56795..a0e89547db6 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentIntentInput.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentIntentInput.java @@ -62,6 +62,10 @@ public static void detectIntent( // Instantiates a client by setting the session name. // Format:`projects//locations//agents//sessions/` + + // Note: close() needs to be called on the SessionsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { SessionName session = SessionName.ofProjectLocationAgentSessionName(projectId, locationId, agentId, sessionId); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSentimentAnalysis.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSentimentAnalysis.java index 318242c4fb5..f69331bbf29 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSentimentAnalysis.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSentimentAnalysis.java @@ -68,6 +68,10 @@ public static Map detectIntent( // Instantiates a client by setting the session name. // Format:`projects//locations//agents//sessions/` + + // Note: close() needs to be called on the SessionsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { SessionName session = SessionName.ofProjectLocationAgentSessionName(projectId, locationId, agentId, sessionId); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java index 96b1799a5bd..f1d05491e38 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStream.java @@ -56,6 +56,10 @@ public static void detectIntentStream( // Instantiates a client by setting the session name. // Format: `projects//locations//agents//sessions/` // Using the same `sessionId` between requests allows continuation of the conversation. + + // Note: close() needs to be called on the SessionsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { SessionName session = SessionName.of(projectId, locationId, agentId, sessionId); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStreamingPartialResponse.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStreamingPartialResponse.java index 81cb534e285..af725804366 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStreamingPartialResponse.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentStreamingPartialResponse.java @@ -56,6 +56,10 @@ public static void detectIntentStreamingPartialResponse( // Instantiates a client by setting the session name. // Format:`projects//locations//agents//sessions/` // Using the same `sessionId` between requests allows continuation of the conversation. + + // Note: close() needs to be called on the SessionsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { SessionName session = SessionName.of(projectId, locationId, agentId, sessionId); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSynthesizeTextToSpeechOutput.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSynthesizeTextToSpeechOutput.java index d26437eefff..74c155f4d0b 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSynthesizeTextToSpeechOutput.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/DetectIntentSynthesizeTextToSpeechOutput.java @@ -71,6 +71,10 @@ public static void detectIntent( // Instantiates a client by setting the session name. // Format:`projects//locations//agents//sessions/` + + // Note: close() needs to be called on the SessionsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (SessionsClient sessionsClient = SessionsClient.create(sessionsSettings)) { SessionName session = SessionName.ofProjectLocationAgentSessionName(projectId, locationId, agentId, sessionId); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ExportAgent.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ExportAgent.java index ba908af542e..6b431f5108c 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ExportAgent.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ExportAgent.java @@ -47,6 +47,9 @@ public static void exportAgent(String projectId, String agentId, String location String apiEndpoint = String.format("%s-dialogflow.googleapis.com:443", location); AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); + // Note: close() needs to be called on the AgentsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (AgentsClient agentsClient = AgentsClient.create(agentsSettings)) { ExportAgentRequest request = ExportAgentRequest.newBuilder() diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListPages.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListPages.java index f935b638911..9a180081f67 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListPages.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListPages.java @@ -39,23 +39,22 @@ public static void main(String[] args) throws IOException { // Lists all pages from the provided parameters public static void listPages(String projectId, String agentId, String flowId, String location) throws IOException { - PagesClient client = PagesClient.create(); - Builder listRequestBuilder = ListPagesRequest.newBuilder(); - - listRequestBuilder.setParent( - "projects/" - + projectId - + "/locations/" - + location - + "/agents/" - + agentId - + "/flows/" - + flowId); - listRequestBuilder.setLanguageCode("en"); - - // Make API request to list all pages in the project - for (Page element : client.listPages(listRequestBuilder.build()).iterateAll()) { - System.out.println(element); + // Note: close() needs to be called on the PagesClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). + try (PagesClient client = PagesClient.create()) { + Builder listRequestBuilder = ListPagesRequest.newBuilder(); + + String parentPath = + String.format( + "projects/%s/locations/%s/agents/%s/flows/%s", projectId, location, agentId, flowId); + listRequestBuilder.setParent(parentPath); + listRequestBuilder.setLanguageCode("en"); + + // Make API request to list all pages in the project + for (Page element : client.listPages(listRequestBuilder.build()).iterateAll()) { + System.out.println(element); + } } } // [END dialogflow_cx_list_pages] diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTestCaseResults.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTestCaseResults.java index 3519c5c983c..2f34d6530c1 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTestCaseResults.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTestCaseResults.java @@ -57,10 +57,14 @@ public static void listTestCaseResults( TestCasesSettings.newBuilder() .setEndpoint(location + "-dialogflow.googleapis.com:443") .build(); - TestCasesClient client = TestCasesClient.create(testCasesSettings); - for (TestCaseResult element : client.listTestCaseResults(req.build()).iterateAll()) { - System.out.println(element); + // Note: close() needs to be called on the TestCasesClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). + try (TestCasesClient client = TestCasesClient.create(testCasesSettings)) { + for (TestCaseResult element : client.listTestCaseResults(req.build()).iterateAll()) { + System.out.println(element); + } } } } diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTrainingPhrases.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTrainingPhrases.java index 2bd0e73ae9e..4257530513d 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTrainingPhrases.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTrainingPhrases.java @@ -38,6 +38,10 @@ public static void main(String[] args) throws IOException { // DialogFlow API List Training Phrases sample. public static void listTrainingPhrases( String projectId, String location, String agentId, String intentId) throws IOException { + + // Note: close() needs to be called on the IntentsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (IntentsClient client = IntentsClient.create()) { // Set the intent name IntentName name = IntentName.of(projectId, location, agentId, intentId); diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/UpdateIntent.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/UpdateIntent.java index 73a87889880..ea16649f66a 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/UpdateIntent.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/UpdateIntent.java @@ -41,6 +41,10 @@ public static void main(String[] args) throws IOException { public static void updateIntent( String projectId, String agentId, String intentId, String location, String displayName) throws IOException { + + // Note: close() needs to be called on the IntentsClient object to clean up resources + // such as threads. In the example below, try-with-resources is used, + // which automatically calls close(). try (IntentsClient client = IntentsClient.create()) { String intentPath = "projects/" diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookConfigureSessionParameters.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookConfigureSessionParameters.java index e9c0263141b..2d59a8ba7e1 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookConfigureSessionParameters.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookConfigureSessionParameters.java @@ -49,9 +49,6 @@ public void service(HttpRequest request, HttpResponse response) throws Exception Gson gson = new GsonBuilder().setPrettyPrinting().create(); String jsonResponseObject = gson.toJson(webhookResponse); - System.out.println("Session Parameter Info: \n"); - System.out.println(jsonResponseObject.toString()); - /** { "session_info": { "parameters": { "order_number": "12345" } } } */ BufferedWriter writer = response.getWriter(); // Sends the webhookResponseObject diff --git a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookValidateFormParameter.java b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookValidateFormParameter.java index fadbef57360..320b57f3d65 100644 --- a/dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookValidateFormParameter.java +++ b/dialogflow-cx/snippets/src/main/java/dialogflow/cx/WebhookValidateFormParameter.java @@ -65,8 +65,6 @@ public void service(HttpRequest request, HttpResponse response) throws Exception Gson gson = new GsonBuilder().setPrettyPrinting().create(); String jsonResponseObject = gson.toJson(webhookResponse); - System.out.println("Response Object: \n"); - System.out.println(jsonResponseObject.toString()); /** * { "page_info": { "form_info": { "parameter_info": [ { "display_name": "order_number", * "required": "true", "state": "INVALID", "value": "123" } ] } }, "session_info": { diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequiredIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequiredIT.java index b9a051bf7b0..53e30e094e6 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequiredIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequiredIT.java @@ -65,7 +65,9 @@ public void beforeTest() throws IOException { public void helloHttp_bodyParamsPost() throws IOException, Exception { FulfillmentInfo fulfillmentInfo = - FulfillmentInfo.newBuilder().setTag("configure-session-parameters").build(); + FulfillmentInfo.newBuilder() + .setTag("configure-form-parameters-optional-or-parameter") + .build(); WebhookRequest webhookRequest = WebhookRequest.newBuilder().setFulfillmentInfo(fulfillmentInfo).build(); @@ -94,5 +96,6 @@ public void helloHttp_bodyParamsPost() throws IOException, Exception { String expectedResponse = gson.toJson(webhookResponse); assertThat(responseOut.toString()).isEqualTo(expectedResponse); + Thread.sleep(200); } } diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateAgentIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateAgentIT.java index 69723e127bb..aee80c7dee1 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateAgentIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/CreateAgentIT.java @@ -48,12 +48,12 @@ public void tearDown() throws IOException, InterruptedException { String apiEndpoint = "global-dialogflow.googleapis.com:443"; AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); - AgentsClient client = AgentsClient.create(agentsSettings); + try (AgentsClient client = AgentsClient.create(agentsSettings)) { + client.deleteAgent(CreateAgentIT.agentPath); - client.deleteAgent(CreateAgentIT.agentPath); - - // Small delay to prevent reaching quota limit of requests per minute - Thread.sleep(250); + // Small delay to prevent reaching quota limit of requests per minute + Thread.sleep(250); + } } @Test diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/PageManagementIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/PageManagementIT.java index ab1b2ca6032..47c100107d4 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/PageManagementIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/PageManagementIT.java @@ -47,21 +47,24 @@ public class PageManagementIT { public static void setUp() throws IOException { stdOut = new ByteArrayOutputStream(); System.setOut(new PrintStream(stdOut)); - Builder build = Agent.newBuilder(); - build.setDefaultLanguageCode("en"); - build.setDisplayName("temp_agent_" + UUID.randomUUID().toString()); - build.setTimeZone("America/Los_Angeles"); - - Agent agent = build.build(); String apiEndpoint = "global-dialogflow.googleapis.com:443"; - String parentPath = "projects/" + PROJECT_ID + "/locations/global"; AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); - AgentsClient client = AgentsClient.create(agentsSettings); + try (AgentsClient client = AgentsClient.create(agentsSettings)) { + + Builder build = Agent.newBuilder(); + build.setDefaultLanguageCode("en"); + build.setDisplayName("temp_agent_" + UUID.randomUUID().toString()); + build.setTimeZone("America/Los_Angeles"); + + Agent agent = build.build(); + String parentPath = "projects/" + PROJECT_ID + "/locations/global"; + + parent = client.createAgent(parentPath, agent).getName(); - parent = client.createAgent(parentPath, agent).getName(); - agentID = parent.split("/")[5]; + agentID = parent.split("/")[5]; + } } @AfterClass @@ -70,30 +73,36 @@ public static void tearDown() throws IOException, InterruptedException { String parentPath = "projects/" + PROJECT_ID + "/locations/global"; AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); - AgentsClient client = AgentsClient.create(agentsSettings); - - client.deleteAgent(parent); + try (AgentsClient client = AgentsClient.create(agentsSettings)) { + client.deleteAgent(parent); - // Small delay to prevent reaching quota limit of requests per minute - Thread.sleep(250); + // Small delay to prevent reaching quota limit of requests per minute + Thread.sleep(250); + } } @Test public void testCreatePage() throws IOException { - Page p = CreateSimplePage.createPage(PROJECT_ID, agentID, flowID, location, displayName); - pageID = p.getName().split("/")[9]; - - assertThat(p.getDisplayName()).isEqualTo(displayName); + try { + Page p = CreateSimplePage.createPage(PROJECT_ID, agentID, flowID, location, displayName); + pageID = p.getName().split("/")[9]; + assertThat(p.getDisplayName()).isEqualTo(displayName); + } catch (Exception e) { + assertThat(e).isEqualTo(""); + } } @Test public void testListPages() throws IOException { String name = "temp_page_" + UUID.randomUUID().toString(); - - Page p = CreateSimplePage.createPage(PROJECT_ID, agentID, flowID, location, name); - - ListPages.listPages(PROJECT_ID, agentID, flowID, location); - assertThat(stdOut.toString()).contains(name); + // Page p + try { + CreateSimplePage.createPage(PROJECT_ID, agentID, flowID, location, name); + ListPages.listPages(PROJECT_ID, agentID, flowID, location); + assertThat(stdOut.toString()).contains(name); + } catch (Exception e) { + assertThat(e).isEqualTo(""); + } } @Test diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/UpdateIntentTest.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/UpdateIntentTest.java index 0443ec40cb7..635b16b781b 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/UpdateIntentTest.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/UpdateIntentTest.java @@ -48,21 +48,24 @@ public void setUp() throws IOException { stdOut = new ByteArrayOutputStream(); System.setOut(new PrintStream(stdOut)); - Builder build = Agent.newBuilder(); - build.setDefaultLanguageCode("en"); - build.setDisplayName("temp_agent_" + UUID.randomUUID().toString()); - build.setTimeZone("America/Los_Angeles"); - - Agent agent = build.build(); - String apiEndpoint = "global-dialogflow.googleapis.com:443"; - String parentPath = "projects/" + PROJECT_ID + "/locations/global"; AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); - AgentsClient client = AgentsClient.create(agentsSettings); + try (AgentsClient agentsClient = AgentsClient.create(agentsSettings)) { + + Builder build = Agent.newBuilder(); + + build.setDefaultLanguageCode("en"); + build.setDisplayName("temp_agent_" + UUID.randomUUID().toString()); + build.setTimeZone("America/Los_Angeles"); + + Agent agent = build.build(); + String parentPath = String.format("projects/%s/locations/global", PROJECT_ID); - parent = client.createAgent(parentPath, agent).getName(); - UpdateIntentTest.agentID = parent.split("/")[5]; + parent = agentsClient.createAgent(parentPath, agent).getName(); + + UpdateIntentTest.agentID = parent.split("/")[5]; + } try (IntentsClient intentsClient = IntentsClient.create()) { com.google.cloud.dialogflow.cx.v3.Intent.Builder intent = Intent.newBuilder(); @@ -77,16 +80,17 @@ public void setUp() throws IOException { public void tearDown() throws IOException, InterruptedException { stdOut = null; System.setOut(null); + String apiEndpoint = "global-dialogflow.googleapis.com:443"; - String parentPath = "projects/" + PROJECT_ID + "/locations/global"; AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(apiEndpoint).build(); - AgentsClient client = AgentsClient.create(agentsSettings); + try (AgentsClient client = AgentsClient.create(agentsSettings)) { + String parentPath = "projects/" + PROJECT_ID + "/locations/global"; + client.deleteAgent(parent); - client.deleteAgent(parent); - - // Small delay to prevent reaching quota limit of requests per minute - Thread.sleep(250); + // Small delay to prevent reaching quota limit of requests per minute + Thread.sleep(250); + } } @Test diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookConfigureSessionParametersIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookConfigureSessionParametersIT.java index 52cd6470d73..9c1d2a71929 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookConfigureSessionParametersIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookConfigureSessionParametersIT.java @@ -50,7 +50,7 @@ public class WebhookConfigureSessionParametersIT { public void beforeTest() throws IOException { MockitoAnnotations.initMocks(this); - stringReader = new StringReader("{'fulfillmentInfo': {'tag': 'validate-form-parameter'}}"); + stringReader = new StringReader("{'fulfillmentInfo': {'tag': 'configure-session-parameter'}}"); jsonReader = new BufferedReader(stringReader); responseOut = new StringWriter(); @@ -82,5 +82,6 @@ public void helloHttp_bodyParamsPost() throws IOException, Exception { String expectedResponse = gson.toJson(webhookResponse); assertThat(responseOut.toString()).isEqualTo(expectedResponse); + Thread.sleep(200); } } diff --git a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookValidateFormParameterIT.java b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookValidateFormParameterIT.java index f234c3f3e1c..4500e3f9467 100644 --- a/dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookValidateFormParameterIT.java +++ b/dialogflow-cx/snippets/src/test/java/dialogflow/cx/WebhookValidateFormParameterIT.java @@ -101,5 +101,6 @@ public void helloHttp_bodyParamsPost() throws IOException, Exception { String expectedResponse = gson.toJson(webhookResponse); assertThat(responseOut.toString()).isEqualTo(expectedResponse); + Thread.sleep(250); } } From 04ca1d3c11c38d7dcdc22dfdd8cd595bd918c6dd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 2 Aug 2022 20:50:32 +0200 Subject: [PATCH 62/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.14.2 (#530) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.14.1` -> `0.14.2` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.2/compatibility-slim/0.14.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.2/confidence-slim/0.14.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.14.2`](https://togithub.com/googleapis/java-dialogflow-cx/blob/HEAD/CHANGELOG.md#​0142-httpsgithubcomgoogleapisjava-dialogflow-cxcomparev0141v0142-2022-07-13) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.14.1...v0.14.2) ##### Bug Fixes - enable longpaths support for windows test ([#​1485](https://togithub.com/googleapis/java-dialogflow-cx/issues/1485)) ([#​516](https://togithub.com/googleapis/java-dialogflow-cx/issues/516)) ([e057843](https://togithub.com/googleapis/java-dialogflow-cx/commit/e0578432487c01f3a866dda84b5bc4c9d5efa91b))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 017cefb791b..0a10c47288b 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.14.1 + 0.14.2 com.google.code.gson From 599a65d0ece623724effbaf45c6b957813ab5186 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 2 Aug 2022 20:52:25 +0200 Subject: [PATCH 63/73] deps: update dependency com.google.code.gson:gson to v2.9.1 (#528) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.code.gson:gson](https://togithub.com/google/gson) | `2.9.0` -> `2.9.1` | [![age](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.9.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.9.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.9.1/compatibility-slim/2.9.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.code.gson:gson/2.9.1/confidence-slim/2.9.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
google/gson ### [`v2.9.1`](https://togithub.com/google/gson/blob/HEAD/CHANGELOG.md#Version-291) - Make `Object` and `JsonElement` deserialization iterative rather than recursive ([#​1912](https://togithub.com/google/gson/issues/1912)) - Added parsing support for enum that has overridden toString() method ([#​1950](https://togithub.com/google/gson/issues/1950)) - Removed support for building Gson with Gradle ([#​2081](https://togithub.com/google/gson/issues/2081)) - Removed obsolete `codegen` hierarchy ([#​2099](https://togithub.com/google/gson/issues/2099)) - Add support for reflection access filter ([#​1905](https://togithub.com/google/gson/issues/1905)) - Improve `TypeToken` creation validation ([#​2072](https://togithub.com/google/gson/issues/2072)) - Add explicit support for `float` in `JsonWriter` ([#​2130](https://togithub.com/google/gson/issues/2130), [#​2132](https://togithub.com/google/gson/issues/2132)) - Fail when parsing invalid local date ([#​2134](https://togithub.com/google/gson/issues/2134)) Also many small improvements to javadoc.
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 0a10c47288b..4d11f88bbdf 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -33,7 +33,7 @@ com.google.code.gson gson - 2.9.0 + 2.9.1 com.google.cloud.functions From b9c2190c528f9bda4039779f4ff106b4011fb88e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 17:54:26 +0200 Subject: [PATCH 64/73] test(deps): update dependency org.mockito:mockito-core to v4.7.0 (#534) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `4.6.1` -> `4.7.0` | [![age](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.7.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.7.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.7.0/compatibility-slim/4.6.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.7.0/confidence-slim/4.6.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 4d11f88bbdf..17f27e22672 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -55,7 +55,7 @@ org.mockito mockito-core - 4.6.1 + 4.7.0 test From 9dff4962c3d40379acde160993de6f6ce5e1f8e0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 16 Aug 2022 18:18:20 +0200 Subject: [PATCH 65/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.14.3 (#533) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.14.2` -> `0.14.3` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.3/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.3/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.3/compatibility-slim/0.14.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.3/confidence-slim/0.14.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 17f27e22672..5c62baf4b6e 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.14.2 + 0.14.3 com.google.code.gson From 478114068c1133851ccfbde76dabd697e9365098 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 18 Aug 2022 15:41:34 +0200 Subject: [PATCH 66/73] deps: update dependency com.google.cloud.functions:function-maven-plugin to v0.10.1 (#537) --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 5c62baf4b6e..8921af924cc 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -49,7 +49,7 @@ com.google.cloud.functions function-maven-plugin - 0.10.0 + 0.10.1 test From e2c781d9cf2dbdb46fce1948fef5cfda6f1dde1a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 6 Sep 2022 23:08:14 +0200 Subject: [PATCH 67/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.14.4 (#541) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.14.3` -> `0.14.4` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.4/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.4/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.4/compatibility-slim/0.14.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.4/confidence-slim/0.14.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/java-dialogflow-cx ### [`v0.14.4`](https://togithub.com/googleapis/java-dialogflow-cx/blob/HEAD/CHANGELOG.md#​0144-httpsgithubcomgoogleapisjava-dialogflow-cxcomparev0143v0144-2022-09-06) [Compare Source](https://togithub.com/googleapis/java-dialogflow-cx/compare/v0.14.3...v0.14.4) ##### Dependencies - Update dependency com.google.cloud.functions ([6647dc7](https://togithub.com/googleapis/java-dialogflow-cx/commit/6647dc715de5e96312a18460021d9ea9532324f7))
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 8921af924cc..679a7e2e92b 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.14.3 + 0.14.4 com.google.code.gson From e2246030675df023d48da2e592b7ef5e46bc0715 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 8 Sep 2022 03:32:27 +0200 Subject: [PATCH 68/73] test(deps): update dependency org.mockito:mockito-core to v4.8.0 (#543) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mockito:mockito-core](https://togithub.com/mockito/mockito) | `4.7.0` -> `4.8.0` | [![age](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.8.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.8.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.8.0/compatibility-slim/4.7.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/org.mockito:mockito-core/4.8.0/confidence-slim/4.7.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
mockito/mockito ### [`v4.8.0`](https://togithub.com/mockito/mockito/releases/tag/v4.8.0) *Changelog generated by [Shipkit Changelog Gradle Plugin](https://togithub.com/shipkit/shipkit-changelog)* ##### 4.8.0 - 2022-09-07 - [10 commit(s)](https://togithub.com/mockito/mockito/compare/v4.7.0...v4.8.0) by Alex, James Baker, Johannes Spangenberg, Kurt Alfred Kluever, Rafael Winterhalter, Thibault Helsmoortel, dependabot\[bot] - GitHub Workflows security hardening [(#​2744)](https://togithub.com/mockito/mockito/pull/2744) - Assign GlobalConfiguration initializer to unused variable [(#​2742)](https://togithub.com/mockito/mockito/pull/2742) - Bump com.diffplug.spotless from 6.9.1 to 6.10.0 [(#​2738)](https://togithub.com/mockito/mockito/pull/2738) - Drop varargs collector before invoking a user method. [(#​2736)](https://togithub.com/mockito/mockito/pull/2736) - Bump versions.bytebuddy from 1.12.13 to 1.12.14 [(#​2734)](https://togithub.com/mockito/mockito/pull/2734) - Remove useless thrown exception from constructor [(#​2732)](https://togithub.com/mockito/mockito/pull/2732) - TypeSafeMatching no longer iterates over class methods inefficiently [(#​2729)](https://togithub.com/mockito/mockito/pull/2729) - Fixes [#​2720](https://togithub.com/mockito/mockito/issues/2720): Use StackWalker on Java 9+ to create Locations [(#​2723)](https://togithub.com/mockito/mockito/pull/2723) - LocationImpl adds performance overheads due to instantiating a stack trace [(#​2720)](https://togithub.com/mockito/mockito/issues/2720) - Fixes [#​2626](https://togithub.com/mockito/mockito/issues/2626) : Introduce MockSettings.mockMaker [(#​2701)](https://togithub.com/mockito/mockito/pull/2701) - Introduce option to disable inline-mock-maker for a specific instance [(#​2626)](https://togithub.com/mockito/mockito/issues/2626)
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 679a7e2e92b..ceaae60df08 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -55,7 +55,7 @@ org.mockito mockito-core - 4.7.0 + 4.8.0 test From 7f35e3ca4ecd097f0c3dbdc006432ac74ad27739 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Sep 2022 22:38:29 +0200 Subject: [PATCH 69/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.14.5 (#548) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.14.4` -> `0.14.6` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.6/compatibility-slim/0.14.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.6/confidence-slim/0.14.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index ceaae60df08..3d5c8271097 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.14.4 + 0.14.5 com.google.code.gson From 84fe00fff4fd46fd740bef8e6dea7d84c65d7a45 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 21 Sep 2022 16:20:42 +0200 Subject: [PATCH 70/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.14.6 (#552) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.14.5` -> `0.14.6` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.6/compatibility-slim/0.14.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.6/confidence-slim/0.14.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index 3d5c8271097..db7c1997eee 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.14.5 + 0.14.6 com.google.code.gson From 1cb9d8783e22d46728136a08c26f2a5a990740f2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 6 Oct 2022 18:02:15 +0200 Subject: [PATCH 71/73] chore(deps): update dependency com.google.cloud:google-cloud-dialogflow-cx to v0.14.7 (#582) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-dialogflow-cx](https://togithub.com/googleapis/java-dialogflow-cx) | `0.14.6` -> `0.14.7` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.7/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.7/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.7/compatibility-slim/0.14.6)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-dialogflow-cx/0.14.7/confidence-slim/0.14.6)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-dialogflow-cx). --- dialogflow-cx/snippets/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/snippets/pom.xml index db7c1997eee..940a4006a19 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/snippets/pom.xml @@ -28,7 +28,7 @@ com.google.cloud google-cloud-dialogflow-cx - 0.14.6 + 0.14.7 com.google.code.gson From 088ca4f140a129090dfa55a0eaa2f71e47f8af82 Mon Sep 17 00:00:00 2001 From: shabirmean Date: Wed, 16 Nov 2022 18:21:16 -0500 Subject: [PATCH 72/73] chore: post migration updates - groupId, artifact url, repo references --- dialogflow-cx/{snippets => }/pom.xml | 4 +- .../{snippets => }/resources/book_a_room.wav | Bin .../dialogflow/cx/ListTrainingPhrases.java | 66 ------------------ ...SetFormParametersAsOptionalOrRequired.java | 0 .../main/java/dialogflow/cx/CreateAgent.java | 0 .../main/java/dialogflow/cx/CreateFlow.java | 0 .../main/java/dialogflow/cx/CreateIntent.java | 0 .../main/java/dialogflow/cx/CreatePage.java | 0 .../java/dialogflow/cx/CreateSimplePage.java | 0 .../main/java/dialogflow/cx/DeletePage.java | 0 .../main/java/dialogflow/cx/DetectIntent.java | 0 .../dialogflow/cx/DetectIntentAudioInput.java | 0 .../cx/DetectIntentDisableWebhook.java | 0 .../dialogflow/cx/DetectIntentEventInput.java | 0 .../cx/DetectIntentIntentInput.java | 0 .../cx/DetectIntentSentimentAnalysis.java | 0 .../dialogflow/cx/DetectIntentStream.java | 0 .../DetectIntentStreamingPartialResponse.java | 0 ...ectIntentSynthesizeTextToSpeechOutput.java | 0 .../main/java/dialogflow/cx/ExportAgent.java | 0 .../main/java/dialogflow/cx/ListPages.java | 0 .../dialogflow/cx/ListTestCaseResults.java | 0 .../main/java/dialogflow/cx/UpdateIntent.java | 0 .../cx/WebhookConfigureSessionParameters.java | 0 .../cx/WebhookValidateFormParameter.java | 0 ...tFormParametersAsOptionalOrRequiredIT.java | 0 .../java/dialogflow/cx/CreateAgentIT.java | 0 .../test/java/dialogflow/cx/CreateFlowIT.java | 0 .../java/dialogflow/cx/CreateIntentIT.java | 0 .../test/java/dialogflow/cx/CreatePageIT.java | 0 .../cx/DetectIntentAudioInputTest.java | 0 .../cx/DetectIntentDisableWebhookTest.java | 0 .../cx/DetectIntentEventInputTest.java | 0 .../java/dialogflow/cx/DetectIntentIT.java | 0 .../cx/DetectIntentIntentInputTest.java | 0 .../cx/DetectIntentSentimentAnalysisTest.java | 0 .../dialogflow/cx/DetectIntentStreamIT.java | 0 ...ectIntentStreamingPartialResponseTest.java | 0 ...ntentSynthesizeTextToSpeechOutputTest.java | 0 .../java/dialogflow/cx/ExportAgentIT.java | 0 .../dialogflow/cx/ListTestCaseResultsIT.java | 0 .../cx/ListTrainingPhrasesTest.java | 0 .../java/dialogflow/cx/PageManagementIT.java | 0 .../java/dialogflow/cx/UpdateIntentTest.java | 0 .../WebhookConfigureSessionParametersIT.java | 0 .../cx/WebhookValidateFormParameterIT.java | 0 46 files changed, 2 insertions(+), 68 deletions(-) rename dialogflow-cx/{snippets => }/pom.xml (94%) rename dialogflow-cx/{snippets => }/resources/book_a_room.wav (100%) delete mode 100644 dialogflow-cx/snippets/src/main/java/dialogflow/cx/ListTrainingPhrases.java rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequired.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/CreateAgent.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/CreateFlow.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/CreateIntent.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/CreatePage.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/CreateSimplePage.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/DeletePage.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/DetectIntent.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/DetectIntentAudioInput.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/DetectIntentDisableWebhook.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/DetectIntentEventInput.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/DetectIntentIntentInput.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/DetectIntentSentimentAnalysis.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/DetectIntentStream.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/DetectIntentStreamingPartialResponse.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/DetectIntentSynthesizeTextToSpeechOutput.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/ExportAgent.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/ListPages.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/ListTestCaseResults.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/UpdateIntent.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/WebhookConfigureSessionParameters.java (100%) rename dialogflow-cx/{snippets => }/src/main/java/dialogflow/cx/WebhookValidateFormParameter.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/ConfigureWebhookToSetFormParametersAsOptionalOrRequiredIT.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/CreateAgentIT.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/CreateFlowIT.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/CreateIntentIT.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/CreatePageIT.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/DetectIntentAudioInputTest.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/DetectIntentDisableWebhookTest.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/DetectIntentEventInputTest.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/DetectIntentIT.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/DetectIntentIntentInputTest.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/DetectIntentSentimentAnalysisTest.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/DetectIntentStreamIT.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/DetectIntentStreamingPartialResponseTest.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/DetectIntentSynthesizeTextToSpeechOutputTest.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/ExportAgentIT.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/ListTestCaseResultsIT.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/ListTrainingPhrasesTest.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/PageManagementIT.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/UpdateIntentTest.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/WebhookConfigureSessionParametersIT.java (100%) rename dialogflow-cx/{snippets => }/src/test/java/dialogflow/cx/WebhookValidateFormParameterIT.java (100%) diff --git a/dialogflow-cx/snippets/pom.xml b/dialogflow-cx/pom.xml similarity index 94% rename from dialogflow-cx/snippets/pom.xml rename to dialogflow-cx/pom.xml index 940a4006a19..ab51bbfb446 100644 --- a/dialogflow-cx/snippets/pom.xml +++ b/dialogflow-cx/pom.xml @@ -1,11 +1,11 @@ 4.0.0 - com.google.cloud + com.example.dialogflow-cx dialogflow-cx-snippets jar Google Dialogflow CX Snippets - https://github.com/googleapis/java-dialogflow-cx + https://github.com/GoogleCloudPlatform/java-docs-samples/tree/main/dialogflow-cx