diff --git a/.coveragerc b/.coveragerc index 0b2dc233..bc7d76ea 100644 --- a/.coveragerc +++ b/.coveragerc @@ -10,8 +10,3 @@ exclude_lines = pragma: NO COVER # Ignore debug-only repr def __repr__ - # Ignore pkg_resources exceptions. - # This is added at the module level as a safeguard for if someone - # generates the code and tries to run it without pip installing. This - # makes it virtually impossible to test properly. - except pkg_resources.DistributionNotFound diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 3815c983..fccaa8e8 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:7a40313731a7cb1454eef6b33d3446ebb121836738dc3ab3d2d3ded5268c35b6 + digest: sha256:3bf87e47c2173d7eed42714589dc4da2c07c3268610f1e47f8e1a30decbfc7f1 diff --git a/.github/release-please.yml b/.github/release-please.yml index 6def37a8..e9a4f008 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,5 +1,6 @@ releaseType: python handleGHRelease: true +manifest: true # NOTE: this section is generated by synthtool.languages.python # See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py branches: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7092a139..e97d89e4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.9" - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel @@ -28,7 +28,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.9" - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d2aee5b7..16d5a9e9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.8" - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 24e46555..23000c05 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -41,7 +41,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.8" - name: Install coverage run: | python -m pip install --upgrade setuptools pip wheel @@ -54,4 +54,4 @@ jobs: - name: Report coverage results run: | coverage combine .coverage-results/.coverage* - coverage report --show-missing --fail-under=99 + coverage report --show-missing --fail-under=100 diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile index 238b87b9..f8137d0a 100644 --- a/.kokoro/docker/docs/Dockerfile +++ b/.kokoro/docker/docs/Dockerfile @@ -60,16 +60,16 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && rm -f /var/cache/apt/archives/*.deb -###################### Install python 3.8.11 +###################### Install python 3.9.13 -# Download python 3.8.11 -RUN wget https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz +# Download python 3.9.13 +RUN wget https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tgz # Extract files -RUN tar -xvf Python-3.8.11.tgz +RUN tar -xvf Python-3.9.13.tgz -# Install python 3.8.11 -RUN ./Python-3.8.11/configure --enable-optimizations +# Install python 3.9.13 +RUN ./Python-3.9.13/configure --enable-optimizations RUN make altinstall ###################### Install pip diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index 7718391a..cbd7e77f 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -5,4 +5,6 @@ typing-extensions twine wheel setuptools -nox \ No newline at end of file +nox +charset-normalizer<3 +click<8.1.0 diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index d15994ba..05dc4672 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -20,9 +20,9 @@ cachetools==5.2.0 \ --hash=sha256:6a94c6402995a99c3970cc7e4884bb60b4a8639938157eeed436098bf9831757 \ --hash=sha256:f9f17d2aec496a9aa6b76f53e3b614c965223c061982d434d160f930c698a9db # via google-auth -certifi==2022.6.15 \ - --hash=sha256:84c85a9078b11105f04f3036a9482ae10e4621616db313fe045dd24743a0820d \ - --hash=sha256:fe86415d55e84719d75f8b69414f6438ac3547d2078ab91b67e779ef69378412 +certifi==2022.12.7 \ + --hash=sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3 \ + --hash=sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18 # via requests cffi==1.15.1 \ --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ @@ -93,11 +93,14 @@ cffi==1.15.1 \ charset-normalizer==2.1.1 \ --hash=sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845 \ --hash=sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f - # via requests + # via + # -r requirements.in + # requests click==8.0.4 \ --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ --hash=sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb # via + # -r requirements.in # gcp-docuploader # gcp-releasetool colorlog==6.7.0 \ @@ -110,29 +113,33 @@ commonmark==0.9.1 \ --hash=sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60 \ --hash=sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9 # via rich -cryptography==37.0.4 \ - --hash=sha256:190f82f3e87033821828f60787cfa42bff98404483577b591429ed99bed39d59 \ - --hash=sha256:2be53f9f5505673eeda5f2736bea736c40f051a739bfae2f92d18aed1eb54596 \ - --hash=sha256:30788e070800fec9bbcf9faa71ea6d8068f5136f60029759fd8c3efec3c9dcb3 \ - --hash=sha256:3d41b965b3380f10e4611dbae366f6dc3cefc7c9ac4e8842a806b9672ae9add5 \ - --hash=sha256:4c590ec31550a724ef893c50f9a97a0c14e9c851c85621c5650d699a7b88f7ab \ - --hash=sha256:549153378611c0cca1042f20fd9c5030d37a72f634c9326e225c9f666d472884 \ - --hash=sha256:63f9c17c0e2474ccbebc9302ce2f07b55b3b3fcb211ded18a42d5764f5c10a82 \ - --hash=sha256:6bc95ed67b6741b2607298f9ea4932ff157e570ef456ef7ff0ef4884a134cc4b \ - --hash=sha256:7099a8d55cd49b737ffc99c17de504f2257e3787e02abe6d1a6d136574873441 \ - --hash=sha256:75976c217f10d48a8b5a8de3d70c454c249e4b91851f6838a4e48b8f41eb71aa \ - --hash=sha256:7bc997818309f56c0038a33b8da5c0bfbb3f1f067f315f9abd6fc07ad359398d \ - --hash=sha256:80f49023dd13ba35f7c34072fa17f604d2f19bf0989f292cedf7ab5770b87a0b \ - --hash=sha256:91ce48d35f4e3d3f1d83e29ef4a9267246e6a3be51864a5b7d2247d5086fa99a \ - --hash=sha256:a958c52505c8adf0d3822703078580d2c0456dd1d27fabfb6f76fe63d2971cd6 \ - --hash=sha256:b62439d7cd1222f3da897e9a9fe53bbf5c104fff4d60893ad1355d4c14a24157 \ - --hash=sha256:b7f8dd0d4c1f21759695c05a5ec8536c12f31611541f8904083f3dc582604280 \ - --hash=sha256:d204833f3c8a33bbe11eda63a54b1aad7aa7456ed769a982f21ec599ba5fa282 \ - --hash=sha256:e007f052ed10cc316df59bc90fbb7ff7950d7e2919c9757fd42a2b8ecf8a5f67 \ - --hash=sha256:f2dcb0b3b63afb6df7fd94ec6fbddac81b5492513f7b0436210d390c14d46ee8 \ - --hash=sha256:f721d1885ecae9078c3f6bbe8a88bc0786b6e749bf32ccec1ef2b18929a05046 \ - --hash=sha256:f7a6de3e98771e183645181b3627e2563dcde3ce94a9e42a3f427d2255190327 \ - --hash=sha256:f8c0a6e9e1dd3eb0414ba320f85da6b0dcbd543126e30fcc546e7372a7fbf3b9 +cryptography==38.0.3 \ + --hash=sha256:068147f32fa662c81aebab95c74679b401b12b57494872886eb5c1139250ec5d \ + --hash=sha256:06fc3cc7b6f6cca87bd56ec80a580c88f1da5306f505876a71c8cfa7050257dd \ + --hash=sha256:25c1d1f19729fb09d42e06b4bf9895212292cb27bb50229f5aa64d039ab29146 \ + --hash=sha256:402852a0aea73833d982cabb6d0c3bb582c15483d29fb7085ef2c42bfa7e38d7 \ + --hash=sha256:4e269dcd9b102c5a3d72be3c45d8ce20377b8076a43cbed6f660a1afe365e436 \ + --hash=sha256:5419a127426084933076132d317911e3c6eb77568a1ce23c3ac1e12d111e61e0 \ + --hash=sha256:554bec92ee7d1e9d10ded2f7e92a5d70c1f74ba9524947c0ba0c850c7b011828 \ + --hash=sha256:5e89468fbd2fcd733b5899333bc54d0d06c80e04cd23d8c6f3e0542358c6060b \ + --hash=sha256:65535bc550b70bd6271984d9863a37741352b4aad6fb1b3344a54e6950249b55 \ + --hash=sha256:6ab9516b85bebe7aa83f309bacc5f44a61eeb90d0b4ec125d2d003ce41932d36 \ + --hash=sha256:6addc3b6d593cd980989261dc1cce38263c76954d758c3c94de51f1e010c9a50 \ + --hash=sha256:728f2694fa743a996d7784a6194da430f197d5c58e2f4e278612b359f455e4a2 \ + --hash=sha256:785e4056b5a8b28f05a533fab69febf5004458e20dad7e2e13a3120d8ecec75a \ + --hash=sha256:78cf5eefac2b52c10398a42765bfa981ce2372cbc0457e6bf9658f41ec3c41d8 \ + --hash=sha256:7f836217000342d448e1c9a342e9163149e45d5b5eca76a30e84503a5a96cab0 \ + --hash=sha256:8d41a46251bf0634e21fac50ffd643216ccecfaf3701a063257fe0b2be1b6548 \ + --hash=sha256:984fe150f350a3c91e84de405fe49e688aa6092b3525f407a18b9646f6612320 \ + --hash=sha256:9b24bcff7853ed18a63cfb0c2b008936a9554af24af2fb146e16d8e1aed75748 \ + --hash=sha256:b1b35d9d3a65542ed2e9d90115dfd16bbc027b3f07ee3304fc83580f26e43249 \ + --hash=sha256:b1b52c9e5f8aa2b802d48bd693190341fae201ea51c7a167d69fc48b60e8a959 \ + --hash=sha256:bbf203f1a814007ce24bd4d51362991d5cb90ba0c177a9c08825f2cc304d871f \ + --hash=sha256:be243c7e2bfcf6cc4cb350c0d5cdf15ca6383bbcb2a8ef51d3c9411a9d4386f0 \ + --hash=sha256:bfbe6ee19615b07a98b1d2287d6a6073f734735b49ee45b11324d85efc4d5cbd \ + --hash=sha256:c46837ea467ed1efea562bbeb543994c2d1f6e800785bd5a2c98bc096f5cb220 \ + --hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \ + --hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722 # via # gcp-releasetool # secretstorage @@ -148,23 +155,23 @@ filelock==3.8.0 \ --hash=sha256:55447caa666f2198c5b6b13a26d2084d26fa5b115c00d065664b2124680c4edc \ --hash=sha256:617eb4e5eedc82fc5f47b6d61e4d11cb837c56cb4544e39081099fa17ad109d4 # via virtualenv -gcp-docuploader==0.6.3 \ - --hash=sha256:ba8c9d76b3bbac54b0311c503a373b00edc2dc02d6d54ea9507045adb8e870f7 \ - --hash=sha256:c0f5aaa82ce1854a386197e4e359b120ad6d4e57ae2c812fce42219a3288026b +gcp-docuploader==0.6.4 \ + --hash=sha256:01486419e24633af78fd0167db74a2763974765ee8078ca6eb6964d0ebd388af \ + --hash=sha256:70861190c123d907b3b067da896265ead2eeb9263969d6955c9e0bb091b5ccbf # via -r requirements.in -gcp-releasetool==1.8.7 \ - --hash=sha256:3d2a67c9db39322194afb3b427e9cb0476ce8f2a04033695f0aeb63979fc2b37 \ - --hash=sha256:5e4d28f66e90780d77f3ecf1e9155852b0c3b13cbccb08ab07e66b2357c8da8d +gcp-releasetool==1.10.0 \ + --hash=sha256:72a38ca91b59c24f7e699e9227c90cbe4dd71b789383cb0164b088abae294c83 \ + --hash=sha256:8c7c99320208383d4bb2b808c6880eb7a81424afe7cdba3c8d84b25f4f0e097d # via -r requirements.in -google-api-core==2.8.2 \ - --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ - --hash=sha256:93c6a91ccac79079ac6bbf8b74ee75db970cc899278b97d53bc012f35908cf50 +google-api-core==2.10.2 \ + --hash=sha256:10c06f7739fe57781f87523375e8e1a3a4674bf6392cd6131a3222182b971320 \ + --hash=sha256:34f24bd1d5f72a8c4519773d99ca6bf080a6c4e041b4e9f024fe230191dda62e # via # google-cloud-core # google-cloud-storage -google-auth==2.11.0 \ - --hash=sha256:be62acaae38d0049c21ca90f27a23847245c9f161ff54ede13af2cb6afecbac9 \ - --hash=sha256:ed65ecf9f681832298e29328e1ef0a3676e3732b2e56f41532d45f70a22de0fb +google-auth==2.14.1 \ + --hash=sha256:ccaa901f31ad5cbb562615eb8b664b3dd0bf5404a67618e642307f00613eda4d \ + --hash=sha256:f5d8701633bebc12e0deea4df8abd8aff31c28b355360597f7f2ee60f2e4d016 # via # gcp-releasetool # google-api-core @@ -174,76 +181,102 @@ google-cloud-core==2.3.2 \ --hash=sha256:8417acf6466be2fa85123441696c4badda48db314c607cf1e5d543fa8bdc22fe \ --hash=sha256:b9529ee7047fd8d4bf4a2182de619154240df17fbe60ead399078c1ae152af9a # via google-cloud-storage -google-cloud-storage==2.5.0 \ - --hash=sha256:19a26c66c317ce542cea0830b7e787e8dac2588b6bfa4d3fd3b871ba16305ab0 \ - --hash=sha256:382f34b91de2212e3c2e7b40ec079d27ee2e3dbbae99b75b1bcd8c63063ce235 +google-cloud-storage==2.6.0 \ + --hash=sha256:104ca28ae61243b637f2f01455cc8a05e8f15a2a18ced96cb587241cdd3820f5 \ + --hash=sha256:4ad0415ff61abdd8bb2ae81c1f8f7ec7d91a1011613f2db87c614c550f97bfe9 # via gcp-docuploader -google-crc32c==1.3.0 \ - --hash=sha256:04e7c220798a72fd0f08242bc8d7a05986b2a08a0573396187fd32c1dcdd58b3 \ - --hash=sha256:05340b60bf05b574159e9bd940152a47d38af3fb43803ffe71f11d704b7696a6 \ - --hash=sha256:12674a4c3b56b706153a358eaa1018c4137a5a04635b92b4652440d3d7386206 \ - --hash=sha256:127f9cc3ac41b6a859bd9dc4321097b1a4f6aa7fdf71b4f9227b9e3ebffb4422 \ - --hash=sha256:13af315c3a0eec8bb8b8d80b8b128cb3fcd17d7e4edafc39647846345a3f003a \ - --hash=sha256:1926fd8de0acb9d15ee757175ce7242e235482a783cd4ec711cc999fc103c24e \ - --hash=sha256:226f2f9b8e128a6ca6a9af9b9e8384f7b53a801907425c9a292553a3a7218ce0 \ - --hash=sha256:276de6273eb074a35bc598f8efbc00c7869c5cf2e29c90748fccc8c898c244df \ - --hash=sha256:318f73f5484b5671f0c7f5f63741ab020a599504ed81d209b5c7129ee4667407 \ - --hash=sha256:3bbce1be3687bbfebe29abdb7631b83e6b25da3f4e1856a1611eb21854b689ea \ - --hash=sha256:42ae4781333e331a1743445931b08ebdad73e188fd554259e772556fc4937c48 \ - --hash=sha256:58be56ae0529c664cc04a9c76e68bb92b091e0194d6e3c50bea7e0f266f73713 \ - --hash=sha256:5da2c81575cc3ccf05d9830f9e8d3c70954819ca9a63828210498c0774fda1a3 \ - --hash=sha256:6311853aa2bba4064d0c28ca54e7b50c4d48e3de04f6770f6c60ebda1e975267 \ - --hash=sha256:650e2917660e696041ab3dcd7abac160b4121cd9a484c08406f24c5964099829 \ - --hash=sha256:6a4db36f9721fdf391646685ecffa404eb986cbe007a3289499020daf72e88a2 \ - --hash=sha256:779cbf1ce375b96111db98fca913c1f5ec11b1d870e529b1dc7354b2681a8c3a \ - --hash=sha256:7f6fe42536d9dcd3e2ffb9d3053f5d05221ae3bbcefbe472bdf2c71c793e3183 \ - --hash=sha256:891f712ce54e0d631370e1f4997b3f182f3368179198efc30d477c75d1f44942 \ - --hash=sha256:95c68a4b9b7828ba0428f8f7e3109c5d476ca44996ed9a5f8aac6269296e2d59 \ - --hash=sha256:96a8918a78d5d64e07c8ea4ed2bc44354e3f93f46a4866a40e8db934e4c0d74b \ - --hash=sha256:9c3cf890c3c0ecfe1510a452a165431b5831e24160c5fcf2071f0f85ca5a47cd \ - --hash=sha256:9f58099ad7affc0754ae42e6d87443299f15d739b0ce03c76f515153a5cda06c \ - --hash=sha256:a0b9e622c3b2b8d0ce32f77eba617ab0d6768b82836391e4f8f9e2074582bf02 \ - --hash=sha256:a7f9cbea4245ee36190f85fe1814e2d7b1e5f2186381b082f5d59f99b7f11328 \ - --hash=sha256:bab4aebd525218bab4ee615786c4581952eadc16b1ff031813a2fd51f0cc7b08 \ - --hash=sha256:c124b8c8779bf2d35d9b721e52d4adb41c9bfbde45e6a3f25f0820caa9aba73f \ - --hash=sha256:c9da0a39b53d2fab3e5467329ed50e951eb91386e9d0d5b12daf593973c3b168 \ - --hash=sha256:ca60076c388728d3b6ac3846842474f4250c91efbfe5afa872d3ffd69dd4b318 \ - --hash=sha256:cb6994fff247987c66a8a4e550ef374671c2b82e3c0d2115e689d21e511a652d \ - --hash=sha256:d1c1d6236feab51200272d79b3d3e0f12cf2cbb12b208c835b175a21efdb0a73 \ - --hash=sha256:dd7760a88a8d3d705ff562aa93f8445ead54f58fd482e4f9e2bafb7e177375d4 \ - --hash=sha256:dda4d8a3bb0b50f540f6ff4b6033f3a74e8bf0bd5320b70fab2c03e512a62812 \ - --hash=sha256:e0f1ff55dde0ebcfbef027edc21f71c205845585fffe30d4ec4979416613e9b3 \ - --hash=sha256:e7a539b9be7b9c00f11ef16b55486141bc2cdb0c54762f84e3c6fc091917436d \ - --hash=sha256:eb0b14523758e37802f27b7f8cd973f5f3d33be7613952c0df904b68c4842f0e \ - --hash=sha256:ed447680ff21c14aaceb6a9f99a5f639f583ccfe4ce1a5e1d48eb41c3d6b3217 \ - --hash=sha256:f52a4ad2568314ee713715b1e2d79ab55fab11e8b304fd1462ff5cccf4264b3e \ - --hash=sha256:fbd60c6aaa07c31d7754edbc2334aef50601b7f1ada67a96eb1eb57c7c72378f \ - --hash=sha256:fc28e0db232c62ca0c3600884933178f0825c99be4474cdd645e378a10588125 \ - --hash=sha256:fe31de3002e7b08eb20823b3735b97c86c5926dd0581c7710a680b418a8709d4 \ - --hash=sha256:fec221a051150eeddfdfcff162e6db92c65ecf46cb0f7bb1bf812a1520ec026b \ - --hash=sha256:ff71073ebf0e42258a42a0b34f2c09ec384977e7f6808999102eedd5b49920e3 +google-crc32c==1.5.0 \ + --hash=sha256:024894d9d3cfbc5943f8f230e23950cd4906b2fe004c72e29b209420a1e6b05a \ + --hash=sha256:02c65b9817512edc6a4ae7c7e987fea799d2e0ee40c53ec573a692bee24de876 \ + --hash=sha256:02ebb8bf46c13e36998aeaad1de9b48f4caf545e91d14041270d9dca767b780c \ + --hash=sha256:07eb3c611ce363c51a933bf6bd7f8e3878a51d124acfc89452a75120bc436289 \ + --hash=sha256:1034d91442ead5a95b5aaef90dbfaca8633b0247d1e41621d1e9f9db88c36298 \ + --hash=sha256:116a7c3c616dd14a3de8c64a965828b197e5f2d121fedd2f8c5585c547e87b02 \ + --hash=sha256:19e0a019d2c4dcc5e598cd4a4bc7b008546b0358bd322537c74ad47a5386884f \ + --hash=sha256:1c7abdac90433b09bad6c43a43af253e688c9cfc1c86d332aed13f9a7c7f65e2 \ + --hash=sha256:1e986b206dae4476f41bcec1faa057851f3889503a70e1bdb2378d406223994a \ + --hash=sha256:272d3892a1e1a2dbc39cc5cde96834c236d5327e2122d3aaa19f6614531bb6eb \ + --hash=sha256:278d2ed7c16cfc075c91378c4f47924c0625f5fc84b2d50d921b18b7975bd210 \ + --hash=sha256:2ad40e31093a4af319dadf503b2467ccdc8f67c72e4bcba97f8c10cb078207b5 \ + --hash=sha256:2e920d506ec85eb4ba50cd4228c2bec05642894d4c73c59b3a2fe20346bd00ee \ + --hash=sha256:3359fc442a743e870f4588fcf5dcbc1bf929df1fad8fb9905cd94e5edb02e84c \ + --hash=sha256:37933ec6e693e51a5b07505bd05de57eee12f3e8c32b07da7e73669398e6630a \ + --hash=sha256:398af5e3ba9cf768787eef45c803ff9614cc3e22a5b2f7d7ae116df8b11e3314 \ + --hash=sha256:3b747a674c20a67343cb61d43fdd9207ce5da6a99f629c6e2541aa0e89215bcd \ + --hash=sha256:461665ff58895f508e2866824a47bdee72497b091c730071f2b7575d5762ab65 \ + --hash=sha256:4c6fdd4fccbec90cc8a01fc00773fcd5fa28db683c116ee3cb35cd5da9ef6c37 \ + --hash=sha256:5829b792bf5822fd0a6f6eb34c5f81dd074f01d570ed7f36aa101d6fc7a0a6e4 \ + --hash=sha256:596d1f98fc70232fcb6590c439f43b350cb762fb5d61ce7b0e9db4539654cc13 \ + --hash=sha256:5ae44e10a8e3407dbe138984f21e536583f2bba1be9491239f942c2464ac0894 \ + --hash=sha256:635f5d4dd18758a1fbd1049a8e8d2fee4ffed124462d837d1a02a0e009c3ab31 \ + --hash=sha256:64e52e2b3970bd891309c113b54cf0e4384762c934d5ae56e283f9a0afcd953e \ + --hash=sha256:66741ef4ee08ea0b2cc3c86916ab66b6aef03768525627fd6a1b34968b4e3709 \ + --hash=sha256:67b741654b851abafb7bc625b6d1cdd520a379074e64b6a128e3b688c3c04740 \ + --hash=sha256:6ac08d24c1f16bd2bf5eca8eaf8304812f44af5cfe5062006ec676e7e1d50afc \ + --hash=sha256:6f998db4e71b645350b9ac28a2167e6632c239963ca9da411523bb439c5c514d \ + --hash=sha256:72218785ce41b9cfd2fc1d6a017dc1ff7acfc4c17d01053265c41a2c0cc39b8c \ + --hash=sha256:74dea7751d98034887dbd821b7aae3e1d36eda111d6ca36c206c44478035709c \ + --hash=sha256:759ce4851a4bb15ecabae28f4d2e18983c244eddd767f560165563bf9aefbc8d \ + --hash=sha256:77e2fd3057c9d78e225fa0a2160f96b64a824de17840351b26825b0848022906 \ + --hash=sha256:7c074fece789b5034b9b1404a1f8208fc2d4c6ce9decdd16e8220c5a793e6f61 \ + --hash=sha256:7c42c70cd1d362284289c6273adda4c6af8039a8ae12dc451dcd61cdabb8ab57 \ + --hash=sha256:7f57f14606cd1dd0f0de396e1e53824c371e9544a822648cd76c034d209b559c \ + --hash=sha256:83c681c526a3439b5cf94f7420471705bbf96262f49a6fe546a6db5f687a3d4a \ + --hash=sha256:8485b340a6a9e76c62a7dce3c98e5f102c9219f4cfbf896a00cf48caf078d438 \ + --hash=sha256:84e6e8cd997930fc66d5bb4fde61e2b62ba19d62b7abd7a69920406f9ecca946 \ + --hash=sha256:89284716bc6a5a415d4eaa11b1726d2d60a0cd12aadf5439828353662ede9dd7 \ + --hash=sha256:8b87e1a59c38f275c0e3676fc2ab6d59eccecfd460be267ac360cc31f7bcde96 \ + --hash=sha256:8f24ed114432de109aa9fd317278518a5af2d31ac2ea6b952b2f7782b43da091 \ + --hash=sha256:98cb4d057f285bd80d8778ebc4fde6b4d509ac3f331758fb1528b733215443ae \ + --hash=sha256:998679bf62b7fb599d2878aa3ed06b9ce688b8974893e7223c60db155f26bd8d \ + --hash=sha256:9ba053c5f50430a3fcfd36f75aff9caeba0440b2d076afdb79a318d6ca245f88 \ + --hash=sha256:9c99616c853bb585301df6de07ca2cadad344fd1ada6d62bb30aec05219c45d2 \ + --hash=sha256:a1fd716e7a01f8e717490fbe2e431d2905ab8aa598b9b12f8d10abebb36b04dd \ + --hash=sha256:a2355cba1f4ad8b6988a4ca3feed5bff33f6af2d7f134852cf279c2aebfde541 \ + --hash=sha256:b1f8133c9a275df5613a451e73f36c2aea4fe13c5c8997e22cf355ebd7bd0728 \ + --hash=sha256:b8667b48e7a7ef66afba2c81e1094ef526388d35b873966d8a9a447974ed9178 \ + --hash=sha256:ba1eb1843304b1e5537e1fca632fa894d6f6deca8d6389636ee5b4797affb968 \ + --hash=sha256:be82c3c8cfb15b30f36768797a640e800513793d6ae1724aaaafe5bf86f8f346 \ + --hash=sha256:c02ec1c5856179f171e032a31d6f8bf84e5a75c45c33b2e20a3de353b266ebd8 \ + --hash=sha256:c672d99a345849301784604bfeaeba4db0c7aae50b95be04dd651fd2a7310b93 \ + --hash=sha256:c6c777a480337ac14f38564ac88ae82d4cd238bf293f0a22295b66eb89ffced7 \ + --hash=sha256:cae0274952c079886567f3f4f685bcaf5708f0a23a5f5216fdab71f81a6c0273 \ + --hash=sha256:cd67cf24a553339d5062eff51013780a00d6f97a39ca062781d06b3a73b15462 \ + --hash=sha256:d3515f198eaa2f0ed49f8819d5732d70698c3fa37384146079b3799b97667a94 \ + --hash=sha256:d5280312b9af0976231f9e317c20e4a61cd2f9629b7bfea6a693d1878a264ebd \ + --hash=sha256:de06adc872bcd8c2a4e0dc51250e9e65ef2ca91be023b9d13ebd67c2ba552e1e \ + --hash=sha256:e1674e4307fa3024fc897ca774e9c7562c957af85df55efe2988ed9056dc4e57 \ + --hash=sha256:e2096eddb4e7c7bdae4bd69ad364e55e07b8316653234a56552d9c988bd2d61b \ + --hash=sha256:e560628513ed34759456a416bf86b54b2476c59144a9138165c9a1575801d0d9 \ + --hash=sha256:edfedb64740750e1a3b16152620220f51d58ff1b4abceb339ca92e934775c27a \ + --hash=sha256:f13cae8cc389a440def0c8c52057f37359014ccbc9dc1f0827936bcd367c6100 \ + --hash=sha256:f314013e7dcd5cf45ab1945d92e713eec788166262ae8deb2cfacd53def27325 \ + --hash=sha256:f583edb943cf2e09c60441b910d6a20b4d9d626c75a36c8fcac01a6c96c01183 \ + --hash=sha256:fd8536e902db7e365f49e7d9029283403974ccf29b13fc7028b97e2295b33556 \ + --hash=sha256:fe70e325aa68fa4b5edf7d1a4b6f691eb04bbccac0ace68e34820d283b5f80d4 # via google-resumable-media -google-resumable-media==2.3.3 \ - --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ - --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 +google-resumable-media==2.4.0 \ + --hash=sha256:2aa004c16d295c8f6c33b2b4788ba59d366677c0a25ae7382436cb30f776deaa \ + --hash=sha256:8d5518502f92b9ecc84ac46779bd4f09694ecb3ba38a3e7ca737a86d15cbca1f # via google-cloud-storage -googleapis-common-protos==1.56.4 \ - --hash=sha256:8eb2cbc91b69feaf23e32452a7ae60e791e09967d81d4fcc7fc388182d1bd394 \ - --hash=sha256:c25873c47279387cfdcbdafa36149887901d36202cb645a0e4f29686bf6e4417 +googleapis-common-protos==1.57.0 \ + --hash=sha256:27a849d6205838fb6cc3c1c21cb9800707a661bb21c6ce7fb13e99eb1f8a0c46 \ + --hash=sha256:a9f4a1d7f6d9809657b7f1316a1aa527f6664891531bcfcc13b6696e685f443c # via google-api-core -idna==3.3 \ - --hash=sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff \ - --hash=sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d +idna==3.4 \ + --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ + --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 # via requests -importlib-metadata==4.12.0 \ - --hash=sha256:637245b8bab2b6502fcbc752cc4b7a6f6243bb02b31c5c26156ad103d3d45670 \ - --hash=sha256:7401a975809ea1fdc658c3aa4f78cc2195a0e019c5cbc4c06122884e9ae80c23 +importlib-metadata==5.0.0 \ + --hash=sha256:da31db32b304314d044d3c12c79bd59e307889b287ad12ff387b3500835fc2ab \ + --hash=sha256:ddb0e35065e8938f867ed4928d0ae5bf2a53b7773871bfe6bcc7e4fcdc7dea43 # via # -r requirements.in + # keyring # twine -jaraco-classes==3.2.2 \ - --hash=sha256:6745f113b0b588239ceb49532aa09c3ebb947433ce311ef2f8e3ad64ebb74594 \ - --hash=sha256:e6ef6fd3fcf4579a7a019d87d1e56a883f4e4c35cfe925f86731abc58804e647 +jaraco-classes==3.2.3 \ + --hash=sha256:2353de3288bc6b82120752201c6b1c1a14b058267fa424ed5ce5984e3b922158 \ + --hash=sha256:89559fa5c1d3c34eff6f631ad80bb21f378dbcbb35dd161fd2c6b93f5be2f98a # via keyring jeepney==0.8.0 \ --hash=sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806 \ @@ -255,9 +288,9 @@ jinja2==3.1.2 \ --hash=sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 \ --hash=sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61 # via gcp-releasetool -keyring==23.9.0 \ - --hash=sha256:4c32a31174faaee48f43a7e2c7e9c3216ec5e95acf22a2bebfb4a1d05056ee44 \ - --hash=sha256:98f060ec95ada2ab910c195a2d4317be6ef87936a766b239c46aa3c7aac4f0db +keyring==23.11.0 \ + --hash=sha256:3dd30011d555f1345dec2c262f0153f2f0ca6bca041fb1dc4588349bb4c0ac1e \ + --hash=sha256:ad192263e2cdd5f12875dedc2da13534359a7e760e77f8d04b50968a821c2361 # via # gcp-releasetool # twine @@ -303,9 +336,9 @@ markupsafe==2.1.1 \ --hash=sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a \ --hash=sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7 # via jinja2 -more-itertools==8.14.0 \ - --hash=sha256:1bc4f91ee5b1b31ac7ceacc17c09befe6a40a503907baf9c839c229b5095cfd2 \ - --hash=sha256:c09443cd3d5438b8dafccd867a6bc1cb0894389e90cb53d227456b0b0bccb750 +more-itertools==9.0.0 \ + --hash=sha256:250e83d7e81d0c87ca6bd942e6aeab8cc9daa6096d12c5308f3f92fa5e5c1f41 \ + --hash=sha256:5a6257e40878ef0520b1803990e3e22303a41b5714006c32a3fd8304b26ea1ab # via jaraco-classes nox==2022.8.7 \ --hash=sha256:1b894940551dc5c389f9271d197ca5d655d40bdc6ccf93ed6880e4042760a34b \ @@ -321,34 +354,33 @@ pkginfo==1.8.3 \ --hash=sha256:848865108ec99d4901b2f7e84058b6e7660aae8ae10164e015a6dcf5b242a594 \ --hash=sha256:a84da4318dd86f870a9447a8c98340aa06216bfc6f2b7bdc4b8766984ae1867c # via twine -platformdirs==2.5.2 \ - --hash=sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788 \ - --hash=sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19 +platformdirs==2.5.4 \ + --hash=sha256:1006647646d80f16130f052404c6b901e80ee4ed6bef6792e1f238a8969106f7 \ + --hash=sha256:af0276409f9a02373d540bf8480021a048711d572745aef4b7842dad245eba10 # via virtualenv -protobuf==3.20.2 \ - --hash=sha256:03d76b7bd42ac4a6e109742a4edf81ffe26ffd87c5993126d894fe48a120396a \ - --hash=sha256:09e25909c4297d71d97612f04f41cea8fa8510096864f2835ad2f3b3df5a5559 \ - --hash=sha256:18e34a10ae10d458b027d7638a599c964b030c1739ebd035a1dfc0e22baa3bfe \ - --hash=sha256:291fb4307094bf5ccc29f424b42268640e00d5240bf0d9b86bf3079f7576474d \ - --hash=sha256:2c0b040d0b5d5d207936ca2d02f00f765906622c07d3fa19c23a16a8ca71873f \ - --hash=sha256:384164994727f274cc34b8abd41a9e7e0562801361ee77437099ff6dfedd024b \ - --hash=sha256:3cb608e5a0eb61b8e00fe641d9f0282cd0eedb603be372f91f163cbfbca0ded0 \ - --hash=sha256:5d9402bf27d11e37801d1743eada54372f986a372ec9679673bfcc5c60441151 \ - --hash=sha256:712dca319eee507a1e7df3591e639a2b112a2f4a62d40fe7832a16fd19151750 \ - --hash=sha256:7a5037af4e76c975b88c3becdf53922b5ffa3f2cddf657574a4920a3b33b80f3 \ - --hash=sha256:8228e56a865c27163d5d1d1771d94b98194aa6917bcfb6ce139cbfa8e3c27334 \ - --hash=sha256:84a1544252a933ef07bb0b5ef13afe7c36232a774affa673fc3636f7cee1db6c \ - --hash=sha256:84fe5953b18a383fd4495d375fe16e1e55e0a3afe7b4f7b4d01a3a0649fcda9d \ - --hash=sha256:9c673c8bfdf52f903081816b9e0e612186684f4eb4c17eeb729133022d6032e3 \ - --hash=sha256:9f876a69ca55aed879b43c295a328970306e8e80a263ec91cf6e9189243c613b \ - --hash=sha256:a9e5ae5a8e8985c67e8944c23035a0dff2c26b0f5070b2f55b217a1c33bbe8b1 \ - --hash=sha256:b4fdb29c5a7406e3f7ef176b2a7079baa68b5b854f364c21abe327bbeec01cdb \ - --hash=sha256:c184485e0dfba4dfd451c3bd348c2e685d6523543a0f91b9fd4ae90eb09e8422 \ - --hash=sha256:c9cdf251c582c16fd6a9f5e95836c90828d51b0069ad22f463761d27c6c19019 \ - --hash=sha256:e39cf61bb8582bda88cdfebc0db163b774e7e03364bbf9ce1ead13863e81e359 \ - --hash=sha256:e8fbc522303e09036c752a0afcc5c0603e917222d8bedc02813fd73b4b4ed804 \ - --hash=sha256:f34464ab1207114e73bba0794d1257c150a2b89b7a9faf504e00af7c9fd58978 \ - --hash=sha256:f52dabc96ca99ebd2169dadbe018824ebda08a795c7684a0b7d203a290f3adb0 +protobuf==3.20.3 \ + --hash=sha256:03038ac1cfbc41aa21f6afcbcd357281d7521b4157926f30ebecc8d4ea59dcb7 \ + --hash=sha256:28545383d61f55b57cf4df63eebd9827754fd2dc25f80c5253f9184235db242c \ + --hash=sha256:2e3427429c9cffebf259491be0af70189607f365c2f41c7c3764af6f337105f2 \ + --hash=sha256:398a9e0c3eaceb34ec1aee71894ca3299605fa8e761544934378bbc6c97de23b \ + --hash=sha256:44246bab5dd4b7fbd3c0c80b6f16686808fab0e4aca819ade6e8d294a29c7050 \ + --hash=sha256:447d43819997825d4e71bf5769d869b968ce96848b6479397e29fc24c4a5dfe9 \ + --hash=sha256:67a3598f0a2dcbc58d02dd1928544e7d88f764b47d4a286202913f0b2801c2e7 \ + --hash=sha256:74480f79a023f90dc6e18febbf7b8bac7508420f2006fabd512013c0c238f454 \ + --hash=sha256:819559cafa1a373b7096a482b504ae8a857c89593cf3a25af743ac9ecbd23480 \ + --hash=sha256:899dc660cd599d7352d6f10d83c95df430a38b410c1b66b407a6b29265d66469 \ + --hash=sha256:8c0c984a1b8fef4086329ff8dd19ac77576b384079247c770f29cc8ce3afa06c \ + --hash=sha256:9aae4406ea63d825636cc11ffb34ad3379335803216ee3a856787bcf5ccc751e \ + --hash=sha256:a7ca6d488aa8ff7f329d4c545b2dbad8ac31464f1d8b1c87ad1346717731e4db \ + --hash=sha256:b6cc7ba72a8850621bfec987cb72623e703b7fe2b9127a161ce61e61558ad905 \ + --hash=sha256:bf01b5720be110540be4286e791db73f84a2b721072a3711efff6c324cdf074b \ + --hash=sha256:c02ce36ec760252242a33967d51c289fd0e1c0e6e5cc9397e2279177716add86 \ + --hash=sha256:d9e4432ff660d67d775c66ac42a67cf2453c27cb4d738fc22cb53b5d84c135d4 \ + --hash=sha256:daa564862dd0d39c00f8086f88700fdbe8bc717e993a21e90711acfed02f2402 \ + --hash=sha256:de78575669dddf6099a8a0f46a27e82a1783c557ccc38ee620ed8cc96d3be7d7 \ + --hash=sha256:e64857f395505ebf3d2569935506ae0dfc4a15cb80dc25261176c784662cdcc4 \ + --hash=sha256:f4bd856d702e5b0d96a00ec6b307b0f51c1982c2bf9c0052cf9019e9a544ba99 \ + --hash=sha256:f4c42102bc82a51108e449cbb32b19b180022941c727bac0cfd50170341f16ee # via # gcp-docuploader # gcp-releasetool @@ -377,9 +409,9 @@ pygments==2.13.0 \ # via # readme-renderer # rich -pyjwt==2.4.0 \ - --hash=sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf \ - --hash=sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba +pyjwt==2.6.0 \ + --hash=sha256:69285c7e31fc44f68a1feb309e948e0df53259d579295e6cfe2b1792329f05fd \ + --hash=sha256:d83c3d892a77bbb74d3e1a2cfa90afaadb60945205d1095d9221f04466f64c14 # via gcp-releasetool pyparsing==3.0.9 \ --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ @@ -392,9 +424,9 @@ python-dateutil==2.8.2 \ --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 # via gcp-releasetool -readme-renderer==37.0 \ - --hash=sha256:07b7ea234e03e58f77cc222e206e6abb8f4c0435becce5104794ee591f9301c5 \ - --hash=sha256:9fa416704703e509eeb900696751c908ddeb2011319d93700d8f18baff887a69 +readme-renderer==37.3 \ + --hash=sha256:cd653186dfc73055656f090f227f5cb22a046d7f71a841dfa305f55c9a513273 \ + --hash=sha256:f67a16caedfa71eef48a31b39708637a6f4664c4394801a7b0d6432d13907343 # via twine requests==2.28.1 \ --hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983 \ @@ -405,17 +437,17 @@ requests==2.28.1 \ # google-cloud-storage # requests-toolbelt # twine -requests-toolbelt==0.9.1 \ - --hash=sha256:380606e1d10dc85c3bd47bf5a6095f815ec007be7a8b69c878507068df059e6f \ - --hash=sha256:968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0 +requests-toolbelt==0.10.1 \ + --hash=sha256:18565aa58116d9951ac39baa288d3adb5b3ff975c4f25eee78555d89e8f247f7 \ + --hash=sha256:62e09f7ff5ccbda92772a29f394a49c3ad6cb181d568b1337626b2abb628a63d # via twine rfc3986==2.0.0 \ --hash=sha256:50b1502b60e289cb37883f3dfd34532b8873c7de9f49bb546641ce9cbd256ebd \ --hash=sha256:97aacf9dbd4bfd829baad6e6309fa6573aaf1be3f6fa735c8ab05e46cecb261c # via twine -rich==12.5.1 \ - --hash=sha256:2eb4e6894cde1e017976d2975ac210ef515d7548bc595ba20e195fb9628acdeb \ - --hash=sha256:63a5c5ce3673d3d5fbbf23cd87e11ab84b6b451436f1b7f19ec54b6bc36ed7ca +rich==12.6.0 \ + --hash=sha256:a4eb26484f2c82589bd9a17c73d32a010b1e29d89f1604cd9bf3a2097b81bb5e \ + --hash=sha256:ba3a3775974105c221d31141f2c116f4fd65c5ceb0698657a11e9f295ec93fd0 # via twine rsa==4.9 \ --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ @@ -437,9 +469,9 @@ twine==4.0.1 \ --hash=sha256:42026c18e394eac3e06693ee52010baa5313e4811d5a11050e7d48436cf41b9e \ --hash=sha256:96b1cf12f7ae611a4a40b6ae8e9570215daff0611828f5fe1f37a16255ab24a0 # via -r requirements.in -typing-extensions==4.3.0 \ - --hash=sha256:25642c956049920a5aa49edcdd6ab1e06d7e5d467fc00e0506c44ac86fbfca02 \ - --hash=sha256:e6d2677a32f47fc7eb2795db1dd15c1f34eff616bcaf2cfb5e997f854fa1c4a6 +typing-extensions==4.4.0 \ + --hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \ + --hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e # via -r requirements.in urllib3==1.26.12 \ --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ @@ -447,25 +479,25 @@ urllib3==1.26.12 \ # via # requests # twine -virtualenv==20.16.4 \ - --hash=sha256:014f766e4134d0008dcaa1f95bafa0fb0f575795d07cae50b1bee514185d6782 \ - --hash=sha256:035ed57acce4ac35c82c9d8802202b0e71adac011a511ff650cbcf9635006a22 +virtualenv==20.16.7 \ + --hash=sha256:8691e3ff9387f743e00f6bb20f70121f5e4f596cae754531f2b3b3a1b1ac696e \ + --hash=sha256:efd66b00386fdb7dbe4822d172303f40cd05e50e01740b19ea42425cbe653e29 # via nox webencodings==0.5.1 \ --hash=sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78 \ --hash=sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923 # via bleach -wheel==0.37.1 \ - --hash=sha256:4bdcd7d840138086126cd09254dc6195fb4fc6f01c050a1d7236f2630db1d22a \ - --hash=sha256:e9a504e793efbca1b8e0e9cb979a249cf4a0a7b5b8c9e8b65a5e39d49529c1c4 +wheel==0.38.4 \ + --hash=sha256:965f5259b566725405b05e7cf774052044b1ed30119b5d586b2703aafe8719ac \ + --hash=sha256:b60533f3f5d530e971d6737ca6d58681ee434818fab630c83a734bb10c083ce8 # via -r requirements.in -zipp==3.8.1 \ - --hash=sha256:05b45f1ee8f807d0cc928485ca40a07cb491cf092ff587c0df9cb1fd154848d2 \ - --hash=sha256:47c40d7fe183a6f21403a199b3e4192cca5774656965b0a4988ad2f8feb5f009 +zipp==3.10.0 \ + --hash=sha256:4fcb6f278987a6605757302a6e40e896257570d11c51628968ccb2a47e80c6c1 \ + --hash=sha256:7a7262fd930bd3e36c50b9a64897aec3fafff3dfdeec9623ae22b40e93f99bb8 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: -setuptools==65.2.0 \ - --hash=sha256:7f4bc85450898a09f76ebf28b72fa25bc7111f6c7d665d514a60bba9c75ef2a9 \ - --hash=sha256:a3ca5857c89f82f5c9410e8508cb32f4872a3bafd4aa7ae122a24ca33bccc750 +setuptools==65.5.1 \ + --hash=sha256:d0b9a8433464d5800cbe05094acf5c6d52a91bfac9b52bcfc4d41382be5d5d31 \ + --hash=sha256:e197a19aa8ec9722928f2206f8de752def0e4c9fc6953527360d1c36d94ddb2f # via -r requirements.in diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 46d23716..5405cc8f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: rev: 22.3.0 hooks: - id: black -- repo: https://gitlab.com/pycqa/flake8 +- repo: https://github.com/pycqa/flake8 rev: 3.9.2 hooks: - id: flake8 diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..2ef9a1c2 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.14.0" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index faff643c..869124dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,30 @@ # Changelog +## [1.14.0](https://github.com/googleapis/python-dialogflow-cx/compare/v1.13.5...v1.14.0) (2022-12-15) + + +### Features + +* Add files field to finding's list of attributes ([ff576ee](https://github.com/googleapis/python-dialogflow-cx/commit/ff576eefe4a202327fd3de6e98da1cca24ddad4e)) +* Add support for `google.cloud.dialogflowcx.__version__` ([ff576ee](https://github.com/googleapis/python-dialogflow-cx/commit/ff576eefe4a202327fd3de6e98da1cca24ddad4e)) +* Add typing to proto.Message based class attributes ([ff576ee](https://github.com/googleapis/python-dialogflow-cx/commit/ff576eefe4a202327fd3de6e98da1cca24ddad4e)) + + +### Bug Fixes + +* Add dict typing for client_options ([ff576ee](https://github.com/googleapis/python-dialogflow-cx/commit/ff576eefe4a202327fd3de6e98da1cca24ddad4e)) +* **deps:** Require google-api-core >=1.34.0, >=2.11.0 ([ff576ee](https://github.com/googleapis/python-dialogflow-cx/commit/ff576eefe4a202327fd3de6e98da1cca24ddad4e)) +* Drop usage of pkg_resources ([ff576ee](https://github.com/googleapis/python-dialogflow-cx/commit/ff576eefe4a202327fd3de6e98da1cca24ddad4e)) +* Fix timeout default values ([ff576ee](https://github.com/googleapis/python-dialogflow-cx/commit/ff576eefe4a202327fd3de6e98da1cca24ddad4e)) + + +### Documentation + +* Clarified Agent Assist max retention is 30 days ([ff576ee](https://github.com/googleapis/python-dialogflow-cx/commit/ff576eefe4a202327fd3de6e98da1cca24ddad4e)) +* Clarify interactive logging TTL behavior ([ff576ee](https://github.com/googleapis/python-dialogflow-cx/commit/ff576eefe4a202327fd3de6e98da1cca24ddad4e)) +* **samples:** Snippetgen handling of repeated enum field ([ff576ee](https://github.com/googleapis/python-dialogflow-cx/commit/ff576eefe4a202327fd3de6e98da1cca24ddad4e)) +* **samples:** Snippetgen should call await on the operation coroutine before calling result ([ff576ee](https://github.com/googleapis/python-dialogflow-cx/commit/ff576eefe4a202327fd3de6e98da1cca24ddad4e)) + ## [1.13.5](https://github.com/googleapis/python-dialogflow-cx/compare/v1.13.4...v1.13.5) (2022-10-26) diff --git a/docs/dialogflowcx_v3/types.rst b/docs/dialogflowcx_v3/types.rst index 7e2b1c53..eee8146a 100644 --- a/docs/dialogflowcx_v3/types.rst +++ b/docs/dialogflowcx_v3/types.rst @@ -3,5 +3,4 @@ Types for Google Cloud Dialogflowcx v3 API .. automodule:: google.cloud.dialogflowcx_v3.types :members: - :undoc-members: :show-inheritance: diff --git a/docs/dialogflowcx_v3beta1/types.rst b/docs/dialogflowcx_v3beta1/types.rst index a7388b27..3c1160db 100644 --- a/docs/dialogflowcx_v3beta1/types.rst +++ b/docs/dialogflowcx_v3beta1/types.rst @@ -3,5 +3,4 @@ Types for Google Cloud Dialogflowcx v3beta1 API .. automodule:: google.cloud.dialogflowcx_v3beta1.types :members: - :undoc-members: :show-inheritance: diff --git a/google/cloud/dialogflowcx/__init__.py b/google/cloud/dialogflowcx/__init__.py index ba3e82d1..656c9978 100644 --- a/google/cloud/dialogflowcx/__init__.py +++ b/google/cloud/dialogflowcx/__init__.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.cloud.dialogflowcx import gapic_version as package_version + +__version__ = package_version.__version__ + from google.cloud.dialogflowcx_v3.services.agents.client import AgentsClient from google.cloud.dialogflowcx_v3.services.agents.async_client import AgentsAsyncClient diff --git a/google/cloud/dialogflowcx/gapic_version.py b/google/cloud/dialogflowcx/gapic_version.py new file mode 100644 index 00000000..624a2e53 --- /dev/null +++ b/google/cloud/dialogflowcx/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# 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. +# +__version__ = "1.14.0" # {x-release-please-version} diff --git a/google/cloud/dialogflowcx/py.typed b/google/cloud/dialogflowcx/py.typed index 60fdca49..e6386621 100644 --- a/google/cloud/dialogflowcx/py.typed +++ b/google/cloud/dialogflowcx/py.typed @@ -1,2 +1,2 @@ # Marker file for PEP 561. -# The google-cloud-dialogflowcx package uses inline types. +# The google-cloud-dialogflow-cx package uses inline types. diff --git a/google/cloud/dialogflowcx_v3/__init__.py b/google/cloud/dialogflowcx_v3/__init__.py index ab54c15f..065d9620 100644 --- a/google/cloud/dialogflowcx_v3/__init__.py +++ b/google/cloud/dialogflowcx_v3/__init__.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.cloud.dialogflowcx import gapic_version as package_version + +__version__ = package_version.__version__ + from .services.agents import AgentsClient from .services.agents import AgentsAsyncClient diff --git a/google/cloud/dialogflowcx_v3/gapic_version.py b/google/cloud/dialogflowcx_v3/gapic_version.py new file mode 100644 index 00000000..624a2e53 --- /dev/null +++ b/google/cloud/dialogflowcx_v3/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# 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. +# +__version__ = "1.14.0" # {x-release-please-version} diff --git a/google/cloud/dialogflowcx_v3/py.typed b/google/cloud/dialogflowcx_v3/py.typed index 60fdca49..e6386621 100644 --- a/google/cloud/dialogflowcx_v3/py.typed +++ b/google/cloud/dialogflowcx_v3/py.typed @@ -1,2 +1,2 @@ # Marker file for PEP 561. -# The google-cloud-dialogflowcx package uses inline types. +# The google-cloud-dialogflow-cx package uses inline types. diff --git a/google/cloud/dialogflowcx_v3/services/agents/async_client.py b/google/cloud/dialogflowcx_v3/services/agents/async_client.py index c023d663..dcfbfaff 100644 --- a/google/cloud/dialogflowcx_v3/services/agents/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/agents/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -176,9 +187,9 @@ def transport(self) -> AgentsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, AgentsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the agents client. @@ -222,11 +233,11 @@ def __init__( async def list_agents( self, - request: Union[agent.ListAgentsRequest, dict] = None, + request: Optional[Union[agent.ListAgentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListAgentsAsyncPager: r"""Returns the list of all agents in the specified @@ -260,7 +271,7 @@ async def sample_list_agents(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListAgentsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListAgentsRequest, dict]]): The request object. The request message for [Agents.ListAgents][google.cloud.dialogflow.cx.v3.Agents.ListAgents]. parent (:class:`str`): @@ -338,11 +349,11 @@ async def sample_list_agents(): async def get_agent( self, - request: Union[agent.GetAgentRequest, dict] = None, + request: Optional[Union[agent.GetAgentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> agent.Agent: r"""Retrieves the specified agent. @@ -374,7 +385,7 @@ async def sample_get_agent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetAgentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetAgentRequest, dict]]): The request object. The request message for [Agents.GetAgent][google.cloud.dialogflow.cx.v3.Agents.GetAgent]. name (:class:`str`): @@ -452,12 +463,12 @@ async def sample_get_agent(): async def create_agent( self, - request: Union[gcdc_agent.CreateAgentRequest, dict] = None, + request: Optional[Union[gcdc_agent.CreateAgentRequest, dict]] = None, *, - parent: str = None, - agent: gcdc_agent.Agent = None, + parent: Optional[str] = None, + agent: Optional[gcdc_agent.Agent] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_agent.Agent: r"""Creates an agent in the specified location. @@ -499,7 +510,7 @@ async def sample_create_agent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CreateAgentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CreateAgentRequest, dict]]): The request object. The request message for [Agents.CreateAgent][google.cloud.dialogflow.cx.v3.Agents.CreateAgent]. parent (:class:`str`): @@ -584,12 +595,12 @@ async def sample_create_agent(): async def update_agent( self, - request: Union[gcdc_agent.UpdateAgentRequest, dict] = None, + request: Optional[Union[gcdc_agent.UpdateAgentRequest, dict]] = None, *, - agent: gcdc_agent.Agent = None, - update_mask: field_mask_pb2.FieldMask = None, + agent: Optional[gcdc_agent.Agent] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_agent.Agent: r"""Updates the specified agent. @@ -630,7 +641,7 @@ async def sample_update_agent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.UpdateAgentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.UpdateAgentRequest, dict]]): The request object. The request message for [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent]. agent (:class:`google.cloud.dialogflowcx_v3.types.Agent`): @@ -718,11 +729,11 @@ async def sample_update_agent(): async def delete_agent( self, - request: Union[agent.DeleteAgentRequest, dict] = None, + request: Optional[Union[agent.DeleteAgentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified agent. @@ -751,7 +762,7 @@ async def sample_delete_agent(): await client.delete_agent(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3.types.DeleteAgentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.DeleteAgentRequest, dict]]): The request object. The request message for [Agents.DeleteAgent][google.cloud.dialogflow.cx.v3.Agents.DeleteAgent]. name (:class:`str`): @@ -808,10 +819,10 @@ async def sample_delete_agent(): async def export_agent( self, - request: Union[agent.ExportAgentRequest, dict] = None, + request: Optional[Union[agent.ExportAgentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Exports the specified agent to a binary file. @@ -851,13 +862,13 @@ async def sample_export_agent(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ExportAgentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ExportAgentRequest, dict]]): The request object. The request message for [Agents.ExportAgent][google.cloud.dialogflow.cx.v3.Agents.ExportAgent]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -914,10 +925,10 @@ async def sample_export_agent(): async def restore_agent( self, - request: Union[agent.RestoreAgentRequest, dict] = None, + request: Optional[Union[agent.RestoreAgentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Restores the specified agent from a binary file. @@ -966,13 +977,13 @@ async def sample_restore_agent(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.RestoreAgentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.RestoreAgentRequest, dict]]): The request object. The request message for [Agents.RestoreAgent][google.cloud.dialogflow.cx.v3.Agents.RestoreAgent]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1035,10 +1046,10 @@ async def sample_restore_agent(): async def validate_agent( self, - request: Union[agent.ValidateAgentRequest, dict] = None, + request: Optional[Union[agent.ValidateAgentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> agent.AgentValidationResult: r"""Validates the specified agent and creates or updates @@ -1073,7 +1084,7 @@ async def sample_validate_agent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ValidateAgentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ValidateAgentRequest, dict]]): The request object. The request message for [Agents.ValidateAgent][google.cloud.dialogflow.cx.v3.Agents.ValidateAgent]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1118,11 +1129,11 @@ async def sample_validate_agent(): async def get_agent_validation_result( self, - request: Union[agent.GetAgentValidationResultRequest, dict] = None, + request: Optional[Union[agent.GetAgentValidationResultRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> agent.AgentValidationResult: r"""Gets the latest agent validation result. Agent @@ -1155,7 +1166,7 @@ async def sample_get_agent_validation_result(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetAgentValidationResultRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetAgentValidationResultRequest, dict]]): The request object. The request message for [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3.Agents.GetAgentValidationResult]. name (:class:`str`): @@ -1221,10 +1232,10 @@ async def sample_get_agent_validation_result(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1275,10 +1286,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1329,10 +1340,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1383,10 +1394,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1437,10 +1448,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1496,14 +1507,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("AgentsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/agents/client.py b/google/cloud/dialogflowcx_v3/services/agents/client.py index d6fdc313..e1d2d431 100644 --- a/google/cloud/dialogflowcx_v3/services/agents/client.py +++ b/google/cloud/dialogflowcx_v3/services/agents/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -65,7 +77,7 @@ class AgentsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[AgentsTransport]: """Returns an appropriate transport class. @@ -456,8 +468,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, AgentsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, AgentsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the agents client. @@ -471,7 +483,7 @@ def __init__( transport (Union[str, AgentsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -501,6 +513,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -553,11 +566,11 @@ def __init__( def list_agents( self, - request: Union[agent.ListAgentsRequest, dict] = None, + request: Optional[Union[agent.ListAgentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListAgentsPager: r"""Returns the list of all agents in the specified @@ -669,11 +682,11 @@ def sample_list_agents(): def get_agent( self, - request: Union[agent.GetAgentRequest, dict] = None, + request: Optional[Union[agent.GetAgentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> agent.Agent: r"""Retrieves the specified agent. @@ -783,12 +796,12 @@ def sample_get_agent(): def create_agent( self, - request: Union[gcdc_agent.CreateAgentRequest, dict] = None, + request: Optional[Union[gcdc_agent.CreateAgentRequest, dict]] = None, *, - parent: str = None, - agent: gcdc_agent.Agent = None, + parent: Optional[str] = None, + agent: Optional[gcdc_agent.Agent] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_agent.Agent: r"""Creates an agent in the specified location. @@ -915,12 +928,12 @@ def sample_create_agent(): def update_agent( self, - request: Union[gcdc_agent.UpdateAgentRequest, dict] = None, + request: Optional[Union[gcdc_agent.UpdateAgentRequest, dict]] = None, *, - agent: gcdc_agent.Agent = None, - update_mask: field_mask_pb2.FieldMask = None, + agent: Optional[gcdc_agent.Agent] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_agent.Agent: r"""Updates the specified agent. @@ -1049,11 +1062,11 @@ def sample_update_agent(): def delete_agent( self, - request: Union[agent.DeleteAgentRequest, dict] = None, + request: Optional[Union[agent.DeleteAgentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified agent. @@ -1139,10 +1152,10 @@ def sample_delete_agent(): def export_agent( self, - request: Union[agent.ExportAgentRequest, dict] = None, + request: Optional[Union[agent.ExportAgentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Exports the specified agent to a binary file. @@ -1246,10 +1259,10 @@ def sample_export_agent(): def restore_agent( self, - request: Union[agent.RestoreAgentRequest, dict] = None, + request: Optional[Union[agent.RestoreAgentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Restores the specified agent from a binary file. @@ -1368,10 +1381,10 @@ def sample_restore_agent(): def validate_agent( self, - request: Union[agent.ValidateAgentRequest, dict] = None, + request: Optional[Union[agent.ValidateAgentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> agent.AgentValidationResult: r"""Validates the specified agent and creates or updates @@ -1452,11 +1465,11 @@ def sample_validate_agent(): def get_agent_validation_result( self, - request: Union[agent.GetAgentValidationResultRequest, dict] = None, + request: Optional[Union[agent.GetAgentValidationResultRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> agent.AgentValidationResult: r"""Gets the latest agent validation result. Agent @@ -1570,10 +1583,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1624,10 +1637,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1678,10 +1691,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1732,10 +1745,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1786,10 +1799,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1839,14 +1852,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("AgentsClient",) diff --git a/google/cloud/dialogflowcx_v3/services/agents/transports/base.py b/google/cloud/dialogflowcx_v3/services/agents/transports/base.py index 1047d41d..0128bca3 100644 --- a/google/cloud/dialogflowcx_v3/services/agents/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/agents/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class AgentsTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/agents/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/agents/transports/grpc.py index 45143fa1..ceb67ccb 100644 --- a/google/cloud/dialogflowcx_v3/services/agents/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/agents/transports/grpc.py @@ -53,14 +53,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -188,8 +188,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/agents/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/agents/transports/grpc_asyncio.py index 998eb07f..4071abc6 100644 --- a/google/cloud/dialogflowcx_v3/services/agents/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/agents/transports/grpc_asyncio.py @@ -55,7 +55,7 @@ class AgentsGrpcAsyncIOTransport(AgentsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -98,15 +98,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/changelogs/async_client.py b/google/cloud/dialogflowcx_v3/services/changelogs/async_client.py index 798cda28..ced80002 100644 --- a/google/cloud/dialogflowcx_v3/services/changelogs/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/changelogs/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -157,9 +168,9 @@ def transport(self) -> ChangelogsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, ChangelogsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the changelogs client. @@ -203,11 +214,11 @@ def __init__( async def list_changelogs( self, - request: Union[changelog.ListChangelogsRequest, dict] = None, + request: Optional[Union[changelog.ListChangelogsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListChangelogsAsyncPager: r"""Returns the list of Changelogs. @@ -240,7 +251,7 @@ async def sample_list_changelogs(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListChangelogsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListChangelogsRequest, dict]]): The request object. The request message for [Changelogs.ListChangelogs][google.cloud.dialogflow.cx.v3.Changelogs.ListChangelogs]. parent (:class:`str`): @@ -318,11 +329,11 @@ async def sample_list_changelogs(): async def get_changelog( self, - request: Union[changelog.GetChangelogRequest, dict] = None, + request: Optional[Union[changelog.GetChangelogRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> changelog.Changelog: r"""Retrieves the specified Changelog. @@ -354,7 +365,7 @@ async def sample_get_changelog(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetChangelogRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetChangelogRequest, dict]]): The request object. The request message for [Changelogs.GetChangelog][google.cloud.dialogflow.cx.v3.Changelogs.GetChangelog]. name (:class:`str`): @@ -420,10 +431,10 @@ async def sample_get_changelog(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -474,10 +485,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -528,10 +539,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -582,10 +593,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -636,10 +647,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -695,14 +706,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ChangelogsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/changelogs/client.py b/google/cloud/dialogflowcx_v3/services/changelogs/client.py index 4aef17bd..8df8d152 100644 --- a/google/cloud/dialogflowcx_v3/services/changelogs/client.py +++ b/google/cloud/dialogflowcx_v3/services/changelogs/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -58,7 +70,7 @@ class ChangelogsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[ChangelogsTransport]: """Returns an appropriate transport class. @@ -337,8 +349,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, ChangelogsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, ChangelogsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the changelogs client. @@ -352,7 +364,7 @@ def __init__( transport (Union[str, ChangelogsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -382,6 +394,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -434,11 +447,11 @@ def __init__( def list_changelogs( self, - request: Union[changelog.ListChangelogsRequest, dict] = None, + request: Optional[Union[changelog.ListChangelogsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListChangelogsPager: r"""Returns the list of Changelogs. @@ -549,11 +562,11 @@ def sample_list_changelogs(): def get_changelog( self, - request: Union[changelog.GetChangelogRequest, dict] = None, + request: Optional[Union[changelog.GetChangelogRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> changelog.Changelog: r"""Retrieves the specified Changelog. @@ -664,10 +677,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -718,10 +731,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -772,10 +785,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -826,10 +839,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -880,10 +893,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -933,14 +946,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ChangelogsClient",) diff --git a/google/cloud/dialogflowcx_v3/services/changelogs/transports/base.py b/google/cloud/dialogflowcx_v3/services/changelogs/transports/base.py index a786f3b8..e9620513 100644 --- a/google/cloud/dialogflowcx_v3/services/changelogs/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/changelogs/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -29,14 +30,9 @@ from google.cloud.location import locations_pb2 # type: ignore from google.longrunning import operations_pb2 -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ChangelogsTransport(abc.ABC): @@ -53,7 +49,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/changelogs/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/changelogs/transports/grpc.py index 0181b0f9..aa353657 100644 --- a/google/cloud/dialogflowcx_v3/services/changelogs/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/changelogs/transports/grpc.py @@ -50,14 +50,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -184,8 +184,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/changelogs/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/changelogs/transports/grpc_asyncio.py index a09f03c9..efb0c1d3 100644 --- a/google/cloud/dialogflowcx_v3/services/changelogs/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/changelogs/transports/grpc_asyncio.py @@ -52,7 +52,7 @@ class ChangelogsGrpcAsyncIOTransport(ChangelogsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -95,15 +95,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/deployments/async_client.py b/google/cloud/dialogflowcx_v3/services/deployments/async_client.py index 242a9ca0..e77fe45a 100644 --- a/google/cloud/dialogflowcx_v3/services/deployments/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/deployments/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -167,9 +178,9 @@ def transport(self) -> DeploymentsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, DeploymentsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the deployments client. @@ -213,11 +224,11 @@ def __init__( async def list_deployments( self, - request: Union[deployment.ListDeploymentsRequest, dict] = None, + request: Optional[Union[deployment.ListDeploymentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListDeploymentsAsyncPager: r"""Returns the list of all deployments in the specified @@ -251,7 +262,7 @@ async def sample_list_deployments(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListDeploymentsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListDeploymentsRequest, dict]]): The request object. The request message for [Deployments.ListDeployments][google.cloud.dialogflow.cx.v3.Deployments.ListDeployments]. parent (:class:`str`): @@ -331,11 +342,11 @@ async def sample_list_deployments(): async def get_deployment( self, - request: Union[deployment.GetDeploymentRequest, dict] = None, + request: Optional[Union[deployment.GetDeploymentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> deployment.Deployment: r"""Retrieves the specified @@ -368,7 +379,7 @@ async def sample_get_deployment(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetDeploymentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetDeploymentRequest, dict]]): The request object. The request message for [Deployments.GetDeployment][google.cloud.dialogflow.cx.v3.Deployments.GetDeployment]. name (:class:`str`): @@ -441,10 +452,10 @@ async def sample_get_deployment(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -495,10 +506,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -549,10 +560,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -603,10 +614,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -657,10 +668,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -716,14 +727,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DeploymentsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/deployments/client.py b/google/cloud/dialogflowcx_v3/services/deployments/client.py index 994b579a..802c0af5 100644 --- a/google/cloud/dialogflowcx_v3/services/deployments/client.py +++ b/google/cloud/dialogflowcx_v3/services/deployments/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -58,7 +70,7 @@ class DeploymentsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[DeploymentsTransport]: """Returns an appropriate transport class. @@ -417,8 +429,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, DeploymentsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, DeploymentsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the deployments client. @@ -432,7 +444,7 @@ def __init__( transport (Union[str, DeploymentsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -462,6 +474,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -514,11 +527,11 @@ def __init__( def list_deployments( self, - request: Union[deployment.ListDeploymentsRequest, dict] = None, + request: Optional[Union[deployment.ListDeploymentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListDeploymentsPager: r"""Returns the list of all deployments in the specified @@ -632,11 +645,11 @@ def sample_list_deployments(): def get_deployment( self, - request: Union[deployment.GetDeploymentRequest, dict] = None, + request: Optional[Union[deployment.GetDeploymentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> deployment.Deployment: r"""Retrieves the specified @@ -755,10 +768,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -809,10 +822,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -863,10 +876,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -917,10 +930,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -971,10 +984,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1024,14 +1037,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DeploymentsClient",) diff --git a/google/cloud/dialogflowcx_v3/services/deployments/transports/base.py b/google/cloud/dialogflowcx_v3/services/deployments/transports/base.py index 8ae65c4f..8033e453 100644 --- a/google/cloud/dialogflowcx_v3/services/deployments/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/deployments/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -29,14 +30,9 @@ from google.cloud.location import locations_pb2 # type: ignore from google.longrunning import operations_pb2 -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class DeploymentsTransport(abc.ABC): @@ -53,7 +49,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/deployments/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/deployments/transports/grpc.py index e461bab1..80dab94a 100644 --- a/google/cloud/dialogflowcx_v3/services/deployments/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/deployments/transports/grpc.py @@ -50,14 +50,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -184,8 +184,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/deployments/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/deployments/transports/grpc_asyncio.py index cdde3a4b..7c640870 100644 --- a/google/cloud/dialogflowcx_v3/services/deployments/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/deployments/transports/grpc_asyncio.py @@ -52,7 +52,7 @@ class DeploymentsGrpcAsyncIOTransport(DeploymentsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -95,15 +95,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/entity_types/async_client.py b/google/cloud/dialogflowcx_v3/services/entity_types/async_client.py index bf3f0e2e..d56383b1 100644 --- a/google/cloud/dialogflowcx_v3/services/entity_types/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/entity_types/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -160,9 +171,9 @@ def transport(self) -> EntityTypesTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, EntityTypesTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the entity types client. @@ -206,11 +217,11 @@ def __init__( async def list_entity_types( self, - request: Union[entity_type.ListEntityTypesRequest, dict] = None, + request: Optional[Union[entity_type.ListEntityTypesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEntityTypesAsyncPager: r"""Returns the list of all entity types in the specified @@ -244,7 +255,7 @@ async def sample_list_entity_types(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListEntityTypesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListEntityTypesRequest, dict]]): The request object. The request message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes]. parent (:class:`str`): @@ -323,11 +334,11 @@ async def sample_list_entity_types(): async def get_entity_type( self, - request: Union[entity_type.GetEntityTypeRequest, dict] = None, + request: Optional[Union[entity_type.GetEntityTypeRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> entity_type.EntityType: r"""Retrieves the specified entity type. @@ -359,7 +370,7 @@ async def sample_get_entity_type(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetEntityTypeRequest, dict]]): The request object. The request message for [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.GetEntityType]. name (:class:`str`): @@ -457,12 +468,12 @@ async def sample_get_entity_type(): async def create_entity_type( self, - request: Union[gcdc_entity_type.CreateEntityTypeRequest, dict] = None, + request: Optional[Union[gcdc_entity_type.CreateEntityTypeRequest, dict]] = None, *, - parent: str = None, - entity_type: gcdc_entity_type.EntityType = None, + parent: Optional[str] = None, + entity_type: Optional[gcdc_entity_type.EntityType] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_entity_type.EntityType: r"""Creates an entity type in the specified agent. @@ -503,7 +514,7 @@ async def sample_create_entity_type(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CreateEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CreateEntityTypeRequest, dict]]): The request object. The request message for [EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.CreateEntityType]. parent (:class:`str`): @@ -608,12 +619,12 @@ async def sample_create_entity_type(): async def update_entity_type( self, - request: Union[gcdc_entity_type.UpdateEntityTypeRequest, dict] = None, + request: Optional[Union[gcdc_entity_type.UpdateEntityTypeRequest, dict]] = None, *, - entity_type: gcdc_entity_type.EntityType = None, - update_mask: field_mask_pb2.FieldMask = None, + entity_type: Optional[gcdc_entity_type.EntityType] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_entity_type.EntityType: r"""Updates the specified entity type. @@ -653,7 +664,7 @@ async def sample_update_entity_type(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.UpdateEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.UpdateEntityTypeRequest, dict]]): The request object. The request message for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.UpdateEntityType]. entity_type (:class:`google.cloud.dialogflowcx_v3.types.EntityType`): @@ -760,11 +771,11 @@ async def sample_update_entity_type(): async def delete_entity_type( self, - request: Union[entity_type.DeleteEntityTypeRequest, dict] = None, + request: Optional[Union[entity_type.DeleteEntityTypeRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified entity type. @@ -797,7 +808,7 @@ async def sample_delete_entity_type(): await client.delete_entity_type(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3.types.DeleteEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.DeleteEntityTypeRequest, dict]]): The request object. The request message for [EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3.EntityTypes.DeleteEntityType]. name (:class:`str`): @@ -854,10 +865,10 @@ async def sample_delete_entity_type(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -908,10 +919,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -962,10 +973,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1016,10 +1027,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1070,10 +1081,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1129,14 +1140,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("EntityTypesAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/entity_types/client.py b/google/cloud/dialogflowcx_v3/services/entity_types/client.py index 634584c9..4d2598c5 100644 --- a/google/cloud/dialogflowcx_v3/services/entity_types/client.py +++ b/google/cloud/dialogflowcx_v3/services/entity_types/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -59,7 +71,7 @@ class EntityTypesClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[EntityTypesTransport]: """Returns an appropriate transport class. @@ -338,8 +350,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, EntityTypesTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, EntityTypesTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the entity types client. @@ -353,7 +365,7 @@ def __init__( transport (Union[str, EntityTypesTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -383,6 +395,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -435,11 +448,11 @@ def __init__( def list_entity_types( self, - request: Union[entity_type.ListEntityTypesRequest, dict] = None, + request: Optional[Union[entity_type.ListEntityTypesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEntityTypesPager: r"""Returns the list of all entity types in the specified @@ -552,11 +565,11 @@ def sample_list_entity_types(): def get_entity_type( self, - request: Union[entity_type.GetEntityTypeRequest, dict] = None, + request: Optional[Union[entity_type.GetEntityTypeRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> entity_type.EntityType: r"""Retrieves the specified entity type. @@ -686,12 +699,12 @@ def sample_get_entity_type(): def create_entity_type( self, - request: Union[gcdc_entity_type.CreateEntityTypeRequest, dict] = None, + request: Optional[Union[gcdc_entity_type.CreateEntityTypeRequest, dict]] = None, *, - parent: str = None, - entity_type: gcdc_entity_type.EntityType = None, + parent: Optional[str] = None, + entity_type: Optional[gcdc_entity_type.EntityType] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_entity_type.EntityType: r"""Creates an entity type in the specified agent. @@ -837,12 +850,12 @@ def sample_create_entity_type(): def update_entity_type( self, - request: Union[gcdc_entity_type.UpdateEntityTypeRequest, dict] = None, + request: Optional[Union[gcdc_entity_type.UpdateEntityTypeRequest, dict]] = None, *, - entity_type: gcdc_entity_type.EntityType = None, - update_mask: field_mask_pb2.FieldMask = None, + entity_type: Optional[gcdc_entity_type.EntityType] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_entity_type.EntityType: r"""Updates the specified entity type. @@ -989,11 +1002,11 @@ def sample_update_entity_type(): def delete_entity_type( self, - request: Union[entity_type.DeleteEntityTypeRequest, dict] = None, + request: Optional[Union[entity_type.DeleteEntityTypeRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified entity type. @@ -1096,10 +1109,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1150,10 +1163,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1204,10 +1217,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1258,10 +1271,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1312,10 +1325,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1365,14 +1378,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("EntityTypesClient",) diff --git a/google/cloud/dialogflowcx_v3/services/entity_types/transports/base.py b/google/cloud/dialogflowcx_v3/services/entity_types/transports/base.py index c4a30f63..c73ca736 100644 --- a/google/cloud/dialogflowcx_v3/services/entity_types/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/entity_types/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -31,14 +32,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class EntityTypesTransport(abc.ABC): @@ -55,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc.py index 4f81aecd..853e4f7e 100644 --- a/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc.py @@ -52,14 +52,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -186,8 +186,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc_asyncio.py index 68a810d7..500d665c 100644 --- a/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/entity_types/transports/grpc_asyncio.py @@ -54,7 +54,7 @@ class EntityTypesGrpcAsyncIOTransport(EntityTypesTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -97,15 +97,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/environments/async_client.py b/google/cloud/dialogflowcx_v3/services/environments/async_client.py index 6c5bf4f7..3abe94c8 100644 --- a/google/cloud/dialogflowcx_v3/services/environments/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/environments/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -182,9 +193,9 @@ def transport(self) -> EnvironmentsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, EnvironmentsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the environments client. @@ -228,11 +239,11 @@ def __init__( async def list_environments( self, - request: Union[environment.ListEnvironmentsRequest, dict] = None, + request: Optional[Union[environment.ListEnvironmentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEnvironmentsAsyncPager: r"""Returns the list of all environments in the specified @@ -266,7 +277,7 @@ async def sample_list_environments(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListEnvironmentsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListEnvironmentsRequest, dict]]): The request object. The request message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3.Environments.ListEnvironments]. parent (:class:`str`): @@ -346,11 +357,11 @@ async def sample_list_environments(): async def get_environment( self, - request: Union[environment.GetEnvironmentRequest, dict] = None, + request: Optional[Union[environment.GetEnvironmentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> environment.Environment: r"""Retrieves the specified @@ -383,7 +394,7 @@ async def sample_get_environment(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetEnvironmentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetEnvironmentRequest, dict]]): The request object. The request message for [Environments.GetEnvironment][google.cloud.dialogflow.cx.v3.Environments.GetEnvironment]. name (:class:`str`): @@ -464,12 +475,14 @@ async def sample_get_environment(): async def create_environment( self, - request: Union[gcdc_environment.CreateEnvironmentRequest, dict] = None, + request: Optional[ + Union[gcdc_environment.CreateEnvironmentRequest, dict] + ] = None, *, - parent: str = None, - environment: gcdc_environment.Environment = None, + parent: Optional[str] = None, + environment: Optional[gcdc_environment.Environment] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates an @@ -516,13 +529,13 @@ async def sample_create_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CreateEnvironmentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CreateEnvironmentRequest, dict]]): The request object. The request message for [Environments.CreateEnvironment][google.cloud.dialogflow.cx.v3.Environments.CreateEnvironment]. parent (:class:`str`): @@ -618,12 +631,14 @@ async def sample_create_environment(): async def update_environment( self, - request: Union[gcdc_environment.UpdateEnvironmentRequest, dict] = None, + request: Optional[ + Union[gcdc_environment.UpdateEnvironmentRequest, dict] + ] = None, *, - environment: gcdc_environment.Environment = None, - update_mask: field_mask_pb2.FieldMask = None, + environment: Optional[gcdc_environment.Environment] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates the specified @@ -668,13 +683,13 @@ async def sample_update_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.UpdateEnvironmentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.UpdateEnvironmentRequest, dict]]): The request object. The request message for [Environments.UpdateEnvironment][google.cloud.dialogflow.cx.v3.Environments.UpdateEnvironment]. environment (:class:`google.cloud.dialogflowcx_v3.types.Environment`): @@ -768,11 +783,11 @@ async def sample_update_environment(): async def delete_environment( self, - request: Union[environment.DeleteEnvironmentRequest, dict] = None, + request: Optional[Union[environment.DeleteEnvironmentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -802,7 +817,7 @@ async def sample_delete_environment(): await client.delete_environment(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3.types.DeleteEnvironmentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.DeleteEnvironmentRequest, dict]]): The request object. The request message for [Environments.DeleteEnvironment][google.cloud.dialogflow.cx.v3.Environments.DeleteEnvironment]. name (:class:`str`): @@ -861,11 +876,13 @@ async def sample_delete_environment(): async def lookup_environment_history( self, - request: Union[environment.LookupEnvironmentHistoryRequest, dict] = None, + request: Optional[ + Union[environment.LookupEnvironmentHistoryRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.LookupEnvironmentHistoryAsyncPager: r"""Looks up the history of the specified @@ -899,7 +916,7 @@ async def sample_lookup_environment_history(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.LookupEnvironmentHistoryRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.LookupEnvironmentHistoryRequest, dict]]): The request object. The request message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory]. name (:class:`str`): @@ -978,10 +995,10 @@ async def sample_lookup_environment_history(): async def run_continuous_test( self, - request: Union[environment.RunContinuousTestRequest, dict] = None, + request: Optional[Union[environment.RunContinuousTestRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Kicks off a continuous test under the specified @@ -1022,13 +1039,13 @@ async def sample_run_continuous_test(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.RunContinuousTestRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.RunContinuousTestRequest, dict]]): The request object. The request message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3.Environments.RunContinuousTest]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1087,11 +1104,13 @@ async def sample_run_continuous_test(): async def list_continuous_test_results( self, - request: Union[environment.ListContinuousTestResultsRequest, dict] = None, + request: Optional[ + Union[environment.ListContinuousTestResultsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListContinuousTestResultsAsyncPager: r"""Fetches a list of continuous test results for a given @@ -1125,7 +1144,7 @@ async def sample_list_continuous_test_results(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListContinuousTestResultsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListContinuousTestResultsRequest, dict]]): The request object. The request message for [Environments.ListContinuousTestResults][google.cloud.dialogflow.cx.v3.Environments.ListContinuousTestResults]. parent (:class:`str`): @@ -1203,10 +1222,10 @@ async def sample_list_continuous_test_results(): async def deploy_flow( self, - request: Union[environment.DeployFlowRequest, dict] = None, + request: Optional[Union[environment.DeployFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deploys a flow to the specified @@ -1248,13 +1267,13 @@ async def sample_deploy_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.DeployFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.DeployFlowRequest, dict]]): The request object. The request message for [Environments.DeployFlow][google.cloud.dialogflow.cx.v3.Environments.DeployFlow]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1313,10 +1332,10 @@ async def sample_deploy_flow(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1367,10 +1386,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1421,10 +1440,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1475,10 +1494,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1529,10 +1548,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1588,14 +1607,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("EnvironmentsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/environments/client.py b/google/cloud/dialogflowcx_v3/services/environments/client.py index bc8390dd..57b22dd9 100644 --- a/google/cloud/dialogflowcx_v3/services/environments/client.py +++ b/google/cloud/dialogflowcx_v3/services/environments/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -63,7 +75,7 @@ class EnvironmentsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[EnvironmentsTransport]: """Returns an appropriate transport class. @@ -492,8 +504,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, EnvironmentsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, EnvironmentsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the environments client. @@ -507,7 +519,7 @@ def __init__( transport (Union[str, EnvironmentsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -537,6 +549,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -589,11 +602,11 @@ def __init__( def list_environments( self, - request: Union[environment.ListEnvironmentsRequest, dict] = None, + request: Optional[Union[environment.ListEnvironmentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEnvironmentsPager: r"""Returns the list of all environments in the specified @@ -707,11 +720,11 @@ def sample_list_environments(): def get_environment( self, - request: Union[environment.GetEnvironmentRequest, dict] = None, + request: Optional[Union[environment.GetEnvironmentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> environment.Environment: r"""Retrieves the specified @@ -825,12 +838,14 @@ def sample_get_environment(): def create_environment( self, - request: Union[gcdc_environment.CreateEnvironmentRequest, dict] = None, + request: Optional[ + Union[gcdc_environment.CreateEnvironmentRequest, dict] + ] = None, *, - parent: str = None, - environment: gcdc_environment.Environment = None, + parent: Optional[str] = None, + environment: Optional[gcdc_environment.Environment] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates an @@ -979,12 +994,14 @@ def sample_create_environment(): def update_environment( self, - request: Union[gcdc_environment.UpdateEnvironmentRequest, dict] = None, + request: Optional[ + Union[gcdc_environment.UpdateEnvironmentRequest, dict] + ] = None, *, - environment: gcdc_environment.Environment = None, - update_mask: field_mask_pb2.FieldMask = None, + environment: Optional[gcdc_environment.Environment] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates the specified @@ -1129,11 +1146,11 @@ def sample_update_environment(): def delete_environment( self, - request: Union[environment.DeleteEnvironmentRequest, dict] = None, + request: Optional[Union[environment.DeleteEnvironmentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -1222,11 +1239,13 @@ def sample_delete_environment(): def lookup_environment_history( self, - request: Union[environment.LookupEnvironmentHistoryRequest, dict] = None, + request: Optional[ + Union[environment.LookupEnvironmentHistoryRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.LookupEnvironmentHistoryPager: r"""Looks up the history of the specified @@ -1341,10 +1360,10 @@ def sample_lookup_environment_history(): def run_continuous_test( self, - request: Union[environment.RunContinuousTestRequest, dict] = None, + request: Optional[Union[environment.RunContinuousTestRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Kicks off a continuous test under the specified @@ -1451,11 +1470,13 @@ def sample_run_continuous_test(): def list_continuous_test_results( self, - request: Union[environment.ListContinuousTestResultsRequest, dict] = None, + request: Optional[ + Union[environment.ListContinuousTestResultsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListContinuousTestResultsPager: r"""Fetches a list of continuous test results for a given @@ -1569,10 +1590,10 @@ def sample_list_continuous_test_results(): def deploy_flow( self, - request: Union[environment.DeployFlowRequest, dict] = None, + request: Optional[Union[environment.DeployFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deploys a flow to the specified @@ -1693,10 +1714,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1747,10 +1768,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1801,10 +1822,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1855,10 +1876,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1909,10 +1930,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1962,14 +1983,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("EnvironmentsClient",) diff --git a/google/cloud/dialogflowcx_v3/services/environments/transports/base.py b/google/cloud/dialogflowcx_v3/services/environments/transports/base.py index bce3d8c3..fe39c8d7 100644 --- a/google/cloud/dialogflowcx_v3/services/environments/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/environments/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class EnvironmentsTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/environments/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/environments/transports/grpc.py index 8c130aa5..83d6629f 100644 --- a/google/cloud/dialogflowcx_v3/services/environments/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/environments/transports/grpc.py @@ -54,14 +54,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -189,8 +189,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/environments/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/environments/transports/grpc_asyncio.py index 9fb5cfd1..6389e8b1 100644 --- a/google/cloud/dialogflowcx_v3/services/environments/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/environments/transports/grpc_asyncio.py @@ -56,7 +56,7 @@ class EnvironmentsGrpcAsyncIOTransport(EnvironmentsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -99,15 +99,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/experiments/async_client.py b/google/cloud/dialogflowcx_v3/services/experiments/async_client.py index 0d94313f..9a499db0 100644 --- a/google/cloud/dialogflowcx_v3/services/experiments/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/experiments/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -164,9 +175,9 @@ def transport(self) -> ExperimentsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, ExperimentsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the experiments client. @@ -210,11 +221,11 @@ def __init__( async def list_experiments( self, - request: Union[experiment.ListExperimentsRequest, dict] = None, + request: Optional[Union[experiment.ListExperimentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListExperimentsAsyncPager: r"""Returns the list of all experiments in the specified @@ -248,7 +259,7 @@ async def sample_list_experiments(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListExperimentsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListExperimentsRequest, dict]]): The request object. The request message for [Experiments.ListExperiments][google.cloud.dialogflow.cx.v3.Experiments.ListExperiments]. parent (:class:`str`): @@ -328,11 +339,11 @@ async def sample_list_experiments(): async def get_experiment( self, - request: Union[experiment.GetExperimentRequest, dict] = None, + request: Optional[Union[experiment.GetExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> experiment.Experiment: r"""Retrieves the specified @@ -365,7 +376,7 @@ async def sample_get_experiment(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetExperimentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetExperimentRequest, dict]]): The request object. The request message for [Experiments.GetExperiment][google.cloud.dialogflow.cx.v3.Experiments.GetExperiment]. name (:class:`str`): @@ -433,12 +444,12 @@ async def sample_get_experiment(): async def create_experiment( self, - request: Union[gcdc_experiment.CreateExperimentRequest, dict] = None, + request: Optional[Union[gcdc_experiment.CreateExperimentRequest, dict]] = None, *, - parent: str = None, - experiment: gcdc_experiment.Experiment = None, + parent: Optional[str] = None, + experiment: Optional[gcdc_experiment.Experiment] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_experiment.Experiment: r"""Creates an @@ -477,7 +488,7 @@ async def sample_create_experiment(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CreateExperimentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CreateExperimentRequest, dict]]): The request object. The request message for [Experiments.CreateExperiment][google.cloud.dialogflow.cx.v3.Experiments.CreateExperiment]. parent (:class:`str`): @@ -554,12 +565,12 @@ async def sample_create_experiment(): async def update_experiment( self, - request: Union[gcdc_experiment.UpdateExperimentRequest, dict] = None, + request: Optional[Union[gcdc_experiment.UpdateExperimentRequest, dict]] = None, *, - experiment: gcdc_experiment.Experiment = None, - update_mask: field_mask_pb2.FieldMask = None, + experiment: Optional[gcdc_experiment.Experiment] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_experiment.Experiment: r"""Updates the specified @@ -595,7 +606,7 @@ async def sample_update_experiment(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.UpdateExperimentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.UpdateExperimentRequest, dict]]): The request object. The request message for [Experiments.UpdateExperiment][google.cloud.dialogflow.cx.v3.Experiments.UpdateExperiment]. experiment (:class:`google.cloud.dialogflowcx_v3.types.Experiment`): @@ -670,11 +681,11 @@ async def sample_update_experiment(): async def delete_experiment( self, - request: Union[experiment.DeleteExperimentRequest, dict] = None, + request: Optional[Union[experiment.DeleteExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -704,7 +715,7 @@ async def sample_delete_experiment(): await client.delete_experiment(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3.types.DeleteExperimentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.DeleteExperimentRequest, dict]]): The request object. The request message for [Experiments.DeleteExperiment][google.cloud.dialogflow.cx.v3.Experiments.DeleteExperiment]. name (:class:`str`): @@ -763,11 +774,11 @@ async def sample_delete_experiment(): async def start_experiment( self, - request: Union[experiment.StartExperimentRequest, dict] = None, + request: Optional[Union[experiment.StartExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> experiment.Experiment: r"""Starts the specified @@ -801,7 +812,7 @@ async def sample_start_experiment(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.StartExperimentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.StartExperimentRequest, dict]]): The request object. The request message for [Experiments.StartExperiment][google.cloud.dialogflow.cx.v3.Experiments.StartExperiment]. name (:class:`str`): @@ -868,11 +879,11 @@ async def sample_start_experiment(): async def stop_experiment( self, - request: Union[experiment.StopExperimentRequest, dict] = None, + request: Optional[Union[experiment.StopExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> experiment.Experiment: r"""Stops the specified @@ -906,7 +917,7 @@ async def sample_stop_experiment(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.StopExperimentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.StopExperimentRequest, dict]]): The request object. The request message for [Experiments.StopExperiment][google.cloud.dialogflow.cx.v3.Experiments.StopExperiment]. name (:class:`str`): @@ -973,10 +984,10 @@ async def sample_stop_experiment(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1027,10 +1038,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1081,10 +1092,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1135,10 +1146,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1189,10 +1200,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1248,14 +1259,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ExperimentsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/experiments/client.py b/google/cloud/dialogflowcx_v3/services/experiments/client.py index b6902f55..1758f894 100644 --- a/google/cloud/dialogflowcx_v3/services/experiments/client.py +++ b/google/cloud/dialogflowcx_v3/services/experiments/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -61,7 +73,7 @@ class ExperimentsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[ExperimentsTransport]: """Returns an appropriate transport class. @@ -368,8 +380,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, ExperimentsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, ExperimentsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the experiments client. @@ -383,7 +395,7 @@ def __init__( transport (Union[str, ExperimentsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -413,6 +425,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -465,11 +478,11 @@ def __init__( def list_experiments( self, - request: Union[experiment.ListExperimentsRequest, dict] = None, + request: Optional[Union[experiment.ListExperimentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListExperimentsPager: r"""Returns the list of all experiments in the specified @@ -583,11 +596,11 @@ def sample_list_experiments(): def get_experiment( self, - request: Union[experiment.GetExperimentRequest, dict] = None, + request: Optional[Union[experiment.GetExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> experiment.Experiment: r"""Retrieves the specified @@ -688,12 +701,12 @@ def sample_get_experiment(): def create_experiment( self, - request: Union[gcdc_experiment.CreateExperimentRequest, dict] = None, + request: Optional[Union[gcdc_experiment.CreateExperimentRequest, dict]] = None, *, - parent: str = None, - experiment: gcdc_experiment.Experiment = None, + parent: Optional[str] = None, + experiment: Optional[gcdc_experiment.Experiment] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_experiment.Experiment: r"""Creates an @@ -809,12 +822,12 @@ def sample_create_experiment(): def update_experiment( self, - request: Union[gcdc_experiment.UpdateExperimentRequest, dict] = None, + request: Optional[Union[gcdc_experiment.UpdateExperimentRequest, dict]] = None, *, - experiment: gcdc_experiment.Experiment = None, - update_mask: field_mask_pb2.FieldMask = None, + experiment: Optional[gcdc_experiment.Experiment] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_experiment.Experiment: r"""Updates the specified @@ -925,11 +938,11 @@ def sample_update_experiment(): def delete_experiment( self, - request: Union[experiment.DeleteExperimentRequest, dict] = None, + request: Optional[Union[experiment.DeleteExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -1018,11 +1031,11 @@ def sample_delete_experiment(): def start_experiment( self, - request: Union[experiment.StartExperimentRequest, dict] = None, + request: Optional[Union[experiment.StartExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> experiment.Experiment: r"""Starts the specified @@ -1123,11 +1136,11 @@ def sample_start_experiment(): def stop_experiment( self, - request: Union[experiment.StopExperimentRequest, dict] = None, + request: Optional[Union[experiment.StopExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> experiment.Experiment: r"""Stops the specified @@ -1241,10 +1254,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1295,10 +1308,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1349,10 +1362,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1403,10 +1416,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1457,10 +1470,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1510,14 +1523,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ExperimentsClient",) diff --git a/google/cloud/dialogflowcx_v3/services/experiments/transports/base.py b/google/cloud/dialogflowcx_v3/services/experiments/transports/base.py index b15ccfa9..b84b4cd3 100644 --- a/google/cloud/dialogflowcx_v3/services/experiments/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/experiments/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -31,14 +32,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ExperimentsTransport(abc.ABC): @@ -55,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc.py index b9dbd252..d10987b1 100644 --- a/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc.py @@ -52,14 +52,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -186,8 +186,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc_asyncio.py index c332aa3f..2631d45f 100644 --- a/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/experiments/transports/grpc_asyncio.py @@ -54,7 +54,7 @@ class ExperimentsGrpcAsyncIOTransport(ExperimentsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -97,15 +97,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/flows/async_client.py b/google/cloud/dialogflowcx_v3/services/flows/async_client.py index a0eec27b..04cda57d 100644 --- a/google/cloud/dialogflowcx_v3/services/flows/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/flows/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -173,9 +184,9 @@ def transport(self) -> FlowsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, FlowsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the flows client. @@ -219,12 +230,12 @@ def __init__( async def create_flow( self, - request: Union[gcdc_flow.CreateFlowRequest, dict] = None, + request: Optional[Union[gcdc_flow.CreateFlowRequest, dict]] = None, *, - parent: str = None, - flow: gcdc_flow.Flow = None, + parent: Optional[str] = None, + flow: Optional[gcdc_flow.Flow] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_flow.Flow: r"""Creates a flow in the specified agent. @@ -264,7 +275,7 @@ async def sample_create_flow(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CreateFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CreateFlowRequest, dict]]): The request object. The request message for [Flows.CreateFlow][google.cloud.dialogflow.cx.v3.Flows.CreateFlow]. parent (:class:`str`): @@ -358,11 +369,11 @@ async def sample_create_flow(): async def delete_flow( self, - request: Union[flow.DeleteFlowRequest, dict] = None, + request: Optional[Union[flow.DeleteFlowRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a specified flow. @@ -391,7 +402,7 @@ async def sample_delete_flow(): await client.delete_flow(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3.types.DeleteFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.DeleteFlowRequest, dict]]): The request object. The request message for [Flows.DeleteFlow][google.cloud.dialogflow.cx.v3.Flows.DeleteFlow]. name (:class:`str`): @@ -448,11 +459,11 @@ async def sample_delete_flow(): async def list_flows( self, - request: Union[flow.ListFlowsRequest, dict] = None, + request: Optional[Union[flow.ListFlowsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFlowsAsyncPager: r"""Returns the list of all flows in the specified agent. @@ -485,7 +496,7 @@ async def sample_list_flows(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListFlowsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListFlowsRequest, dict]]): The request object. The request message for [Flows.ListFlows][google.cloud.dialogflow.cx.v3.Flows.ListFlows]. parent (:class:`str`): @@ -563,11 +574,11 @@ async def sample_list_flows(): async def get_flow( self, - request: Union[flow.GetFlowRequest, dict] = None, + request: Optional[Union[flow.GetFlowRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> flow.Flow: r"""Retrieves the specified flow. @@ -599,7 +610,7 @@ async def sample_get_flow(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetFlowRequest, dict]]): The request object. The response message for [Flows.GetFlow][google.cloud.dialogflow.cx.v3.Flows.GetFlow]. name (:class:`str`): @@ -686,12 +697,12 @@ async def sample_get_flow(): async def update_flow( self, - request: Union[gcdc_flow.UpdateFlowRequest, dict] = None, + request: Optional[Union[gcdc_flow.UpdateFlowRequest, dict]] = None, *, - flow: gcdc_flow.Flow = None, - update_mask: field_mask_pb2.FieldMask = None, + flow: Optional[gcdc_flow.Flow] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_flow.Flow: r"""Updates the specified flow. @@ -730,7 +741,7 @@ async def sample_update_flow(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.UpdateFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.UpdateFlowRequest, dict]]): The request object. The request message for [Flows.UpdateFlow][google.cloud.dialogflow.cx.v3.Flows.UpdateFlow]. flow (:class:`google.cloud.dialogflowcx_v3.types.Flow`): @@ -827,11 +838,11 @@ async def sample_update_flow(): async def train_flow( self, - request: Union[flow.TrainFlowRequest, dict] = None, + request: Optional[Union[flow.TrainFlowRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Trains the specified flow. Note that only the flow in 'draft' @@ -876,13 +887,13 @@ async def sample_train_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.TrainFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.TrainFlowRequest, dict]]): The request object. The request message for [Flows.TrainFlow][google.cloud.dialogflow.cx.v3.Flows.TrainFlow]. name (:class:`str`): @@ -966,10 +977,10 @@ async def sample_train_flow(): async def validate_flow( self, - request: Union[flow.ValidateFlowRequest, dict] = None, + request: Optional[Union[flow.ValidateFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> flow.FlowValidationResult: r"""Validates the specified flow and creates or updates @@ -1004,7 +1015,7 @@ async def sample_validate_flow(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ValidateFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ValidateFlowRequest, dict]]): The request object. The request message for [Flows.ValidateFlow][google.cloud.dialogflow.cx.v3.Flows.ValidateFlow]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1049,11 +1060,11 @@ async def sample_validate_flow(): async def get_flow_validation_result( self, - request: Union[flow.GetFlowValidationResultRequest, dict] = None, + request: Optional[Union[flow.GetFlowValidationResultRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> flow.FlowValidationResult: r"""Gets the latest flow validation result. Flow @@ -1086,7 +1097,7 @@ async def sample_get_flow_validation_result(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetFlowValidationResultRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetFlowValidationResultRequest, dict]]): The request object. The request message for [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3.Flows.GetFlowValidationResult]. name (:class:`str`): @@ -1152,10 +1163,10 @@ async def sample_get_flow_validation_result(): async def import_flow( self, - request: Union[flow.ImportFlowRequest, dict] = None, + request: Optional[Union[flow.ImportFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Imports the specified flow to the specified agent from a binary @@ -1201,13 +1212,13 @@ async def sample_import_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ImportFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ImportFlowRequest, dict]]): The request object. The request message for [Flows.ImportFlow][google.cloud.dialogflow.cx.v3.Flows.ImportFlow]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1264,10 +1275,10 @@ async def sample_import_flow(): async def export_flow( self, - request: Union[flow.ExportFlowRequest, dict] = None, + request: Optional[Union[flow.ExportFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Exports the specified flow to a binary file. @@ -1310,13 +1321,13 @@ async def sample_export_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ExportFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ExportFlowRequest, dict]]): The request object. The request message for [Flows.ExportFlow][google.cloud.dialogflow.cx.v3.Flows.ExportFlow]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1373,10 +1384,10 @@ async def sample_export_flow(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1427,10 +1438,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1481,10 +1492,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1535,10 +1546,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1589,10 +1600,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1648,14 +1659,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("FlowsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/flows/client.py b/google/cloud/dialogflowcx_v3/services/flows/client.py index de4e5583..370820d8 100644 --- a/google/cloud/dialogflowcx_v3/services/flows/client.py +++ b/google/cloud/dialogflowcx_v3/services/flows/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -66,7 +78,7 @@ class FlowsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[FlowsTransport]: """Returns an appropriate transport class. @@ -467,8 +479,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, FlowsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, FlowsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the flows client. @@ -482,7 +494,7 @@ def __init__( transport (Union[str, FlowsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -512,6 +524,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -564,12 +577,12 @@ def __init__( def create_flow( self, - request: Union[gcdc_flow.CreateFlowRequest, dict] = None, + request: Optional[Union[gcdc_flow.CreateFlowRequest, dict]] = None, *, - parent: str = None, - flow: gcdc_flow.Flow = None, + parent: Optional[str] = None, + flow: Optional[gcdc_flow.Flow] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_flow.Flow: r"""Creates a flow in the specified agent. @@ -703,11 +716,11 @@ def sample_create_flow(): def delete_flow( self, - request: Union[flow.DeleteFlowRequest, dict] = None, + request: Optional[Union[flow.DeleteFlowRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a specified flow. @@ -793,11 +806,11 @@ def sample_delete_flow(): def list_flows( self, - request: Union[flow.ListFlowsRequest, dict] = None, + request: Optional[Union[flow.ListFlowsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFlowsPager: r"""Returns the list of all flows in the specified agent. @@ -908,11 +921,11 @@ def sample_list_flows(): def get_flow( self, - request: Union[flow.GetFlowRequest, dict] = None, + request: Optional[Union[flow.GetFlowRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> flow.Flow: r"""Retrieves the specified flow. @@ -1031,12 +1044,12 @@ def sample_get_flow(): def update_flow( self, - request: Union[gcdc_flow.UpdateFlowRequest, dict] = None, + request: Optional[Union[gcdc_flow.UpdateFlowRequest, dict]] = None, *, - flow: gcdc_flow.Flow = None, - update_mask: field_mask_pb2.FieldMask = None, + flow: Optional[gcdc_flow.Flow] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_flow.Flow: r"""Updates the specified flow. @@ -1172,11 +1185,11 @@ def sample_update_flow(): def train_flow( self, - request: Union[flow.TrainFlowRequest, dict] = None, + request: Optional[Union[flow.TrainFlowRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Trains the specified flow. Note that only the flow in 'draft' @@ -1311,10 +1324,10 @@ def sample_train_flow(): def validate_flow( self, - request: Union[flow.ValidateFlowRequest, dict] = None, + request: Optional[Union[flow.ValidateFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> flow.FlowValidationResult: r"""Validates the specified flow and creates or updates @@ -1395,11 +1408,11 @@ def sample_validate_flow(): def get_flow_validation_result( self, - request: Union[flow.GetFlowValidationResultRequest, dict] = None, + request: Optional[Union[flow.GetFlowValidationResultRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> flow.FlowValidationResult: r"""Gets the latest flow validation result. Flow @@ -1500,10 +1513,10 @@ def sample_get_flow_validation_result(): def import_flow( self, - request: Union[flow.ImportFlowRequest, dict] = None, + request: Optional[Union[flow.ImportFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Imports the specified flow to the specified agent from a binary @@ -1613,10 +1626,10 @@ def sample_import_flow(): def export_flow( self, - request: Union[flow.ExportFlowRequest, dict] = None, + request: Optional[Union[flow.ExportFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Exports the specified flow to a binary file. @@ -1736,10 +1749,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1790,10 +1803,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1844,10 +1857,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1898,10 +1911,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1952,10 +1965,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -2005,14 +2018,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("FlowsClient",) diff --git a/google/cloud/dialogflowcx_v3/services/flows/transports/base.py b/google/cloud/dialogflowcx_v3/services/flows/transports/base.py index 9afc36fe..7fb30734 100644 --- a/google/cloud/dialogflowcx_v3/services/flows/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/flows/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class FlowsTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/flows/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/flows/transports/grpc.py index 935e72cf..3d782e09 100644 --- a/google/cloud/dialogflowcx_v3/services/flows/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/flows/transports/grpc.py @@ -53,14 +53,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -188,8 +188,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/flows/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/flows/transports/grpc_asyncio.py index f88807a7..b0638a93 100644 --- a/google/cloud/dialogflowcx_v3/services/flows/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/flows/transports/grpc_asyncio.py @@ -55,7 +55,7 @@ class FlowsGrpcAsyncIOTransport(FlowsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -98,15 +98,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/intents/async_client.py b/google/cloud/dialogflowcx_v3/services/intents/async_client.py index 2f883b0f..8b933bc1 100644 --- a/google/cloud/dialogflowcx_v3/services/intents/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/intents/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -158,9 +169,9 @@ def transport(self) -> IntentsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, IntentsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the intents client. @@ -204,11 +215,11 @@ def __init__( async def list_intents( self, - request: Union[intent.ListIntentsRequest, dict] = None, + request: Optional[Union[intent.ListIntentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListIntentsAsyncPager: r"""Returns the list of all intents in the specified @@ -242,7 +253,7 @@ async def sample_list_intents(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListIntentsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListIntentsRequest, dict]]): The request object. The request message for [Intents.ListIntents][google.cloud.dialogflow.cx.v3.Intents.ListIntents]. parent (:class:`str`): @@ -320,11 +331,11 @@ async def sample_list_intents(): async def get_intent( self, - request: Union[intent.GetIntentRequest, dict] = None, + request: Optional[Union[intent.GetIntentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> intent.Intent: r"""Retrieves the specified intent. @@ -356,7 +367,7 @@ async def sample_get_intent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetIntentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetIntentRequest, dict]]): The request object. The request message for [Intents.GetIntent][google.cloud.dialogflow.cx.v3.Intents.GetIntent]. name (:class:`str`): @@ -427,12 +438,12 @@ async def sample_get_intent(): async def create_intent( self, - request: Union[gcdc_intent.CreateIntentRequest, dict] = None, + request: Optional[Union[gcdc_intent.CreateIntentRequest, dict]] = None, *, - parent: str = None, - intent: gcdc_intent.Intent = None, + parent: Optional[str] = None, + intent: Optional[gcdc_intent.Intent] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_intent.Intent: r"""Creates an intent in the specified agent. @@ -472,7 +483,7 @@ async def sample_create_intent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CreateIntentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CreateIntentRequest, dict]]): The request object. The request message for [Intents.CreateIntent][google.cloud.dialogflow.cx.v3.Intents.CreateIntent]. parent (:class:`str`): @@ -550,12 +561,12 @@ async def sample_create_intent(): async def update_intent( self, - request: Union[gcdc_intent.UpdateIntentRequest, dict] = None, + request: Optional[Union[gcdc_intent.UpdateIntentRequest, dict]] = None, *, - intent: gcdc_intent.Intent = None, - update_mask: field_mask_pb2.FieldMask = None, + intent: Optional[gcdc_intent.Intent] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_intent.Intent: r"""Updates the specified intent. @@ -594,7 +605,7 @@ async def sample_update_intent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.UpdateIntentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.UpdateIntentRequest, dict]]): The request object. The request message for [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3.Intents.UpdateIntent]. intent (:class:`google.cloud.dialogflowcx_v3.types.Intent`): @@ -675,11 +686,11 @@ async def sample_update_intent(): async def delete_intent( self, - request: Union[intent.DeleteIntentRequest, dict] = None, + request: Optional[Union[intent.DeleteIntentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified intent. @@ -712,7 +723,7 @@ async def sample_delete_intent(): await client.delete_intent(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3.types.DeleteIntentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.DeleteIntentRequest, dict]]): The request object. The request message for [Intents.DeleteIntent][google.cloud.dialogflow.cx.v3.Intents.DeleteIntent]. name (:class:`str`): @@ -769,10 +780,10 @@ async def sample_delete_intent(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -823,10 +834,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -877,10 +888,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -931,10 +942,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -985,10 +996,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1044,14 +1055,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("IntentsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/intents/client.py b/google/cloud/dialogflowcx_v3/services/intents/client.py index 56c57048..6deb845e 100644 --- a/google/cloud/dialogflowcx_v3/services/intents/client.py +++ b/google/cloud/dialogflowcx_v3/services/intents/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -59,7 +71,7 @@ class IntentsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[IntentsTransport]: """Returns an appropriate transport class. @@ -362,8 +374,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, IntentsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, IntentsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the intents client. @@ -377,7 +389,7 @@ def __init__( transport (Union[str, IntentsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -407,6 +419,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -459,11 +472,11 @@ def __init__( def list_intents( self, - request: Union[intent.ListIntentsRequest, dict] = None, + request: Optional[Union[intent.ListIntentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListIntentsPager: r"""Returns the list of all intents in the specified @@ -575,11 +588,11 @@ def sample_list_intents(): def get_intent( self, - request: Union[intent.GetIntentRequest, dict] = None, + request: Optional[Union[intent.GetIntentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> intent.Intent: r"""Retrieves the specified intent. @@ -682,12 +695,12 @@ def sample_get_intent(): def create_intent( self, - request: Union[gcdc_intent.CreateIntentRequest, dict] = None, + request: Optional[Union[gcdc_intent.CreateIntentRequest, dict]] = None, *, - parent: str = None, - intent: gcdc_intent.Intent = None, + parent: Optional[str] = None, + intent: Optional[gcdc_intent.Intent] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_intent.Intent: r"""Creates an intent in the specified agent. @@ -805,12 +818,12 @@ def sample_create_intent(): def update_intent( self, - request: Union[gcdc_intent.UpdateIntentRequest, dict] = None, + request: Optional[Union[gcdc_intent.UpdateIntentRequest, dict]] = None, *, - intent: gcdc_intent.Intent = None, - update_mask: field_mask_pb2.FieldMask = None, + intent: Optional[gcdc_intent.Intent] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_intent.Intent: r"""Updates the specified intent. @@ -930,11 +943,11 @@ def sample_update_intent(): def delete_intent( self, - request: Union[intent.DeleteIntentRequest, dict] = None, + request: Optional[Union[intent.DeleteIntentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified intent. @@ -1037,10 +1050,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1091,10 +1104,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1145,10 +1158,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1199,10 +1212,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1253,10 +1266,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1306,14 +1319,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("IntentsClient",) diff --git a/google/cloud/dialogflowcx_v3/services/intents/transports/base.py b/google/cloud/dialogflowcx_v3/services/intents/transports/base.py index 8233f415..b91c6b3a 100644 --- a/google/cloud/dialogflowcx_v3/services/intents/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/intents/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -31,14 +32,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class IntentsTransport(abc.ABC): @@ -55,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/intents/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/intents/transports/grpc.py index fb755747..67339919 100644 --- a/google/cloud/dialogflowcx_v3/services/intents/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/intents/transports/grpc.py @@ -52,14 +52,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -186,8 +186,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/intents/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/intents/transports/grpc_asyncio.py index 5ca57608..99e0914d 100644 --- a/google/cloud/dialogflowcx_v3/services/intents/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/intents/transports/grpc_asyncio.py @@ -54,7 +54,7 @@ class IntentsGrpcAsyncIOTransport(IntentsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -97,15 +97,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/pages/async_client.py b/google/cloud/dialogflowcx_v3/services/pages/async_client.py index 940fc50a..022cefa9 100644 --- a/google/cloud/dialogflowcx_v3/services/pages/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/pages/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -165,9 +176,9 @@ def transport(self) -> PagesTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, PagesTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the pages client. @@ -211,11 +222,11 @@ def __init__( async def list_pages( self, - request: Union[page.ListPagesRequest, dict] = None, + request: Optional[Union[page.ListPagesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPagesAsyncPager: r"""Returns the list of all pages in the specified flow. @@ -248,7 +259,7 @@ async def sample_list_pages(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListPagesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListPagesRequest, dict]]): The request object. The request message for [Pages.ListPages][google.cloud.dialogflow.cx.v3.Pages.ListPages]. parent (:class:`str`): @@ -326,11 +337,11 @@ async def sample_list_pages(): async def get_page( self, - request: Union[page.GetPageRequest, dict] = None, + request: Optional[Union[page.GetPageRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> page.Page: r"""Retrieves the specified page. @@ -362,7 +373,7 @@ async def sample_get_page(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetPageRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetPageRequest, dict]]): The request object. The request message for [Pages.GetPage][google.cloud.dialogflow.cx.v3.Pages.GetPage]. name (:class:`str`): @@ -448,12 +459,12 @@ async def sample_get_page(): async def create_page( self, - request: Union[gcdc_page.CreatePageRequest, dict] = None, + request: Optional[Union[gcdc_page.CreatePageRequest, dict]] = None, *, - parent: str = None, - page: gcdc_page.Page = None, + parent: Optional[str] = None, + page: Optional[gcdc_page.Page] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_page.Page: r"""Creates a page in the specified flow. @@ -493,7 +504,7 @@ async def sample_create_page(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CreatePageRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CreatePageRequest, dict]]): The request object. The request message for [Pages.CreatePage][google.cloud.dialogflow.cx.v3.Pages.CreatePage]. parent (:class:`str`): @@ -586,12 +597,12 @@ async def sample_create_page(): async def update_page( self, - request: Union[gcdc_page.UpdatePageRequest, dict] = None, + request: Optional[Union[gcdc_page.UpdatePageRequest, dict]] = None, *, - page: gcdc_page.Page = None, - update_mask: field_mask_pb2.FieldMask = None, + page: Optional[gcdc_page.Page] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_page.Page: r"""Updates the specified page. @@ -630,7 +641,7 @@ async def sample_update_page(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.UpdatePageRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.UpdatePageRequest, dict]]): The request object. The request message for [Pages.UpdatePage][google.cloud.dialogflow.cx.v3.Pages.UpdatePage]. page (:class:`google.cloud.dialogflowcx_v3.types.Page`): @@ -726,11 +737,11 @@ async def sample_update_page(): async def delete_page( self, - request: Union[page.DeletePageRequest, dict] = None, + request: Optional[Union[page.DeletePageRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified page. @@ -763,7 +774,7 @@ async def sample_delete_page(): await client.delete_page(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3.types.DeletePageRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.DeletePageRequest, dict]]): The request object. The request message for [Pages.DeletePage][google.cloud.dialogflow.cx.v3.Pages.DeletePage]. name (:class:`str`): @@ -820,10 +831,10 @@ async def sample_delete_page(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -874,10 +885,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -928,10 +939,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -982,10 +993,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1036,10 +1047,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1095,14 +1106,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("PagesAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/pages/client.py b/google/cloud/dialogflowcx_v3/services/pages/client.py index cd37596f..c196f075 100644 --- a/google/cloud/dialogflowcx_v3/services/pages/client.py +++ b/google/cloud/dialogflowcx_v3/services/pages/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -60,7 +72,7 @@ class PagesClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[PagesTransport]: """Returns an appropriate transport class. @@ -461,8 +473,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, PagesTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, PagesTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the pages client. @@ -476,7 +488,7 @@ def __init__( transport (Union[str, PagesTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -506,6 +518,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -558,11 +571,11 @@ def __init__( def list_pages( self, - request: Union[page.ListPagesRequest, dict] = None, + request: Optional[Union[page.ListPagesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPagesPager: r"""Returns the list of all pages in the specified flow. @@ -673,11 +686,11 @@ def sample_list_pages(): def get_page( self, - request: Union[page.GetPageRequest, dict] = None, + request: Optional[Union[page.GetPageRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> page.Page: r"""Retrieves the specified page. @@ -795,12 +808,12 @@ def sample_get_page(): def create_page( self, - request: Union[gcdc_page.CreatePageRequest, dict] = None, + request: Optional[Union[gcdc_page.CreatePageRequest, dict]] = None, *, - parent: str = None, - page: gcdc_page.Page = None, + parent: Optional[str] = None, + page: Optional[gcdc_page.Page] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_page.Page: r"""Creates a page in the specified flow. @@ -933,12 +946,12 @@ def sample_create_page(): def update_page( self, - request: Union[gcdc_page.UpdatePageRequest, dict] = None, + request: Optional[Union[gcdc_page.UpdatePageRequest, dict]] = None, *, - page: gcdc_page.Page = None, - update_mask: field_mask_pb2.FieldMask = None, + page: Optional[gcdc_page.Page] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_page.Page: r"""Updates the specified page. @@ -1073,11 +1086,11 @@ def sample_update_page(): def delete_page( self, - request: Union[page.DeletePageRequest, dict] = None, + request: Optional[Union[page.DeletePageRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified page. @@ -1180,10 +1193,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1234,10 +1247,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1288,10 +1301,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1342,10 +1355,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1396,10 +1409,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1449,14 +1462,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("PagesClient",) diff --git a/google/cloud/dialogflowcx_v3/services/pages/transports/base.py b/google/cloud/dialogflowcx_v3/services/pages/transports/base.py index 0ddd2c83..9f02d322 100644 --- a/google/cloud/dialogflowcx_v3/services/pages/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/pages/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -31,14 +32,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class PagesTransport(abc.ABC): @@ -55,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/pages/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/pages/transports/grpc.py index 4c0cb3ac..6c6ff7cf 100644 --- a/google/cloud/dialogflowcx_v3/services/pages/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/pages/transports/grpc.py @@ -51,14 +51,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -185,8 +185,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/pages/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/pages/transports/grpc_asyncio.py index ca60e728..6c398b82 100644 --- a/google/cloud/dialogflowcx_v3/services/pages/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/pages/transports/grpc_asyncio.py @@ -53,7 +53,7 @@ class PagesGrpcAsyncIOTransport(PagesTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -96,15 +96,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/security_settings_service/async_client.py b/google/cloud/dialogflowcx_v3/services/security_settings_service/async_client.py index ae58419b..801b5587 100644 --- a/google/cloud/dialogflowcx_v3/services/security_settings_service/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/security_settings_service/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -185,9 +196,9 @@ def transport(self) -> SecuritySettingsServiceTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, SecuritySettingsServiceTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the security settings service client. @@ -231,14 +242,14 @@ def __init__( async def create_security_settings( self, - request: Union[ - gcdc_security_settings.CreateSecuritySettingsRequest, dict + request: Optional[ + Union[gcdc_security_settings.CreateSecuritySettingsRequest, dict] ] = None, *, - parent: str = None, - security_settings: gcdc_security_settings.SecuritySettings = None, + parent: Optional[str] = None, + security_settings: Optional[gcdc_security_settings.SecuritySettings] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_security_settings.SecuritySettings: r"""Create security settings in the specified location. @@ -275,7 +286,7 @@ async def sample_create_security_settings(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CreateSecuritySettingsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CreateSecuritySettingsRequest, dict]]): The request object. The request message for [SecuritySettings.CreateSecuritySettings][]. parent (:class:`str`): @@ -356,11 +367,13 @@ async def sample_create_security_settings(): async def get_security_settings( self, - request: Union[security_settings.GetSecuritySettingsRequest, dict] = None, + request: Optional[ + Union[security_settings.GetSecuritySettingsRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> security_settings.SecuritySettings: r"""Retrieves the specified @@ -394,7 +407,7 @@ async def sample_get_security_settings(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetSecuritySettingsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetSecuritySettingsRequest, dict]]): The request object. The request message for [SecuritySettingsService.GetSecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettingsService.GetSecuritySettings]. name (:class:`str`): @@ -464,14 +477,14 @@ async def sample_get_security_settings(): async def update_security_settings( self, - request: Union[ - gcdc_security_settings.UpdateSecuritySettingsRequest, dict + request: Optional[ + Union[gcdc_security_settings.UpdateSecuritySettingsRequest, dict] ] = None, *, - security_settings: gcdc_security_settings.SecuritySettings = None, - update_mask: field_mask_pb2.FieldMask = None, + security_settings: Optional[gcdc_security_settings.SecuritySettings] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_security_settings.SecuritySettings: r"""Updates the specified @@ -508,7 +521,7 @@ async def sample_update_security_settings(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.UpdateSecuritySettingsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.UpdateSecuritySettingsRequest, dict]]): The request object. The request message for [SecuritySettingsService.UpdateSecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettingsService.UpdateSecuritySettings]. security_settings (:class:`google.cloud.dialogflowcx_v3.types.SecuritySettings`): @@ -590,11 +603,13 @@ async def sample_update_security_settings(): async def list_security_settings( self, - request: Union[security_settings.ListSecuritySettingsRequest, dict] = None, + request: Optional[ + Union[security_settings.ListSecuritySettingsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListSecuritySettingsAsyncPager: r"""Returns the list of all security settings in the @@ -628,7 +643,7 @@ async def sample_list_security_settings(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListSecuritySettingsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListSecuritySettingsRequest, dict]]): The request object. The request message for [SecuritySettings.ListSecuritySettings][]. parent (:class:`str`): @@ -707,11 +722,13 @@ async def sample_list_security_settings(): async def delete_security_settings( self, - request: Union[security_settings.DeleteSecuritySettingsRequest, dict] = None, + request: Optional[ + Union[security_settings.DeleteSecuritySettingsRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -741,7 +758,7 @@ async def sample_delete_security_settings(): await client.delete_security_settings(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3.types.DeleteSecuritySettingsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.DeleteSecuritySettingsRequest, dict]]): The request object. The request message for [SecuritySettings.DeleteSecuritySettings][]. name (:class:`str`): @@ -800,10 +817,10 @@ async def sample_delete_security_settings(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -854,10 +871,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -908,10 +925,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -962,10 +979,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1016,10 +1033,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1075,14 +1092,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SecuritySettingsServiceAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/security_settings_service/client.py b/google/cloud/dialogflowcx_v3/services/security_settings_service/client.py index 8971e468..e038319a 100644 --- a/google/cloud/dialogflowcx_v3/services/security_settings_service/client.py +++ b/google/cloud/dialogflowcx_v3/services/security_settings_service/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -63,7 +75,7 @@ class SecuritySettingsServiceClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[SecuritySettingsServiceTransport]: """Returns an appropriate transport class. @@ -382,8 +394,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, SecuritySettingsServiceTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, SecuritySettingsServiceTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the security settings service client. @@ -397,7 +409,7 @@ def __init__( transport (Union[str, SecuritySettingsServiceTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -427,6 +439,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -479,14 +492,14 @@ def __init__( def create_security_settings( self, - request: Union[ - gcdc_security_settings.CreateSecuritySettingsRequest, dict + request: Optional[ + Union[gcdc_security_settings.CreateSecuritySettingsRequest, dict] ] = None, *, - parent: str = None, - security_settings: gcdc_security_settings.SecuritySettings = None, + parent: Optional[str] = None, + security_settings: Optional[gcdc_security_settings.SecuritySettings] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_security_settings.SecuritySettings: r"""Create security settings in the specified location. @@ -606,11 +619,13 @@ def sample_create_security_settings(): def get_security_settings( self, - request: Union[security_settings.GetSecuritySettingsRequest, dict] = None, + request: Optional[ + Union[security_settings.GetSecuritySettingsRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> security_settings.SecuritySettings: r"""Retrieves the specified @@ -714,14 +729,14 @@ def sample_get_security_settings(): def update_security_settings( self, - request: Union[ - gcdc_security_settings.UpdateSecuritySettingsRequest, dict + request: Optional[ + Union[gcdc_security_settings.UpdateSecuritySettingsRequest, dict] ] = None, *, - security_settings: gcdc_security_settings.SecuritySettings = None, - update_mask: field_mask_pb2.FieldMask = None, + security_settings: Optional[gcdc_security_settings.SecuritySettings] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_security_settings.SecuritySettings: r"""Updates the specified @@ -842,11 +857,13 @@ def sample_update_security_settings(): def list_security_settings( self, - request: Union[security_settings.ListSecuritySettingsRequest, dict] = None, + request: Optional[ + Union[security_settings.ListSecuritySettingsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListSecuritySettingsPager: r"""Returns the list of all security settings in the @@ -959,11 +976,13 @@ def sample_list_security_settings(): def delete_security_settings( self, - request: Union[security_settings.DeleteSecuritySettingsRequest, dict] = None, + request: Optional[ + Union[security_settings.DeleteSecuritySettingsRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -1065,10 +1084,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1119,10 +1138,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1173,10 +1192,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1227,10 +1246,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1281,10 +1300,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1334,14 +1353,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SecuritySettingsServiceClient",) diff --git a/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/base.py b/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/base.py index adc5ff52..90727399 100644 --- a/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class SecuritySettingsServiceTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/grpc.py index b90acb95..0054557e 100644 --- a/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/grpc.py @@ -53,14 +53,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -187,8 +187,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/grpc_asyncio.py index b5fcbb1e..f59f4780 100644 --- a/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/security_settings_service/transports/grpc_asyncio.py @@ -55,7 +55,7 @@ class SecuritySettingsServiceGrpcAsyncIOTransport(SecuritySettingsServiceTranspo def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -98,15 +98,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/session_entity_types/async_client.py b/google/cloud/dialogflowcx_v3/services/session_entity_types/async_client.py index ae0a3c1b..b0d694f4 100644 --- a/google/cloud/dialogflowcx_v3/services/session_entity_types/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/session_entity_types/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -172,9 +183,9 @@ def transport(self) -> SessionEntityTypesTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, SessionEntityTypesTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the session entity types client. @@ -218,11 +229,13 @@ def __init__( async def list_session_entity_types( self, - request: Union[session_entity_type.ListSessionEntityTypesRequest, dict] = None, + request: Optional[ + Union[session_entity_type.ListSessionEntityTypesRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListSessionEntityTypesAsyncPager: r"""Returns the list of all session entity types in the @@ -256,7 +269,7 @@ async def sample_list_session_entity_types(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListSessionEntityTypesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListSessionEntityTypesRequest, dict]]): The request object. The request message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityTypes.ListSessionEntityTypes]. parent (:class:`str`): @@ -339,11 +352,13 @@ async def sample_list_session_entity_types(): async def get_session_entity_type( self, - request: Union[session_entity_type.GetSessionEntityTypeRequest, dict] = None, + request: Optional[ + Union[session_entity_type.GetSessionEntityTypeRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session_entity_type.SessionEntityType: r"""Retrieves the specified session entity type. @@ -375,7 +390,7 @@ async def sample_get_session_entity_type(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetSessionEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetSessionEntityTypeRequest, dict]]): The request object. The request message for [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.GetSessionEntityType]. name (:class:`str`): @@ -459,14 +474,16 @@ async def sample_get_session_entity_type(): async def create_session_entity_type( self, - request: Union[ - gcdc_session_entity_type.CreateSessionEntityTypeRequest, dict + request: Optional[ + Union[gcdc_session_entity_type.CreateSessionEntityTypeRequest, dict] ] = None, *, - parent: str = None, - session_entity_type: gcdc_session_entity_type.SessionEntityType = None, + parent: Optional[str] = None, + session_entity_type: Optional[ + gcdc_session_entity_type.SessionEntityType + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_session_entity_type.SessionEntityType: r"""Creates a session entity type. @@ -505,7 +522,7 @@ async def sample_create_session_entity_type(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CreateSessionEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CreateSessionEntityTypeRequest, dict]]): The request object. The request message for [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.CreateSessionEntityType]. parent (:class:`str`): @@ -599,14 +616,16 @@ async def sample_create_session_entity_type(): async def update_session_entity_type( self, - request: Union[ - gcdc_session_entity_type.UpdateSessionEntityTypeRequest, dict + request: Optional[ + Union[gcdc_session_entity_type.UpdateSessionEntityTypeRequest, dict] ] = None, *, - session_entity_type: gcdc_session_entity_type.SessionEntityType = None, - update_mask: field_mask_pb2.FieldMask = None, + session_entity_type: Optional[ + gcdc_session_entity_type.SessionEntityType + ] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_session_entity_type.SessionEntityType: r"""Updates the specified session entity type. @@ -644,7 +663,7 @@ async def sample_update_session_entity_type(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.UpdateSessionEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.UpdateSessionEntityTypeRequest, dict]]): The request object. The request message for [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.UpdateSessionEntityType]. session_entity_type (:class:`google.cloud.dialogflowcx_v3.types.SessionEntityType`): @@ -739,11 +758,13 @@ async def sample_update_session_entity_type(): async def delete_session_entity_type( self, - request: Union[session_entity_type.DeleteSessionEntityTypeRequest, dict] = None, + request: Optional[ + Union[session_entity_type.DeleteSessionEntityTypeRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified session entity type. @@ -772,7 +793,7 @@ async def sample_delete_session_entity_type(): await client.delete_session_entity_type(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3.types.DeleteSessionEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.DeleteSessionEntityTypeRequest, dict]]): The request object. The request message for [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.cx.v3.SessionEntityTypes.DeleteSessionEntityType]. name (:class:`str`): @@ -834,10 +855,10 @@ async def sample_delete_session_entity_type(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -888,10 +909,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -942,10 +963,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -996,10 +1017,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1050,10 +1071,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1109,14 +1130,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SessionEntityTypesAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/session_entity_types/client.py b/google/cloud/dialogflowcx_v3/services/session_entity_types/client.py index 67a26f9b..9c4c88e0 100644 --- a/google/cloud/dialogflowcx_v3/services/session_entity_types/client.py +++ b/google/cloud/dialogflowcx_v3/services/session_entity_types/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -64,7 +76,7 @@ class SessionEntityTypesClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[SessionEntityTypesTransport]: """Returns an appropriate transport class. @@ -345,8 +357,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, SessionEntityTypesTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, SessionEntityTypesTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the session entity types client. @@ -360,7 +372,7 @@ def __init__( transport (Union[str, SessionEntityTypesTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -390,6 +402,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -442,11 +455,13 @@ def __init__( def list_session_entity_types( self, - request: Union[session_entity_type.ListSessionEntityTypesRequest, dict] = None, + request: Optional[ + Union[session_entity_type.ListSessionEntityTypesRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListSessionEntityTypesPager: r"""Returns the list of all session entity types in the @@ -565,11 +580,13 @@ def sample_list_session_entity_types(): def get_session_entity_type( self, - request: Union[session_entity_type.GetSessionEntityTypeRequest, dict] = None, + request: Optional[ + Union[session_entity_type.GetSessionEntityTypeRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session_entity_type.SessionEntityType: r"""Retrieves the specified session entity type. @@ -685,14 +702,16 @@ def sample_get_session_entity_type(): def create_session_entity_type( self, - request: Union[ - gcdc_session_entity_type.CreateSessionEntityTypeRequest, dict + request: Optional[ + Union[gcdc_session_entity_type.CreateSessionEntityTypeRequest, dict] ] = None, *, - parent: str = None, - session_entity_type: gcdc_session_entity_type.SessionEntityType = None, + parent: Optional[str] = None, + session_entity_type: Optional[ + gcdc_session_entity_type.SessionEntityType + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_session_entity_type.SessionEntityType: r"""Creates a session entity type. @@ -829,14 +848,16 @@ def sample_create_session_entity_type(): def update_session_entity_type( self, - request: Union[ - gcdc_session_entity_type.UpdateSessionEntityTypeRequest, dict + request: Optional[ + Union[gcdc_session_entity_type.UpdateSessionEntityTypeRequest, dict] ] = None, *, - session_entity_type: gcdc_session_entity_type.SessionEntityType = None, - update_mask: field_mask_pb2.FieldMask = None, + session_entity_type: Optional[ + gcdc_session_entity_type.SessionEntityType + ] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_session_entity_type.SessionEntityType: r"""Updates the specified session entity type. @@ -973,11 +994,13 @@ def sample_update_session_entity_type(): def delete_session_entity_type( self, - request: Union[session_entity_type.DeleteSessionEntityTypeRequest, dict] = None, + request: Optional[ + Union[session_entity_type.DeleteSessionEntityTypeRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified session entity type. @@ -1083,10 +1106,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1137,10 +1160,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1191,10 +1214,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1245,10 +1268,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1299,10 +1322,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1352,14 +1375,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SessionEntityTypesClient",) diff --git a/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/base.py b/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/base.py index b95c536e..80a5a5ba 100644 --- a/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class SessionEntityTypesTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/grpc.py index 166a21ce..4d1e3bfb 100644 --- a/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/grpc.py @@ -54,14 +54,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -188,8 +188,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/grpc_asyncio.py index 93ac39f7..fff44d25 100644 --- a/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/session_entity_types/transports/grpc_asyncio.py @@ -56,7 +56,7 @@ class SessionEntityTypesGrpcAsyncIOTransport(SessionEntityTypesTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -99,15 +99,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/sessions/async_client.py b/google/cloud/dialogflowcx_v3/services/sessions/async_client.py index 85737dc4..43cd64fc 100644 --- a/google/cloud/dialogflowcx_v3/services/sessions/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/sessions/async_client.py @@ -19,6 +19,8 @@ from typing import ( Dict, Mapping, + MutableMapping, + MutableSequence, Optional, AsyncIterable, Awaitable, @@ -28,7 +30,8 @@ Type, Union, ) -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -190,9 +193,9 @@ def transport(self) -> SessionsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, SessionsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the sessions client. @@ -236,10 +239,10 @@ def __init__( async def detect_intent( self, - request: Union[session.DetectIntentRequest, dict] = None, + request: Optional[Union[session.DetectIntentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session.DetectIntentResponse: r"""Processes a natural language query and returns structured, @@ -283,7 +286,7 @@ async def sample_detect_intent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.DetectIntentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.DetectIntentRequest, dict]]): The request object. The request to detect user's intent. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -336,10 +339,10 @@ async def sample_detect_intent(): def streaming_detect_intent( self, - requests: AsyncIterator[session.StreamingDetectIntentRequest] = None, + requests: Optional[AsyncIterator[session.StreamingDetectIntentRequest]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> Awaitable[AsyncIterable[session.StreamingDetectIntentResponse]]: r"""Processes a natural language query in audio format in a @@ -492,10 +495,10 @@ def request_generator(): async def match_intent( self, - request: Union[session.MatchIntentRequest, dict] = None, + request: Optional[Union[session.MatchIntentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session.MatchIntentResponse: r"""Returns preliminary intent match results, doesn't @@ -533,7 +536,7 @@ async def sample_match_intent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.MatchIntentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.MatchIntentRequest, dict]]): The request object. Request of [MatchIntent][]. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -575,10 +578,10 @@ async def sample_match_intent(): async def fulfill_intent( self, - request: Union[session.FulfillIntentRequest, dict] = None, + request: Optional[Union[session.FulfillIntentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session.FulfillIntentResponse: r"""Fulfills a matched intent returned by @@ -615,7 +618,7 @@ async def sample_fulfill_intent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.FulfillIntentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.FulfillIntentRequest, dict]]): The request object. Request of [FulfillIntent][] retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -664,10 +667,10 @@ async def sample_fulfill_intent(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -718,10 +721,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -772,10 +775,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -826,10 +829,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -880,10 +883,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -939,14 +942,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SessionsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/sessions/client.py b/google/cloud/dialogflowcx_v3/services/sessions/client.py index fb142cc2..d16e4c15 100644 --- a/google/cloud/dialogflowcx_v3/services/sessions/client.py +++ b/google/cloud/dialogflowcx_v3/services/sessions/client.py @@ -19,6 +19,8 @@ from typing import ( Dict, Mapping, + MutableMapping, + MutableSequence, Optional, Iterable, Iterator, @@ -26,8 +28,10 @@ Tuple, Type, Union, + cast, ) -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -68,7 +72,7 @@ class SessionsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[SessionsTransport]: """Returns an appropriate transport class. @@ -549,8 +553,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, SessionsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, SessionsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the sessions client. @@ -564,7 +568,7 @@ def __init__( transport (Union[str, SessionsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -594,6 +598,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -646,10 +651,10 @@ def __init__( def detect_intent( self, - request: Union[session.DetectIntentRequest, dict] = None, + request: Optional[Union[session.DetectIntentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session.DetectIntentResponse: r"""Processes a natural language query and returns structured, @@ -738,10 +743,10 @@ def sample_detect_intent(): def streaming_detect_intent( self, - requests: Iterator[session.StreamingDetectIntentRequest] = None, + requests: Optional[Iterator[session.StreamingDetectIntentRequest]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> Iterable[session.StreamingDetectIntentResponse]: r"""Processes a natural language query in audio format in a @@ -890,10 +895,10 @@ def request_generator(): def match_intent( self, - request: Union[session.MatchIntentRequest, dict] = None, + request: Optional[Union[session.MatchIntentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session.MatchIntentResponse: r"""Returns preliminary intent match results, doesn't @@ -974,10 +979,10 @@ def sample_match_intent(): def fulfill_intent( self, - request: Union[session.FulfillIntentRequest, dict] = None, + request: Optional[Union[session.FulfillIntentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session.FulfillIntentResponse: r"""Fulfills a matched intent returned by @@ -1077,10 +1082,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1131,10 +1136,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1185,10 +1190,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1239,10 +1244,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1293,10 +1298,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1346,14 +1351,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SessionsClient",) diff --git a/google/cloud/dialogflowcx_v3/services/sessions/transports/base.py b/google/cloud/dialogflowcx_v3/services/sessions/transports/base.py index fb12d7ca..ccf2fa30 100644 --- a/google/cloud/dialogflowcx_v3/services/sessions/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/sessions/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -29,14 +30,9 @@ from google.cloud.location import locations_pb2 # type: ignore from google.longrunning import operations_pb2 -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class SessionsTransport(abc.ABC): @@ -53,7 +49,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/sessions/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/sessions/transports/grpc.py index a886012a..ee76cc37 100644 --- a/google/cloud/dialogflowcx_v3/services/sessions/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/sessions/transports/grpc.py @@ -52,14 +52,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -186,8 +186,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/sessions/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/sessions/transports/grpc_asyncio.py index 73cfbd43..a8d47ce4 100644 --- a/google/cloud/dialogflowcx_v3/services/sessions/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/sessions/transports/grpc_asyncio.py @@ -54,7 +54,7 @@ class SessionsGrpcAsyncIOTransport(SessionsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -97,15 +97,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/test_cases/async_client.py b/google/cloud/dialogflowcx_v3/services/test_cases/async_client.py index eba46b3f..75e391dd 100644 --- a/google/cloud/dialogflowcx_v3/services/test_cases/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/test_cases/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -186,9 +197,9 @@ def transport(self) -> TestCasesTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, TestCasesTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the test cases client. @@ -232,11 +243,11 @@ def __init__( async def list_test_cases( self, - request: Union[test_case.ListTestCasesRequest, dict] = None, + request: Optional[Union[test_case.ListTestCasesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTestCasesAsyncPager: r"""Fetches a list of test cases for a given agent. @@ -269,7 +280,7 @@ async def sample_list_test_cases(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListTestCasesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListTestCasesRequest, dict]]): The request object. The request message for [TestCases.ListTestCases][google.cloud.dialogflow.cx.v3.TestCases.ListTestCases]. parent (:class:`str`): @@ -347,11 +358,11 @@ async def sample_list_test_cases(): async def batch_delete_test_cases( self, - request: Union[test_case.BatchDeleteTestCasesRequest, dict] = None, + request: Optional[Union[test_case.BatchDeleteTestCasesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Batch deletes test cases. @@ -381,7 +392,7 @@ async def sample_batch_delete_test_cases(): await client.batch_delete_test_cases(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3.types.BatchDeleteTestCasesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.BatchDeleteTestCasesRequest, dict]]): The request object. The request message for [TestCases.BatchDeleteTestCases][google.cloud.dialogflow.cx.v3.TestCases.BatchDeleteTestCases]. parent (:class:`str`): @@ -438,11 +449,11 @@ async def sample_batch_delete_test_cases(): async def get_test_case( self, - request: Union[test_case.GetTestCaseRequest, dict] = None, + request: Optional[Union[test_case.GetTestCaseRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> test_case.TestCase: r"""Gets a test case. @@ -474,7 +485,7 @@ async def sample_get_test_case(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetTestCaseRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetTestCaseRequest, dict]]): The request object. The request message for [TestCases.GetTestCase][google.cloud.dialogflow.cx.v3.TestCases.GetTestCase]. name (:class:`str`): @@ -538,12 +549,12 @@ async def sample_get_test_case(): async def create_test_case( self, - request: Union[gcdc_test_case.CreateTestCaseRequest, dict] = None, + request: Optional[Union[gcdc_test_case.CreateTestCaseRequest, dict]] = None, *, - parent: str = None, - test_case: gcdc_test_case.TestCase = None, + parent: Optional[str] = None, + test_case: Optional[gcdc_test_case.TestCase] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_test_case.TestCase: r"""Creates a test case for the given agent. @@ -579,7 +590,7 @@ async def sample_create_test_case(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CreateTestCaseRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CreateTestCaseRequest, dict]]): The request object. The request message for [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3.TestCases.CreateTestCase]. parent (:class:`str`): @@ -650,12 +661,12 @@ async def sample_create_test_case(): async def update_test_case( self, - request: Union[gcdc_test_case.UpdateTestCaseRequest, dict] = None, + request: Optional[Union[gcdc_test_case.UpdateTestCaseRequest, dict]] = None, *, - test_case: gcdc_test_case.TestCase = None, - update_mask: field_mask_pb2.FieldMask = None, + test_case: Optional[gcdc_test_case.TestCase] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_test_case.TestCase: r"""Updates the specified test case. @@ -690,7 +701,7 @@ async def sample_update_test_case(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.UpdateTestCaseRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.UpdateTestCaseRequest, dict]]): The request object. The request message for [TestCases.UpdateTestCase][google.cloud.dialogflow.cx.v3.TestCases.UpdateTestCase]. test_case (:class:`google.cloud.dialogflowcx_v3.types.TestCase`): @@ -767,10 +778,10 @@ async def sample_update_test_case(): async def run_test_case( self, - request: Union[test_case.RunTestCaseRequest, dict] = None, + request: Optional[Union[test_case.RunTestCaseRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Kicks off a test case run. @@ -810,13 +821,13 @@ async def sample_run_test_case(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.RunTestCaseRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.RunTestCaseRequest, dict]]): The request object. The request message for [TestCases.RunTestCase][google.cloud.dialogflow.cx.v3.TestCases.RunTestCase]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -873,10 +884,10 @@ async def sample_run_test_case(): async def batch_run_test_cases( self, - request: Union[test_case.BatchRunTestCasesRequest, dict] = None, + request: Optional[Union[test_case.BatchRunTestCasesRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Kicks off a batch run of test cases. @@ -917,13 +928,13 @@ async def sample_batch_run_test_cases(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.BatchRunTestCasesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.BatchRunTestCasesRequest, dict]]): The request object. The request message for [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3.TestCases.BatchRunTestCases]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -980,10 +991,10 @@ async def sample_batch_run_test_cases(): async def calculate_coverage( self, - request: Union[test_case.CalculateCoverageRequest, dict] = None, + request: Optional[Union[test_case.CalculateCoverageRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> test_case.CalculateCoverageResponse: r"""Calculates the test coverage for an agent. @@ -1016,7 +1027,7 @@ async def sample_calculate_coverage(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CalculateCoverageRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CalculateCoverageRequest, dict]]): The request object. The request message for [TestCases.CalculateCoverage][google.cloud.dialogflow.cx.v3.TestCases.CalculateCoverage]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1061,10 +1072,10 @@ async def sample_calculate_coverage(): async def import_test_cases( self, - request: Union[test_case.ImportTestCasesRequest, dict] = None, + request: Optional[Union[test_case.ImportTestCasesRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Imports the test cases from a Cloud Storage bucket or a local @@ -1108,13 +1119,13 @@ async def sample_import_test_cases(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ImportTestCasesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ImportTestCasesRequest, dict]]): The request object. The request message for [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ImportTestCases]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1171,10 +1182,10 @@ async def sample_import_test_cases(): async def export_test_cases( self, - request: Union[test_case.ExportTestCasesRequest, dict] = None, + request: Optional[Union[test_case.ExportTestCasesRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Exports the test cases under the agent to a Cloud Storage bucket @@ -1217,13 +1228,13 @@ async def sample_export_test_cases(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ExportTestCasesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ExportTestCasesRequest, dict]]): The request object. The request message for [TestCases.ExportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ExportTestCases]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1280,11 +1291,11 @@ async def sample_export_test_cases(): async def list_test_case_results( self, - request: Union[test_case.ListTestCaseResultsRequest, dict] = None, + request: Optional[Union[test_case.ListTestCaseResultsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTestCaseResultsAsyncPager: r"""Fetches a list of results for a given test case. @@ -1317,7 +1328,7 @@ async def sample_list_test_case_results(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListTestCaseResultsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListTestCaseResultsRequest, dict]]): The request object. The request message for [TestCases.ListTestCaseResults][google.cloud.dialogflow.cx.v3.TestCases.ListTestCaseResults]. parent (:class:`str`): @@ -1397,11 +1408,11 @@ async def sample_list_test_case_results(): async def get_test_case_result( self, - request: Union[test_case.GetTestCaseResultRequest, dict] = None, + request: Optional[Union[test_case.GetTestCaseResultRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> test_case.TestCaseResult: r"""Gets a test case result. @@ -1433,7 +1444,7 @@ async def sample_get_test_case_result(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetTestCaseResultRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetTestCaseResultRequest, dict]]): The request object. The request message for [TestCases.GetTestCaseResult][google.cloud.dialogflow.cx.v3.TestCases.GetTestCaseResult]. name (:class:`str`): @@ -1499,10 +1510,10 @@ async def sample_get_test_case_result(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1553,10 +1564,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1607,10 +1618,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1661,10 +1672,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1715,10 +1726,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1774,14 +1785,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("TestCasesAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/test_cases/client.py b/google/cloud/dialogflowcx_v3/services/test_cases/client.py index c39f6e30..e8079fcf 100644 --- a/google/cloud/dialogflowcx_v3/services/test_cases/client.py +++ b/google/cloud/dialogflowcx_v3/services/test_cases/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -62,7 +74,7 @@ class TestCasesClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[TestCasesTransport]: """Returns an appropriate transport class. @@ -562,8 +574,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, TestCasesTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, TestCasesTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the test cases client. @@ -577,7 +589,7 @@ def __init__( transport (Union[str, TestCasesTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -607,6 +619,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -659,11 +672,11 @@ def __init__( def list_test_cases( self, - request: Union[test_case.ListTestCasesRequest, dict] = None, + request: Optional[Union[test_case.ListTestCasesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTestCasesPager: r"""Fetches a list of test cases for a given agent. @@ -774,11 +787,11 @@ def sample_list_test_cases(): def batch_delete_test_cases( self, - request: Union[test_case.BatchDeleteTestCasesRequest, dict] = None, + request: Optional[Union[test_case.BatchDeleteTestCasesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Batch deletes test cases. @@ -865,11 +878,11 @@ def sample_batch_delete_test_cases(): def get_test_case( self, - request: Union[test_case.GetTestCaseRequest, dict] = None, + request: Optional[Union[test_case.GetTestCaseRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> test_case.TestCase: r"""Gets a test case. @@ -965,12 +978,12 @@ def sample_get_test_case(): def create_test_case( self, - request: Union[gcdc_test_case.CreateTestCaseRequest, dict] = None, + request: Optional[Union[gcdc_test_case.CreateTestCaseRequest, dict]] = None, *, - parent: str = None, - test_case: gcdc_test_case.TestCase = None, + parent: Optional[str] = None, + test_case: Optional[gcdc_test_case.TestCase] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_test_case.TestCase: r"""Creates a test case for the given agent. @@ -1077,12 +1090,12 @@ def sample_create_test_case(): def update_test_case( self, - request: Union[gcdc_test_case.UpdateTestCaseRequest, dict] = None, + request: Optional[Union[gcdc_test_case.UpdateTestCaseRequest, dict]] = None, *, - test_case: gcdc_test_case.TestCase = None, - update_mask: field_mask_pb2.FieldMask = None, + test_case: Optional[gcdc_test_case.TestCase] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_test_case.TestCase: r"""Updates the specified test case. @@ -1194,10 +1207,10 @@ def sample_update_test_case(): def run_test_case( self, - request: Union[test_case.RunTestCaseRequest, dict] = None, + request: Optional[Union[test_case.RunTestCaseRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Kicks off a test case run. @@ -1301,10 +1314,10 @@ def sample_run_test_case(): def batch_run_test_cases( self, - request: Union[test_case.BatchRunTestCasesRequest, dict] = None, + request: Optional[Union[test_case.BatchRunTestCasesRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Kicks off a batch run of test cases. @@ -1409,10 +1422,10 @@ def sample_batch_run_test_cases(): def calculate_coverage( self, - request: Union[test_case.CalculateCoverageRequest, dict] = None, + request: Optional[Union[test_case.CalculateCoverageRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> test_case.CalculateCoverageResponse: r"""Calculates the test coverage for an agent. @@ -1491,10 +1504,10 @@ def sample_calculate_coverage(): def import_test_cases( self, - request: Union[test_case.ImportTestCasesRequest, dict] = None, + request: Optional[Union[test_case.ImportTestCasesRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Imports the test cases from a Cloud Storage bucket or a local @@ -1602,10 +1615,10 @@ def sample_import_test_cases(): def export_test_cases( self, - request: Union[test_case.ExportTestCasesRequest, dict] = None, + request: Optional[Union[test_case.ExportTestCasesRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Exports the test cases under the agent to a Cloud Storage bucket @@ -1712,11 +1725,11 @@ def sample_export_test_cases(): def list_test_case_results( self, - request: Union[test_case.ListTestCaseResultsRequest, dict] = None, + request: Optional[Union[test_case.ListTestCaseResultsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTestCaseResultsPager: r"""Fetches a list of results for a given test case. @@ -1829,11 +1842,11 @@ def sample_list_test_case_results(): def get_test_case_result( self, - request: Union[test_case.GetTestCaseResultRequest, dict] = None, + request: Optional[Union[test_case.GetTestCaseResultRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> test_case.TestCaseResult: r"""Gets a test case result. @@ -1944,10 +1957,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1998,10 +2011,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -2052,10 +2065,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -2106,10 +2119,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -2160,10 +2173,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -2213,14 +2226,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("TestCasesClient",) diff --git a/google/cloud/dialogflowcx_v3/services/test_cases/transports/base.py b/google/cloud/dialogflowcx_v3/services/test_cases/transports/base.py index 7c4a316a..e38d5cf7 100644 --- a/google/cloud/dialogflowcx_v3/services/test_cases/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/test_cases/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class TestCasesTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/test_cases/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/test_cases/transports/grpc.py index db9666ea..819be691 100644 --- a/google/cloud/dialogflowcx_v3/services/test_cases/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/test_cases/transports/grpc.py @@ -55,14 +55,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -190,8 +190,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/test_cases/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/test_cases/transports/grpc_asyncio.py index 1a3f823c..5e025713 100644 --- a/google/cloud/dialogflowcx_v3/services/test_cases/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/test_cases/transports/grpc_asyncio.py @@ -57,7 +57,7 @@ class TestCasesGrpcAsyncIOTransport(TestCasesTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -100,15 +100,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/transition_route_groups/async_client.py b/google/cloud/dialogflowcx_v3/services/transition_route_groups/async_client.py index 8ca56763..e76697c2 100644 --- a/google/cloud/dialogflowcx_v3/services/transition_route_groups/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/transition_route_groups/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -182,9 +193,9 @@ def transport(self) -> TransitionRouteGroupsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, TransitionRouteGroupsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the transition route groups client. @@ -228,13 +239,13 @@ def __init__( async def list_transition_route_groups( self, - request: Union[ - transition_route_group.ListTransitionRouteGroupsRequest, dict + request: Optional[ + Union[transition_route_group.ListTransitionRouteGroupsRequest, dict] ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTransitionRouteGroupsAsyncPager: r"""Returns the list of all transition route groups in @@ -268,7 +279,7 @@ async def sample_list_transition_route_groups(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListTransitionRouteGroupsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListTransitionRouteGroupsRequest, dict]]): The request object. The request message for [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.ListTransitionRouteGroups]. parent (:class:`str`): @@ -347,13 +358,13 @@ async def sample_list_transition_route_groups(): async def get_transition_route_group( self, - request: Union[ - transition_route_group.GetTransitionRouteGroupRequest, dict + request: Optional[ + Union[transition_route_group.GetTransitionRouteGroupRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> transition_route_group.TransitionRouteGroup: r"""Retrieves the specified @@ -386,7 +397,7 @@ async def sample_get_transition_route_group(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetTransitionRouteGroupRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetTransitionRouteGroupRequest, dict]]): The request object. The request message for [TransitionRouteGroups.GetTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.GetTransitionRouteGroup]. name (:class:`str`): @@ -456,14 +467,16 @@ async def sample_get_transition_route_group(): async def create_transition_route_group( self, - request: Union[ - gcdc_transition_route_group.CreateTransitionRouteGroupRequest, dict + request: Optional[ + Union[gcdc_transition_route_group.CreateTransitionRouteGroupRequest, dict] ] = None, *, - parent: str = None, - transition_route_group: gcdc_transition_route_group.TransitionRouteGroup = None, + parent: Optional[str] = None, + transition_route_group: Optional[ + gcdc_transition_route_group.TransitionRouteGroup + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_transition_route_group.TransitionRouteGroup: r"""Creates an @@ -505,7 +518,7 @@ async def sample_create_transition_route_group(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CreateTransitionRouteGroupRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CreateTransitionRouteGroupRequest, dict]]): The request object. The request message for [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.CreateTransitionRouteGroup]. parent (:class:`str`): @@ -584,14 +597,16 @@ async def sample_create_transition_route_group(): async def update_transition_route_group( self, - request: Union[ - gcdc_transition_route_group.UpdateTransitionRouteGroupRequest, dict + request: Optional[ + Union[gcdc_transition_route_group.UpdateTransitionRouteGroupRequest, dict] ] = None, *, - transition_route_group: gcdc_transition_route_group.TransitionRouteGroup = None, - update_mask: field_mask_pb2.FieldMask = None, + transition_route_group: Optional[ + gcdc_transition_route_group.TransitionRouteGroup + ] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_transition_route_group.TransitionRouteGroup: r"""Updates the specified @@ -631,7 +646,7 @@ async def sample_update_transition_route_group(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.UpdateTransitionRouteGroupRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.UpdateTransitionRouteGroupRequest, dict]]): The request object. The request message for [TransitionRouteGroups.UpdateTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.UpdateTransitionRouteGroup]. transition_route_group (:class:`google.cloud.dialogflowcx_v3.types.TransitionRouteGroup`): @@ -710,13 +725,13 @@ async def sample_update_transition_route_group(): async def delete_transition_route_group( self, - request: Union[ - transition_route_group.DeleteTransitionRouteGroupRequest, dict + request: Optional[ + Union[transition_route_group.DeleteTransitionRouteGroupRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -750,7 +765,7 @@ async def sample_delete_transition_route_group(): await client.delete_transition_route_group(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3.types.DeleteTransitionRouteGroupRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.DeleteTransitionRouteGroupRequest, dict]]): The request object. The request message for [TransitionRouteGroups.DeleteTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.DeleteTransitionRouteGroup]. name (:class:`str`): @@ -809,10 +824,10 @@ async def sample_delete_transition_route_group(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -863,10 +878,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -917,10 +932,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -971,10 +986,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1025,10 +1040,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1084,14 +1099,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("TransitionRouteGroupsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/transition_route_groups/client.py b/google/cloud/dialogflowcx_v3/services/transition_route_groups/client.py index a71ec3b2..50ff8d3e 100644 --- a/google/cloud/dialogflowcx_v3/services/transition_route_groups/client.py +++ b/google/cloud/dialogflowcx_v3/services/transition_route_groups/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -64,7 +76,7 @@ class TransitionRouteGroupsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[TransitionRouteGroupsTransport]: """Returns an appropriate transport class. @@ -443,8 +455,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, TransitionRouteGroupsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, TransitionRouteGroupsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the transition route groups client. @@ -458,7 +470,7 @@ def __init__( transport (Union[str, TransitionRouteGroupsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -488,6 +500,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -540,13 +553,13 @@ def __init__( def list_transition_route_groups( self, - request: Union[ - transition_route_group.ListTransitionRouteGroupsRequest, dict + request: Optional[ + Union[transition_route_group.ListTransitionRouteGroupsRequest, dict] ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTransitionRouteGroupsPager: r"""Returns the list of all transition route groups in @@ -663,13 +676,13 @@ def sample_list_transition_route_groups(): def get_transition_route_group( self, - request: Union[ - transition_route_group.GetTransitionRouteGroupRequest, dict + request: Optional[ + Union[transition_route_group.GetTransitionRouteGroupRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> transition_route_group.TransitionRouteGroup: r"""Retrieves the specified @@ -776,14 +789,16 @@ def sample_get_transition_route_group(): def create_transition_route_group( self, - request: Union[ - gcdc_transition_route_group.CreateTransitionRouteGroupRequest, dict + request: Optional[ + Union[gcdc_transition_route_group.CreateTransitionRouteGroupRequest, dict] ] = None, *, - parent: str = None, - transition_route_group: gcdc_transition_route_group.TransitionRouteGroup = None, + parent: Optional[str] = None, + transition_route_group: Optional[ + gcdc_transition_route_group.TransitionRouteGroup + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_transition_route_group.TransitionRouteGroup: r"""Creates an @@ -910,14 +925,16 @@ def sample_create_transition_route_group(): def update_transition_route_group( self, - request: Union[ - gcdc_transition_route_group.UpdateTransitionRouteGroupRequest, dict + request: Optional[ + Union[gcdc_transition_route_group.UpdateTransitionRouteGroupRequest, dict] ] = None, *, - transition_route_group: gcdc_transition_route_group.TransitionRouteGroup = None, - update_mask: field_mask_pb2.FieldMask = None, + transition_route_group: Optional[ + gcdc_transition_route_group.TransitionRouteGroup + ] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_transition_route_group.TransitionRouteGroup: r"""Updates the specified @@ -1042,13 +1059,13 @@ def sample_update_transition_route_group(): def delete_transition_route_group( self, - request: Union[ - transition_route_group.DeleteTransitionRouteGroupRequest, dict + request: Optional[ + Union[transition_route_group.DeleteTransitionRouteGroupRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -1158,10 +1175,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1212,10 +1229,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1266,10 +1283,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1320,10 +1337,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1374,10 +1391,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1427,14 +1444,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("TransitionRouteGroupsClient",) diff --git a/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/base.py b/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/base.py index ab3c730b..dd9c7d5e 100644 --- a/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class TransitionRouteGroupsTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/grpc.py index 7725131e..32d33950 100644 --- a/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/grpc.py @@ -54,14 +54,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -188,8 +188,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/grpc_asyncio.py index 99ce609c..83595f30 100644 --- a/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/transition_route_groups/transports/grpc_asyncio.py @@ -56,7 +56,7 @@ class TransitionRouteGroupsGrpcAsyncIOTransport(TransitionRouteGroupsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -99,15 +99,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/versions/async_client.py b/google/cloud/dialogflowcx_v3/services/versions/async_client.py index 4e9bd0f4..60bc5f95 100644 --- a/google/cloud/dialogflowcx_v3/services/versions/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/versions/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -162,9 +173,9 @@ def transport(self) -> VersionsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, VersionsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the versions client. @@ -208,11 +219,11 @@ def __init__( async def list_versions( self, - request: Union[version.ListVersionsRequest, dict] = None, + request: Optional[Union[version.ListVersionsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListVersionsAsyncPager: r"""Returns the list of all versions in the specified @@ -246,7 +257,7 @@ async def sample_list_versions(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListVersionsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListVersionsRequest, dict]]): The request object. The request message for [Versions.ListVersions][google.cloud.dialogflow.cx.v3.Versions.ListVersions]. parent (:class:`str`): @@ -325,11 +336,11 @@ async def sample_list_versions(): async def get_version( self, - request: Union[version.GetVersionRequest, dict] = None, + request: Optional[Union[version.GetVersionRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> version.Version: r"""Retrieves the specified @@ -362,7 +373,7 @@ async def sample_get_version(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetVersionRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetVersionRequest, dict]]): The request object. The request message for [Versions.GetVersion][google.cloud.dialogflow.cx.v3.Versions.GetVersion]. name (:class:`str`): @@ -428,12 +439,12 @@ async def sample_get_version(): async def create_version( self, - request: Union[gcdc_version.CreateVersionRequest, dict] = None, + request: Optional[Union[gcdc_version.CreateVersionRequest, dict]] = None, *, - parent: str = None, - version: gcdc_version.Version = None, + parent: Optional[str] = None, + version: Optional[gcdc_version.Version] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in @@ -478,13 +489,13 @@ async def sample_create_version(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CreateVersionRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CreateVersionRequest, dict]]): The request object. The request message for [Versions.CreateVersion][google.cloud.dialogflow.cx.v3.Versions.CreateVersion]. parent (:class:`str`): @@ -571,12 +582,12 @@ async def sample_create_version(): async def update_version( self, - request: Union[gcdc_version.UpdateVersionRequest, dict] = None, + request: Optional[Union[gcdc_version.UpdateVersionRequest, dict]] = None, *, - version: gcdc_version.Version = None, - update_mask: field_mask_pb2.FieldMask = None, + version: Optional[gcdc_version.Version] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_version.Version: r"""Updates the specified @@ -612,7 +623,7 @@ async def sample_update_version(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.UpdateVersionRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.UpdateVersionRequest, dict]]): The request object. The request message for [Versions.UpdateVersion][google.cloud.dialogflow.cx.v3.Versions.UpdateVersion]. version (:class:`google.cloud.dialogflowcx_v3.types.Version`): @@ -686,11 +697,11 @@ async def sample_update_version(): async def delete_version( self, - request: Union[version.DeleteVersionRequest, dict] = None, + request: Optional[Union[version.DeleteVersionRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -720,7 +731,7 @@ async def sample_delete_version(): await client.delete_version(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3.types.DeleteVersionRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.DeleteVersionRequest, dict]]): The request object. The request message for [Versions.DeleteVersion][google.cloud.dialogflow.cx.v3.Versions.DeleteVersion]. name (:class:`str`): @@ -779,11 +790,11 @@ async def sample_delete_version(): async def load_version( self, - request: Union[version.LoadVersionRequest, dict] = None, + request: Optional[Union[version.LoadVersionRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Loads resources in the specified version to the draft flow. @@ -823,13 +834,13 @@ async def sample_load_version(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.LoadVersionRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.LoadVersionRequest, dict]]): The request object. The request message for [Versions.LoadVersion][google.cloud.dialogflow.cx.v3.Versions.LoadVersion]. name (:class:`str`): @@ -915,11 +926,11 @@ async def sample_load_version(): async def compare_versions( self, - request: Union[version.CompareVersionsRequest, dict] = None, + request: Optional[Union[version.CompareVersionsRequest, dict]] = None, *, - base_version: str = None, + base_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> version.CompareVersionsResponse: r"""Compares the specified base version with target @@ -953,7 +964,7 @@ async def sample_compare_versions(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CompareVersionsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CompareVersionsRequest, dict]]): The request object. The request message for [Versions.CompareVersions][google.cloud.dialogflow.cx.v3.Versions.CompareVersions]. base_version (:class:`str`): @@ -1025,10 +1036,10 @@ async def sample_compare_versions(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1079,10 +1090,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1133,10 +1144,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1187,10 +1198,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1241,10 +1252,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1300,14 +1311,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("VersionsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/versions/client.py b/google/cloud/dialogflowcx_v3/services/versions/client.py index 84d1952b..d52abccd 100644 --- a/google/cloud/dialogflowcx_v3/services/versions/client.py +++ b/google/cloud/dialogflowcx_v3/services/versions/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -65,7 +77,7 @@ class VersionsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[VersionsTransport]: """Returns an appropriate transport class. @@ -346,8 +358,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, VersionsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, VersionsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the versions client. @@ -361,7 +373,7 @@ def __init__( transport (Union[str, VersionsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -391,6 +403,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -443,11 +456,11 @@ def __init__( def list_versions( self, - request: Union[version.ListVersionsRequest, dict] = None, + request: Optional[Union[version.ListVersionsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListVersionsPager: r"""Returns the list of all versions in the specified @@ -560,11 +573,11 @@ def sample_list_versions(): def get_version( self, - request: Union[version.GetVersionRequest, dict] = None, + request: Optional[Union[version.GetVersionRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> version.Version: r"""Retrieves the specified @@ -663,12 +676,12 @@ def sample_get_version(): def create_version( self, - request: Union[gcdc_version.CreateVersionRequest, dict] = None, + request: Optional[Union[gcdc_version.CreateVersionRequest, dict]] = None, *, - parent: str = None, - version: gcdc_version.Version = None, + parent: Optional[str] = None, + version: Optional[gcdc_version.Version] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in @@ -806,12 +819,12 @@ def sample_create_version(): def update_version( self, - request: Union[gcdc_version.UpdateVersionRequest, dict] = None, + request: Optional[Union[gcdc_version.UpdateVersionRequest, dict]] = None, *, - version: gcdc_version.Version = None, - update_mask: field_mask_pb2.FieldMask = None, + version: Optional[gcdc_version.Version] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_version.Version: r"""Updates the specified @@ -921,11 +934,11 @@ def sample_update_version(): def delete_version( self, - request: Union[version.DeleteVersionRequest, dict] = None, + request: Optional[Union[version.DeleteVersionRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -1014,11 +1027,11 @@ def sample_delete_version(): def load_version( self, - request: Union[version.LoadVersionRequest, dict] = None, + request: Optional[Union[version.LoadVersionRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Loads resources in the specified version to the draft flow. @@ -1150,11 +1163,11 @@ def sample_load_version(): def compare_versions( self, - request: Union[version.CompareVersionsRequest, dict] = None, + request: Optional[Union[version.CompareVersionsRequest, dict]] = None, *, - base_version: str = None, + base_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> version.CompareVersionsResponse: r"""Compares the specified base version with target @@ -1273,10 +1286,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1327,10 +1340,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1381,10 +1394,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1435,10 +1448,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1489,10 +1502,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1542,14 +1555,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("VersionsClient",) diff --git a/google/cloud/dialogflowcx_v3/services/versions/transports/base.py b/google/cloud/dialogflowcx_v3/services/versions/transports/base.py index f6697c24..d995e53d 100644 --- a/google/cloud/dialogflowcx_v3/services/versions/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/versions/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class VersionsTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/versions/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/versions/transports/grpc.py index cb11f4ef..a9bd43da 100644 --- a/google/cloud/dialogflowcx_v3/services/versions/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/versions/transports/grpc.py @@ -54,14 +54,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -189,8 +189,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/versions/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/versions/transports/grpc_asyncio.py index c533cfb8..cff19ca9 100644 --- a/google/cloud/dialogflowcx_v3/services/versions/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/versions/transports/grpc_asyncio.py @@ -56,7 +56,7 @@ class VersionsGrpcAsyncIOTransport(VersionsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -99,15 +99,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/webhooks/async_client.py b/google/cloud/dialogflowcx_v3/services/webhooks/async_client.py index 3167e170..978fdfc2 100644 --- a/google/cloud/dialogflowcx_v3/services/webhooks/async_client.py +++ b/google/cloud/dialogflowcx_v3/services/webhooks/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -159,9 +170,9 @@ def transport(self) -> WebhooksTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, WebhooksTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the webhooks client. @@ -205,11 +216,11 @@ def __init__( async def list_webhooks( self, - request: Union[webhook.ListWebhooksRequest, dict] = None, + request: Optional[Union[webhook.ListWebhooksRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListWebhooksAsyncPager: r"""Returns the list of all webhooks in the specified @@ -243,7 +254,7 @@ async def sample_list_webhooks(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.ListWebhooksRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.ListWebhooksRequest, dict]]): The request object. The request message for [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3.Webhooks.ListWebhooks]. parent (:class:`str`): @@ -321,11 +332,11 @@ async def sample_list_webhooks(): async def get_webhook( self, - request: Union[webhook.GetWebhookRequest, dict] = None, + request: Optional[Union[webhook.GetWebhookRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> webhook.Webhook: r"""Retrieves the specified webhook. @@ -357,7 +368,7 @@ async def sample_get_webhook(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.GetWebhookRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.GetWebhookRequest, dict]]): The request object. The request message for [Webhooks.GetWebhook][google.cloud.dialogflow.cx.v3.Webhooks.GetWebhook]. name (:class:`str`): @@ -428,12 +439,12 @@ async def sample_get_webhook(): async def create_webhook( self, - request: Union[gcdc_webhook.CreateWebhookRequest, dict] = None, + request: Optional[Union[gcdc_webhook.CreateWebhookRequest, dict]] = None, *, - parent: str = None, - webhook: gcdc_webhook.Webhook = None, + parent: Optional[str] = None, + webhook: Optional[gcdc_webhook.Webhook] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_webhook.Webhook: r"""Creates a webhook in the specified agent. @@ -470,7 +481,7 @@ async def sample_create_webhook(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.CreateWebhookRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.CreateWebhookRequest, dict]]): The request object. The request message for [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3.Webhooks.CreateWebhook]. parent (:class:`str`): @@ -548,12 +559,12 @@ async def sample_create_webhook(): async def update_webhook( self, - request: Union[gcdc_webhook.UpdateWebhookRequest, dict] = None, + request: Optional[Union[gcdc_webhook.UpdateWebhookRequest, dict]] = None, *, - webhook: gcdc_webhook.Webhook = None, - update_mask: field_mask_pb2.FieldMask = None, + webhook: Optional[gcdc_webhook.Webhook] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_webhook.Webhook: r"""Updates the specified webhook. @@ -589,7 +600,7 @@ async def sample_update_webhook(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3.types.UpdateWebhookRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.UpdateWebhookRequest, dict]]): The request object. The request message for [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3.Webhooks.UpdateWebhook]. webhook (:class:`google.cloud.dialogflowcx_v3.types.Webhook`): @@ -670,11 +681,11 @@ async def sample_update_webhook(): async def delete_webhook( self, - request: Union[webhook.DeleteWebhookRequest, dict] = None, + request: Optional[Union[webhook.DeleteWebhookRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified webhook. @@ -703,7 +714,7 @@ async def sample_delete_webhook(): await client.delete_webhook(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3.types.DeleteWebhookRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3.types.DeleteWebhookRequest, dict]]): The request object. The request message for [Webhooks.DeleteWebhook][google.cloud.dialogflow.cx.v3.Webhooks.DeleteWebhook]. name (:class:`str`): @@ -760,10 +771,10 @@ async def sample_delete_webhook(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -814,10 +825,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -868,10 +879,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -922,10 +933,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -976,10 +987,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1035,14 +1046,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("WebhooksAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3/services/webhooks/client.py b/google/cloud/dialogflowcx_v3/services/webhooks/client.py index 117fdb0d..38431f61 100644 --- a/google/cloud/dialogflowcx_v3/services/webhooks/client.py +++ b/google/cloud/dialogflowcx_v3/services/webhooks/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -60,7 +72,7 @@ class WebhooksClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[WebhooksTransport]: """Returns an appropriate transport class. @@ -363,8 +375,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, WebhooksTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, WebhooksTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the webhooks client. @@ -378,7 +390,7 @@ def __init__( transport (Union[str, WebhooksTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -408,6 +420,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -460,11 +473,11 @@ def __init__( def list_webhooks( self, - request: Union[webhook.ListWebhooksRequest, dict] = None, + request: Optional[Union[webhook.ListWebhooksRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListWebhooksPager: r"""Returns the list of all webhooks in the specified @@ -576,11 +589,11 @@ def sample_list_webhooks(): def get_webhook( self, - request: Union[webhook.GetWebhookRequest, dict] = None, + request: Optional[Union[webhook.GetWebhookRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> webhook.Webhook: r"""Retrieves the specified webhook. @@ -683,12 +696,12 @@ def sample_get_webhook(): def create_webhook( self, - request: Union[gcdc_webhook.CreateWebhookRequest, dict] = None, + request: Optional[Union[gcdc_webhook.CreateWebhookRequest, dict]] = None, *, - parent: str = None, - webhook: gcdc_webhook.Webhook = None, + parent: Optional[str] = None, + webhook: Optional[gcdc_webhook.Webhook] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_webhook.Webhook: r"""Creates a webhook in the specified agent. @@ -803,12 +816,12 @@ def sample_create_webhook(): def update_webhook( self, - request: Union[gcdc_webhook.UpdateWebhookRequest, dict] = None, + request: Optional[Union[gcdc_webhook.UpdateWebhookRequest, dict]] = None, *, - webhook: gcdc_webhook.Webhook = None, - update_mask: field_mask_pb2.FieldMask = None, + webhook: Optional[gcdc_webhook.Webhook] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_webhook.Webhook: r"""Updates the specified webhook. @@ -925,11 +938,11 @@ def sample_update_webhook(): def delete_webhook( self, - request: Union[webhook.DeleteWebhookRequest, dict] = None, + request: Optional[Union[webhook.DeleteWebhookRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified webhook. @@ -1028,10 +1041,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1082,10 +1095,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1136,10 +1149,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1190,10 +1203,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1244,10 +1257,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1297,14 +1310,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("WebhooksClient",) diff --git a/google/cloud/dialogflowcx_v3/services/webhooks/transports/base.py b/google/cloud/dialogflowcx_v3/services/webhooks/transports/base.py index dc034034..512adf3e 100644 --- a/google/cloud/dialogflowcx_v3/services/webhooks/transports/base.py +++ b/google/cloud/dialogflowcx_v3/services/webhooks/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -31,14 +32,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class WebhooksTransport(abc.ABC): @@ -55,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/services/webhooks/transports/grpc.py b/google/cloud/dialogflowcx_v3/services/webhooks/transports/grpc.py index f5ad4dcd..0d027432 100644 --- a/google/cloud/dialogflowcx_v3/services/webhooks/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3/services/webhooks/transports/grpc.py @@ -52,14 +52,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -186,8 +186,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3/services/webhooks/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3/services/webhooks/transports/grpc_asyncio.py index 8be6bfdb..28557d45 100644 --- a/google/cloud/dialogflowcx_v3/services/webhooks/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3/services/webhooks/transports/grpc_asyncio.py @@ -54,7 +54,7 @@ class WebhooksGrpcAsyncIOTransport(WebhooksTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -97,15 +97,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3/types/advanced_settings.py b/google/cloud/dialogflowcx_v3/types/advanced_settings.py index 36d79918..33e68ea4 100644 --- a/google/cloud/dialogflowcx_v3/types/advanced_settings.py +++ b/google/cloud/dialogflowcx_v3/types/advanced_settings.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore @@ -59,16 +61,16 @@ class LoggingSettings(proto.Message): enabled. """ - enable_stackdriver_logging = proto.Field( + enable_stackdriver_logging: bool = proto.Field( proto.BOOL, number=2, ) - enable_interaction_logging = proto.Field( + enable_interaction_logging: bool = proto.Field( proto.BOOL, number=3, ) - logging_settings = proto.Field( + logging_settings: LoggingSettings = proto.Field( proto.MESSAGE, number=6, message=LoggingSettings, diff --git a/google/cloud/dialogflowcx_v3/types/agent.py b/google/cloud/dialogflowcx_v3/types/agent.py index c01c5d6f..f3267766 100644 --- a/google/cloud/dialogflowcx_v3/types/agent.py +++ b/google/cloud/dialogflowcx_v3/types/agent.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3.types import ( @@ -52,7 +54,7 @@ class SpeechToTextSettings(proto.Message): recognition. """ - enable_speech_adaptation = proto.Field( + enable_speech_adaptation: bool = proto.Field( proto.BOOL, number=1, ) @@ -91,7 +93,7 @@ class Agent(proto.Message): field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3.Agents.UpdateAgent] method. - supported_language_codes (Sequence[str]): + supported_language_codes (MutableSequence[str]): The list of all languages supported by the agent (except for the ``default_language_code``). time_zone (str): @@ -139,60 +141,60 @@ class Agent(proto.Message): level. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - default_language_code = proto.Field( + default_language_code: str = proto.Field( proto.STRING, number=3, ) - supported_language_codes = proto.RepeatedField( + supported_language_codes: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=4, ) - time_zone = proto.Field( + time_zone: str = proto.Field( proto.STRING, number=5, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=6, ) - avatar_uri = proto.Field( + avatar_uri: str = proto.Field( proto.STRING, number=7, ) - speech_to_text_settings = proto.Field( + speech_to_text_settings: "SpeechToTextSettings" = proto.Field( proto.MESSAGE, number=13, message="SpeechToTextSettings", ) - start_flow = proto.Field( + start_flow: str = proto.Field( proto.STRING, number=16, ) - security_settings = proto.Field( + security_settings: str = proto.Field( proto.STRING, number=17, ) - enable_stackdriver_logging = proto.Field( + enable_stackdriver_logging: bool = proto.Field( proto.BOOL, number=18, ) - enable_spell_correction = proto.Field( + enable_spell_correction: bool = proto.Field( proto.BOOL, number=20, ) - locked = proto.Field( + locked: bool = proto.Field( proto.BOOL, number=27, ) - advanced_settings = proto.Field( + advanced_settings: gcdc_advanced_settings.AdvancedSettings = proto.Field( proto.MESSAGE, number=22, message=gcdc_advanced_settings.AdvancedSettings, @@ -215,15 +217,15 @@ class ListAgentsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -234,7 +236,7 @@ class ListAgentsResponse(proto.Message): [Agents.ListAgents][google.cloud.dialogflow.cx.v3.Agents.ListAgents]. Attributes: - agents (Sequence[google.cloud.dialogflowcx_v3.types.Agent]): + agents (MutableSequence[google.cloud.dialogflowcx_v3.types.Agent]): The list of agents. There will be a maximum number of items returned based on the page_size field in the request. next_page_token (str): @@ -247,12 +249,12 @@ class ListAgentsResponse(proto.Message): def raw_page(self): return self - agents = proto.RepeatedField( + agents: MutableSequence["Agent"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Agent", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -268,7 +270,7 @@ class GetAgentRequest(proto.Message): ``projects//locations//agents/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -286,11 +288,11 @@ class CreateAgentRequest(proto.Message): Required. The agent to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - agent = proto.Field( + agent: "Agent" = proto.Field( proto.MESSAGE, number=2, message="Agent", @@ -310,12 +312,12 @@ class UpdateAgentRequest(proto.Message): updated. """ - agent = proto.Field( + agent: "Agent" = proto.Field( proto.MESSAGE, number=1, message="Agent", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -332,7 +334,7 @@ class DeleteAgentRequest(proto.Message): ``projects//locations//agents/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -372,20 +374,20 @@ class DataFormat(proto.Enum): DATA_FORMAT_UNSPECIFIED = 0 BLOB = 1 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - agent_uri = proto.Field( + agent_uri: str = proto.Field( proto.STRING, number=2, ) - data_format = proto.Field( + data_format: DataFormat = proto.Field( proto.ENUM, number=3, enum=DataFormat, ) - environment = proto.Field( + environment: str = proto.Field( proto.STRING, number=5, ) @@ -415,12 +417,12 @@ class ExportAgentResponse(proto.Message): This field is a member of `oneof`_ ``agent``. """ - agent_uri = proto.Field( + agent_uri: str = proto.Field( proto.STRING, number=1, oneof="agent", ) - agent_content = proto.Field( + agent_content: bytes = proto.Field( proto.BYTES, number=2, oneof="agent", @@ -469,21 +471,21 @@ class RestoreOption(proto.Enum): KEEP = 1 FALLBACK = 2 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - agent_uri = proto.Field( + agent_uri: str = proto.Field( proto.STRING, number=2, oneof="agent", ) - agent_content = proto.Field( + agent_content: bytes = proto.Field( proto.BYTES, number=3, oneof="agent", ) - restore_option = proto.Field( + restore_option: RestoreOption = proto.Field( proto.ENUM, number=5, enum=RestoreOption, @@ -503,11 +505,11 @@ class ValidateAgentRequest(proto.Message): language is used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -526,11 +528,11 @@ class GetAgentValidationResultRequest(proto.Message): language is used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -545,15 +547,17 @@ class AgentValidationResult(proto.Message): The unique identifier of the agent validation result. Format: ``projects//locations//agents//validationResult``. - flow_validation_results (Sequence[google.cloud.dialogflowcx_v3.types.FlowValidationResult]): + flow_validation_results (MutableSequence[google.cloud.dialogflowcx_v3.types.FlowValidationResult]): Contains all flow validation results. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - flow_validation_results = proto.RepeatedField( + flow_validation_results: MutableSequence[ + flow.FlowValidationResult + ] = proto.RepeatedField( proto.MESSAGE, number=2, message=flow.FlowValidationResult, diff --git a/google/cloud/dialogflowcx_v3/types/audio_config.py b/google/cloud/dialogflowcx_v3/types/audio_config.py index 0963e098..bc1b299b 100644 --- a/google/cloud/dialogflowcx_v3/types/audio_config.py +++ b/google/cloud/dialogflowcx_v3/types/audio_config.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import duration_pb2 # type: ignore @@ -116,21 +118,21 @@ class SpeechWordInfo(proto.Message): also not rely on it to always be provided. """ - word = proto.Field( + word: str = proto.Field( proto.STRING, number=3, ) - start_offset = proto.Field( + start_offset: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=1, message=duration_pb2.Duration, ) - end_offset = proto.Field( + end_offset: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=2, message=duration_pb2.Duration, ) - confidence = proto.Field( + confidence: float = proto.Field( proto.FLOAT, number=4, ) @@ -157,7 +159,7 @@ class InputAudioConfig(proto.Message): with information about the recognized speech words, e.g. start and end time offsets. If false or unspecified, Speech doesn't return any word-level information. - phrase_hints (Sequence[str]): + phrase_hints (MutableSequence[str]): Optional. A list of strings containing words and phrases that the speech recognizer should recognize with higher likelihood. @@ -192,33 +194,33 @@ class InputAudioConfig(proto.Message): is relevant only for streaming methods. """ - audio_encoding = proto.Field( + audio_encoding: "AudioEncoding" = proto.Field( proto.ENUM, number=1, enum="AudioEncoding", ) - sample_rate_hertz = proto.Field( + sample_rate_hertz: int = proto.Field( proto.INT32, number=2, ) - enable_word_info = proto.Field( + enable_word_info: bool = proto.Field( proto.BOOL, number=13, ) - phrase_hints = proto.RepeatedField( + phrase_hints: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=4, ) - model = proto.Field( + model: str = proto.Field( proto.STRING, number=7, ) - model_variant = proto.Field( + model_variant: "SpeechModelVariant" = proto.Field( proto.ENUM, number=10, enum="SpeechModelVariant", ) - single_utterance = proto.Field( + single_utterance: bool = proto.Field( proto.BOOL, number=8, ) @@ -248,11 +250,11 @@ class VoiceSelectionParams(proto.Message): rather than failing the request. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - ssml_gender = proto.Field( + ssml_gender: "SsmlVoiceGender" = proto.Field( proto.ENUM, number=2, enum="SsmlVoiceGender", @@ -284,7 +286,7 @@ class SynthesizeSpeechConfig(proto.Message): We strongly recommend not to exceed +10 (dB) as there's usually no effective increase in loudness for any value greater than that. - effects_profile_id (Sequence[str]): + effects_profile_id (MutableSequence[str]): Optional. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied @@ -295,23 +297,23 @@ class SynthesizeSpeechConfig(proto.Message): synthesized audio. """ - speaking_rate = proto.Field( + speaking_rate: float = proto.Field( proto.DOUBLE, number=1, ) - pitch = proto.Field( + pitch: float = proto.Field( proto.DOUBLE, number=2, ) - volume_gain_db = proto.Field( + volume_gain_db: float = proto.Field( proto.DOUBLE, number=3, ) - effects_profile_id = proto.RepeatedField( + effects_profile_id: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=5, ) - voice = proto.Field( + voice: "VoiceSelectionParams" = proto.Field( proto.MESSAGE, number=4, message="VoiceSelectionParams", @@ -340,16 +342,16 @@ class OutputAudioConfig(proto.Message): be synthesized. """ - audio_encoding = proto.Field( + audio_encoding: "OutputAudioEncoding" = proto.Field( proto.ENUM, number=1, enum="OutputAudioEncoding", ) - sample_rate_hertz = proto.Field( + sample_rate_hertz: int = proto.Field( proto.INT32, number=2, ) - synthesize_speech_config = proto.Field( + synthesize_speech_config: "SynthesizeSpeechConfig" = proto.Field( proto.MESSAGE, number=3, message="SynthesizeSpeechConfig", diff --git a/google/cloud/dialogflowcx_v3/types/changelog.py b/google/cloud/dialogflowcx_v3/types/changelog.py index deaad346..897655ff 100644 --- a/google/cloud/dialogflowcx_v3/types/changelog.py +++ b/google/cloud/dialogflowcx_v3/types/changelog.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -63,19 +65,19 @@ class ListChangelogsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=3, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=4, ) @@ -86,7 +88,7 @@ class ListChangelogsResponse(proto.Message): [Changelogs.ListChangelogs][google.cloud.dialogflow.cx.v3.Changelogs.ListChangelogs]. Attributes: - changelogs (Sequence[google.cloud.dialogflowcx_v3.types.Changelog]): + changelogs (MutableSequence[google.cloud.dialogflowcx_v3.types.Changelog]): The list of changelogs. There will be a maximum number of items returned based on the page_size field in the request. The changelogs will be ordered by timestamp. @@ -100,12 +102,12 @@ class ListChangelogsResponse(proto.Message): def raw_page(self): return self - changelogs = proto.RepeatedField( + changelogs: MutableSequence["Changelog"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Changelog", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -121,7 +123,7 @@ class GetChangelogRequest(proto.Message): ``projects//locations//agents//changelogs/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -149,31 +151,31 @@ class Changelog(proto.Message): The timestamp of the change. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - user_email = proto.Field( + user_email: str = proto.Field( proto.STRING, number=2, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=7, ) - action = proto.Field( + action: str = proto.Field( proto.STRING, number=11, ) - type_ = proto.Field( + type_: str = proto.Field( proto.STRING, number=8, ) - resource = proto.Field( + resource: str = proto.Field( proto.STRING, number=3, ) - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, diff --git a/google/cloud/dialogflowcx_v3/types/deployment.py b/google/cloud/dialogflowcx_v3/types/deployment.py index e0f75374..0979e40a 100644 --- a/google/cloud/dialogflowcx_v3/types/deployment.py +++ b/google/cloud/dialogflowcx_v3/types/deployment.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -69,7 +71,7 @@ class Result(proto.Message): r"""Result of the deployment. Attributes: - deployment_test_results (Sequence[str]): + deployment_test_results (MutableSequence[str]): Results of test cases running before the deployment. Format: ``projects//locations//agents//testCases//results/``. experiment (str): @@ -80,39 +82,39 @@ class Result(proto.Message): ID>/experiments/. """ - deployment_test_results = proto.RepeatedField( + deployment_test_results: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - experiment = proto.Field( + experiment: str = proto.Field( proto.STRING, number=2, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - flow_version = proto.Field( + flow_version: str = proto.Field( proto.STRING, number=2, ) - state = proto.Field( + state: State = proto.Field( proto.ENUM, number=3, enum=State, ) - result = proto.Field( + result: Result = proto.Field( proto.MESSAGE, number=4, message=Result, ) - start_time = proto.Field( + start_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, ) - end_time = proto.Field( + end_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp, @@ -137,15 +139,15 @@ class ListDeploymentsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -156,7 +158,7 @@ class ListDeploymentsResponse(proto.Message): [Deployments.ListDeployments][google.cloud.dialogflow.cx.v3.Deployments.ListDeployments]. Attributes: - deployments (Sequence[google.cloud.dialogflowcx_v3.types.Deployment]): + deployments (MutableSequence[google.cloud.dialogflowcx_v3.types.Deployment]): The list of deployments. There will be a maximum number of items returned based on the page_size field in the request. The list may in some cases be empty or contain fewer entries @@ -171,12 +173,12 @@ class ListDeploymentsResponse(proto.Message): def raw_page(self): return self - deployments = proto.RepeatedField( + deployments: MutableSequence["Deployment"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Deployment", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -194,7 +196,7 @@ class GetDeploymentRequest(proto.Message): ``projects//locations//agents//environments//deployments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/google/cloud/dialogflowcx_v3/types/entity_type.py b/google/cloud/dialogflowcx_v3/types/entity_type.py index b9c0cfc4..dc5eab6b 100644 --- a/google/cloud/dialogflowcx_v3/types/entity_type.py +++ b/google/cloud/dialogflowcx_v3/types/entity_type.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -79,10 +81,10 @@ class EntityType(proto.Message): auto_expansion_mode (google.cloud.dialogflowcx_v3.types.EntityType.AutoExpansionMode): Indicates whether the entity type can be automatically expanded. - entities (Sequence[google.cloud.dialogflowcx_v3.types.EntityType.Entity]): + entities (MutableSequence[google.cloud.dialogflowcx_v3.types.EntityType.Entity]): The collection of entity entries associated with the entity type. - excluded_phrases (Sequence[google.cloud.dialogflowcx_v3.types.EntityType.ExcludedPhrase]): + excluded_phrases (MutableSequence[google.cloud.dialogflowcx_v3.types.EntityType.ExcludedPhrase]): Collection of exceptional words and phrases that shouldn't be matched. For example, if you have a size entity type with entry ``giant``\ (an adjective), you might consider adding @@ -133,7 +135,7 @@ class Entity(proto.Message): - A string that can contain references to other entity types (with or without aliases). - synonyms (Sequence[str]): + synonyms (MutableSequence[str]): Required. A collection of value synonyms. For example, if the entity type is *vegetable*, and ``value`` is *scallions*, a synonym could be *green onions*. @@ -144,11 +146,11 @@ class Entity(proto.Message): ``value``. """ - value = proto.Field( + value: str = proto.Field( proto.STRING, number=1, ) - synonyms = proto.RepeatedField( + synonyms: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=2, ) @@ -161,44 +163,44 @@ class ExcludedPhrase(proto.Message): Required. The word or phrase to be excluded. """ - value = proto.Field( + value: str = proto.Field( proto.STRING, number=1, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - kind = proto.Field( + kind: Kind = proto.Field( proto.ENUM, number=3, enum=Kind, ) - auto_expansion_mode = proto.Field( + auto_expansion_mode: AutoExpansionMode = proto.Field( proto.ENUM, number=4, enum=AutoExpansionMode, ) - entities = proto.RepeatedField( + entities: MutableSequence[Entity] = proto.RepeatedField( proto.MESSAGE, number=5, message=Entity, ) - excluded_phrases = proto.RepeatedField( + excluded_phrases: MutableSequence[ExcludedPhrase] = proto.RepeatedField( proto.MESSAGE, number=6, message=ExcludedPhrase, ) - enable_fuzzy_extraction = proto.Field( + enable_fuzzy_extraction: bool = proto.Field( proto.BOOL, number=7, ) - redact = proto.Field( + redact: bool = proto.Field( proto.BOOL, number=9, ) @@ -233,19 +235,19 @@ class ListEntityTypesRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=3, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=4, ) @@ -256,7 +258,7 @@ class ListEntityTypesResponse(proto.Message): [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3.EntityTypes.ListEntityTypes]. Attributes: - entity_types (Sequence[google.cloud.dialogflowcx_v3.types.EntityType]): + entity_types (MutableSequence[google.cloud.dialogflowcx_v3.types.EntityType]): The list of entity types. There will be a maximum number of items returned based on the page_size field in the request. next_page_token (str): @@ -269,12 +271,12 @@ class ListEntityTypesResponse(proto.Message): def raw_page(self): return self - entity_types = proto.RepeatedField( + entity_types: MutableSequence["EntityType"] = proto.RepeatedField( proto.MESSAGE, number=1, message="EntityType", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -303,11 +305,11 @@ class GetEntityTypeRequest(proto.Message): before they can be used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -337,16 +339,16 @@ class CreateEntityTypeRequest(proto.Message): before they can be used. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - entity_type = proto.Field( + entity_type: "EntityType" = proto.Field( proto.MESSAGE, number=2, message="EntityType", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -375,16 +377,16 @@ class UpdateEntityTypeRequest(proto.Message): The mask to control which fields get updated. """ - entity_type = proto.Field( + entity_type: "EntityType" = proto.Field( proto.MESSAGE, number=1, message="EntityType", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask, @@ -415,11 +417,11 @@ class DeleteEntityTypeRequest(proto.Message): of the entity type will be removed). """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) diff --git a/google/cloud/dialogflowcx_v3/types/environment.py b/google/cloud/dialogflowcx_v3/types/environment.py index 1560a8d0..eef48ec1 100644 --- a/google/cloud/dialogflowcx_v3/types/environment.py +++ b/google/cloud/dialogflowcx_v3/types/environment.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3.types import test_case @@ -70,7 +72,7 @@ class Environment(proto.Message): environment. The maximum length is 500 characters. If exceeded, the request is rejected. - version_configs (Sequence[google.cloud.dialogflowcx_v3.types.Environment.VersionConfig]): + version_configs (MutableSequence[google.cloud.dialogflowcx_v3.types.Environment.VersionConfig]): Required. A list of configurations for flow versions. You should include version configs for all flows that are reachable from [``Start Flow``][Agent.start_flow] in the @@ -95,7 +97,7 @@ class VersionConfig(proto.Message): ID>/flows//versions/. """ - version = proto.Field( + version: str = proto.Field( proto.STRING, number=1, ) @@ -104,7 +106,7 @@ class TestCasesConfig(proto.Message): r"""The configuration for continuous tests. Attributes: - test_cases (Sequence[str]): + test_cases (MutableSequence[str]): A list of test case names to run. They should be under the same agent. Format of each test case name: ``projects//locations/ /agents//testCases/`` @@ -119,15 +121,15 @@ class TestCasesConfig(proto.Message): false. """ - test_cases = proto.RepeatedField( + test_cases: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - enable_continuous_run = proto.Field( + enable_continuous_run: bool = proto.Field( proto.BOOL, number=2, ) - enable_predeployment_run = proto.Field( + enable_predeployment_run: bool = proto.Field( proto.BOOL, number=3, ) @@ -136,7 +138,7 @@ class WebhookConfig(proto.Message): r"""Configuration for webhooks. Attributes: - webhook_overrides (Sequence[google.cloud.dialogflowcx_v3.types.Webhook]): + webhook_overrides (MutableSequence[google.cloud.dialogflowcx_v3.types.Webhook]): The list of webhooks to override for the agent environment. The webhook must exist in the agent. You can override fields in @@ -145,40 +147,40 @@ class WebhookConfig(proto.Message): [``service_directory``][google.cloud.dialogflow.cx.v3.Webhook.service_directory]. """ - webhook_overrides = proto.RepeatedField( + webhook_overrides: MutableSequence[webhook.Webhook] = proto.RepeatedField( proto.MESSAGE, number=1, message=webhook.Webhook, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - version_configs = proto.RepeatedField( + version_configs: MutableSequence[VersionConfig] = proto.RepeatedField( proto.MESSAGE, number=6, message=VersionConfig, ) - update_time = proto.Field( + update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, ) - test_cases_config = proto.Field( + test_cases_config: TestCasesConfig = proto.Field( proto.MESSAGE, number=7, message=TestCasesConfig, ) - webhook_config = proto.Field( + webhook_config: WebhookConfig = proto.Field( proto.MESSAGE, number=10, message=WebhookConfig, @@ -202,15 +204,15 @@ class ListEnvironmentsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -221,7 +223,7 @@ class ListEnvironmentsResponse(proto.Message): [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3.Environments.ListEnvironments]. Attributes: - environments (Sequence[google.cloud.dialogflowcx_v3.types.Environment]): + environments (MutableSequence[google.cloud.dialogflowcx_v3.types.Environment]): The list of environments. There will be a maximum number of items returned based on the page_size field in the request. The list may in some cases be empty or contain fewer entries @@ -236,12 +238,12 @@ class ListEnvironmentsResponse(proto.Message): def raw_page(self): return self - environments = proto.RepeatedField( + environments: MutableSequence["Environment"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Environment", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -259,7 +261,7 @@ class GetEnvironmentRequest(proto.Message): ``projects//locations//agents//environments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -280,11 +282,11 @@ class CreateEnvironmentRequest(proto.Message): Required. The environment to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - environment = proto.Field( + environment: "Environment" = proto.Field( proto.MESSAGE, number=2, message="Environment", @@ -303,12 +305,12 @@ class UpdateEnvironmentRequest(proto.Message): get updated. """ - environment = proto.Field( + environment: "Environment" = proto.Field( proto.MESSAGE, number=1, message="Environment", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -327,7 +329,7 @@ class DeleteEnvironmentRequest(proto.Message): ``projects//locations//agents//environments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -350,15 +352,15 @@ class LookupEnvironmentHistoryRequest(proto.Message): request. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -369,7 +371,7 @@ class LookupEnvironmentHistoryResponse(proto.Message): [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3.Environments.LookupEnvironmentHistory]. Attributes: - environments (Sequence[google.cloud.dialogflowcx_v3.types.Environment]): + environments (MutableSequence[google.cloud.dialogflowcx_v3.types.Environment]): Represents a list of snapshots for an environment. Time of the snapshots is stored in [``update_time``][google.cloud.dialogflow.cx.v3.Environment.update_time]. @@ -383,12 +385,12 @@ class LookupEnvironmentHistoryResponse(proto.Message): def raw_page(self): return self - environments = proto.RepeatedField( + environments: MutableSequence["Environment"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Environment", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -406,7 +408,7 @@ class ContinuousTestResult(proto.Message): The result of this continuous test run, i.e. whether all the tests in this continuous test run pass or not. - test_case_results (Sequence[str]): + test_case_results (MutableSequence[str]): A list of individual test case results names in this continuous test run. run_time (google.protobuf.timestamp_pb2.Timestamp): @@ -421,20 +423,20 @@ class AggregatedTestResult(proto.Enum): PASSED = 1 FAILED = 2 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - result = proto.Field( + result: AggregatedTestResult = proto.Field( proto.ENUM, number=2, enum=AggregatedTestResult, ) - test_case_results = proto.RepeatedField( + test_case_results: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) - run_time = proto.Field( + run_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, @@ -451,7 +453,7 @@ class RunContinuousTestRequest(proto.Message): ``projects//locations//agents//environments/``. """ - environment = proto.Field( + environment: str = proto.Field( proto.STRING, number=1, ) @@ -466,7 +468,7 @@ class RunContinuousTestResponse(proto.Message): The result for a continuous test run. """ - continuous_test_result = proto.Field( + continuous_test_result: "ContinuousTestResult" = proto.Field( proto.MESSAGE, number=1, message="ContinuousTestResult", @@ -479,11 +481,11 @@ class RunContinuousTestMetadata(proto.Message): long running operation. Attributes: - errors (Sequence[google.cloud.dialogflowcx_v3.types.TestError]): + errors (MutableSequence[google.cloud.dialogflowcx_v3.types.TestError]): The test errors. """ - errors = proto.RepeatedField( + errors: MutableSequence[test_case.TestError] = proto.RepeatedField( proto.MESSAGE, number=1, message=test_case.TestError, @@ -506,15 +508,15 @@ class ListContinuousTestResultsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -524,7 +526,7 @@ class ListContinuousTestResultsResponse(proto.Message): r"""The response message for [Environments.ListTestCaseResults][]. Attributes: - continuous_test_results (Sequence[google.cloud.dialogflowcx_v3.types.ContinuousTestResult]): + continuous_test_results (MutableSequence[google.cloud.dialogflowcx_v3.types.ContinuousTestResult]): The list of continuous test results. next_page_token (str): Token to retrieve the next page of results, @@ -536,12 +538,14 @@ class ListContinuousTestResultsResponse(proto.Message): def raw_page(self): return self - continuous_test_results = proto.RepeatedField( + continuous_test_results: MutableSequence[ + "ContinuousTestResult" + ] = proto.RepeatedField( proto.MESSAGE, number=1, message="ContinuousTestResult", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -560,11 +564,11 @@ class DeployFlowRequest(proto.Message): ``projects//locations//agents// flows//versions/``. """ - environment = proto.Field( + environment: str = proto.Field( proto.STRING, number=1, ) - flow_version = proto.Field( + flow_version: str = proto.Field( proto.STRING, number=2, ) @@ -585,12 +589,12 @@ class DeployFlowResponse(proto.Message): ``projects//locations//agents// environments//deployments/``. """ - environment = proto.Field( + environment: "Environment" = proto.Field( proto.MESSAGE, number=1, message="Environment", ) - deployment = proto.Field( + deployment: str = proto.Field( proto.STRING, number=2, ) @@ -602,11 +606,11 @@ class DeployFlowMetadata(proto.Message): long running operation. Attributes: - test_errors (Sequence[google.cloud.dialogflowcx_v3.types.TestError]): + test_errors (MutableSequence[google.cloud.dialogflowcx_v3.types.TestError]): Errors of running deployment tests. """ - test_errors = proto.RepeatedField( + test_errors: MutableSequence[test_case.TestError] = proto.RepeatedField( proto.MESSAGE, number=1, message=test_case.TestError, diff --git a/google/cloud/dialogflowcx_v3/types/experiment.py b/google/cloud/dialogflowcx_v3/types/experiment.py index e768153e..f25f24a8 100644 --- a/google/cloud/dialogflowcx_v3/types/experiment.py +++ b/google/cloud/dialogflowcx_v3/types/experiment.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import duration_pb2 # type: ignore @@ -96,7 +98,7 @@ class Experiment(proto.Message): enabled, default value and maximum will be 30 days. If auto-rollout is enabled, default value and maximum will be 6 days. - variants_history (Sequence[google.cloud.dialogflowcx_v3.types.VariantsHistory]): + variants_history (MutableSequence[google.cloud.dialogflowcx_v3.types.VariantsHistory]): The history of updates to the experiment variants. """ @@ -128,11 +130,11 @@ class Definition(proto.Message): This field is a member of `oneof`_ ``variants``. """ - condition = proto.Field( + condition: str = proto.Field( proto.STRING, number=1, ) - version_variants = proto.Field( + version_variants: "VersionVariants" = proto.Field( proto.MESSAGE, number=2, oneof="variants", @@ -144,7 +146,7 @@ class Result(proto.Message): optimize and the confidence interval. Attributes: - version_metrics (Sequence[google.cloud.dialogflowcx_v3.types.Experiment.Result.VersionMetrics]): + version_metrics (MutableSequence[google.cloud.dialogflowcx_v3.types.Experiment.Result.VersionMetrics]): Version variants and metrics. last_update_time (google.protobuf.timestamp_pb2.Timestamp): The last time the experiment's stats data was @@ -186,19 +188,19 @@ class ConfidenceInterval(proto.Message): Upper bound of the interval. """ - confidence_level = proto.Field( + confidence_level: float = proto.Field( proto.DOUBLE, number=1, ) - ratio = proto.Field( + ratio: float = proto.Field( proto.DOUBLE, number=2, ) - lower_bound = proto.Field( + lower_bound: float = proto.Field( proto.DOUBLE, number=3, ) - upper_bound = proto.Field( + upper_bound: float = proto.Field( proto.DOUBLE, number=4, ) @@ -233,27 +235,27 @@ class Metric(proto.Message): than all other treatments in the experiment """ - type_ = proto.Field( + type_: "Experiment.Result.MetricType" = proto.Field( proto.ENUM, number=1, enum="Experiment.Result.MetricType", ) - count_type = proto.Field( + count_type: "Experiment.Result.CountType" = proto.Field( proto.ENUM, number=5, enum="Experiment.Result.CountType", ) - ratio = proto.Field( + ratio: float = proto.Field( proto.DOUBLE, number=2, oneof="value", ) - count = proto.Field( + count: float = proto.Field( proto.DOUBLE, number=4, oneof="value", ) - confidence_interval = proto.Field( + confidence_interval: "Experiment.Result.ConfidenceInterval" = proto.Field( proto.MESSAGE, number=3, message="Experiment.Result.ConfidenceInterval", @@ -267,7 +269,7 @@ class VersionMetrics(proto.Message): The name of the flow [Version][google.cloud.dialogflow.cx.v3.Version]. Format: ``projects//locations//agents//flows//versions/``. - metrics (Sequence[google.cloud.dialogflowcx_v3.types.Experiment.Result.Metric]): + metrics (MutableSequence[google.cloud.dialogflowcx_v3.types.Experiment.Result.Metric]): The metrics and corresponding confidence intervals in the inference result. session_count (int): @@ -275,98 +277,100 @@ class VersionMetrics(proto.Message): this version. """ - version = proto.Field( + version: str = proto.Field( proto.STRING, number=1, ) - metrics = proto.RepeatedField( + metrics: MutableSequence["Experiment.Result.Metric"] = proto.RepeatedField( proto.MESSAGE, number=2, message="Experiment.Result.Metric", ) - session_count = proto.Field( + session_count: int = proto.Field( proto.INT32, number=3, ) - version_metrics = proto.RepeatedField( + version_metrics: MutableSequence[ + "Experiment.Result.VersionMetrics" + ] = proto.RepeatedField( proto.MESSAGE, number=1, message="Experiment.Result.VersionMetrics", ) - last_update_time = proto.Field( + last_update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - state = proto.Field( + state: State = proto.Field( proto.ENUM, number=4, enum=State, ) - definition = proto.Field( + definition: Definition = proto.Field( proto.MESSAGE, number=5, message=Definition, ) - rollout_config = proto.Field( + rollout_config: "RolloutConfig" = proto.Field( proto.MESSAGE, number=14, message="RolloutConfig", ) - rollout_state = proto.Field( + rollout_state: "RolloutState" = proto.Field( proto.MESSAGE, number=15, message="RolloutState", ) - rollout_failure_reason = proto.Field( + rollout_failure_reason: str = proto.Field( proto.STRING, number=16, ) - result = proto.Field( + result: Result = proto.Field( proto.MESSAGE, number=6, message=Result, ) - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp, ) - start_time = proto.Field( + start_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=8, message=timestamp_pb2.Timestamp, ) - end_time = proto.Field( + end_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=9, message=timestamp_pb2.Timestamp, ) - last_update_time = proto.Field( + last_update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=10, message=timestamp_pb2.Timestamp, ) - experiment_length = proto.Field( + experiment_length: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=11, message=duration_pb2.Duration, ) - variants_history = proto.RepeatedField( + variants_history: MutableSequence["VariantsHistory"] = proto.RepeatedField( proto.MESSAGE, number=12, message="VariantsHistory", @@ -377,7 +381,7 @@ class VersionVariants(proto.Message): r"""A list of flow version variants. Attributes: - variants (Sequence[google.cloud.dialogflowcx_v3.types.VersionVariants.Variant]): + variants (MutableSequence[google.cloud.dialogflowcx_v3.types.VersionVariants.Variant]): A list of flow version variants. """ @@ -396,20 +400,20 @@ class Variant(proto.Message): Whether the variant is for the control group. """ - version = proto.Field( + version: str = proto.Field( proto.STRING, number=1, ) - traffic_allocation = proto.Field( + traffic_allocation: float = proto.Field( proto.FLOAT, number=2, ) - is_control_group = proto.Field( + is_control_group: bool = proto.Field( proto.BOOL, number=3, ) - variants = proto.RepeatedField( + variants: MutableSequence[Variant] = proto.RepeatedField( proto.MESSAGE, number=1, message=Variant, @@ -430,13 +434,13 @@ class VariantsHistory(proto.Message): Update time of the variants. """ - version_variants = proto.Field( + version_variants: "VersionVariants" = proto.Field( proto.MESSAGE, number=1, oneof="variants", message="VersionVariants", ) - update_time = proto.Field( + update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, @@ -447,7 +451,7 @@ class RolloutConfig(proto.Message): r"""The configuration for auto rollout. Attributes: - rollout_steps (Sequence[google.cloud.dialogflowcx_v3.types.RolloutConfig.RolloutStep]): + rollout_steps (MutableSequence[google.cloud.dialogflowcx_v3.types.RolloutConfig.RolloutStep]): Steps to roll out a flow version. Steps should be sorted by percentage in ascending order. @@ -482,30 +486,30 @@ class RolloutStep(proto.Message): hour. """ - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - traffic_percent = proto.Field( + traffic_percent: int = proto.Field( proto.INT32, number=2, ) - min_duration = proto.Field( + min_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=3, message=duration_pb2.Duration, ) - rollout_steps = proto.RepeatedField( + rollout_steps: MutableSequence[RolloutStep] = proto.RepeatedField( proto.MESSAGE, number=1, message=RolloutStep, ) - rollout_condition = proto.Field( + rollout_condition: str = proto.Field( proto.STRING, number=2, ) - failure_condition = proto.Field( + failure_condition: str = proto.Field( proto.STRING, number=3, ) @@ -525,15 +529,15 @@ class RolloutState(proto.Message): Start time of the current step. """ - step = proto.Field( + step: str = proto.Field( proto.STRING, number=1, ) - step_index = proto.Field( + step_index: int = proto.Field( proto.INT32, number=3, ) - start_time = proto.Field( + start_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, @@ -558,15 +562,15 @@ class ListExperimentsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -577,7 +581,7 @@ class ListExperimentsResponse(proto.Message): [Experiments.ListExperiments][google.cloud.dialogflow.cx.v3.Experiments.ListExperiments]. Attributes: - experiments (Sequence[google.cloud.dialogflowcx_v3.types.Experiment]): + experiments (MutableSequence[google.cloud.dialogflowcx_v3.types.Experiment]): The list of experiments. There will be a maximum number of items returned based on the page_size field in the request. The list may in some cases be empty or contain fewer entries @@ -592,12 +596,12 @@ class ListExperimentsResponse(proto.Message): def raw_page(self): return self - experiments = proto.RepeatedField( + experiments: MutableSequence["Experiment"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Experiment", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -615,7 +619,7 @@ class GetExperimentRequest(proto.Message): ``projects//locations//agents//environments//experiments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -636,11 +640,11 @@ class CreateExperimentRequest(proto.Message): Required. The experiment to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - experiment = proto.Field( + experiment: "Experiment" = proto.Field( proto.MESSAGE, number=2, message="Experiment", @@ -659,12 +663,12 @@ class UpdateExperimentRequest(proto.Message): get updated. """ - experiment = proto.Field( + experiment: "Experiment" = proto.Field( proto.MESSAGE, number=1, message="Experiment", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -683,7 +687,7 @@ class DeleteExperimentRequest(proto.Message): ``projects//locations//agents//environments//experiments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -699,7 +703,7 @@ class StartExperimentRequest(proto.Message): ``projects//locations//agents//environments//experiments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -715,7 +719,7 @@ class StopExperimentRequest(proto.Message): ``projects//locations//agents//environments//experiments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/google/cloud/dialogflowcx_v3/types/flow.py b/google/cloud/dialogflowcx_v3/types/flow.py index 1b0ea02c..13c352bf 100644 --- a/google/cloud/dialogflowcx_v3/types/flow.py +++ b/google/cloud/dialogflowcx_v3/types/flow.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3.types import page @@ -76,16 +78,16 @@ class ModelTrainingMode(proto.Enum): MODEL_TRAINING_MODE_AUTOMATIC = 1 MODEL_TRAINING_MODE_MANUAL = 2 - model_type = proto.Field( + model_type: ModelType = proto.Field( proto.ENUM, number=1, enum=ModelType, ) - classification_threshold = proto.Field( + classification_threshold: float = proto.Field( proto.FLOAT, number=3, ) - model_training_mode = proto.Field( + model_training_mode: ModelTrainingMode = proto.Field( proto.ENUM, number=4, enum=ModelTrainingMode, @@ -121,7 +123,7 @@ class Flow(proto.Message): The description of the flow. The maximum length is 500 characters. If exceeded, the request is rejected. - transition_routes (Sequence[google.cloud.dialogflowcx_v3.types.TransitionRoute]): + transition_routes (MutableSequence[google.cloud.dialogflowcx_v3.types.TransitionRoute]): A flow's transition routes serve two purposes: - They are responsible for matching the user's first @@ -140,7 +142,7 @@ class Flow(proto.Message): TransitionRoutes with intent specified are inherited by pages in the flow. - event_handlers (Sequence[google.cloud.dialogflowcx_v3.types.EventHandler]): + event_handlers (MutableSequence[google.cloud.dialogflowcx_v3.types.EventHandler]): A flow's event handlers serve two purposes: - They are responsible for handling events (e.g. no match, @@ -156,7 +158,7 @@ class Flow(proto.Message): these handlers are evaluated on a first-match basis. The first one that matches the event get executed, with the rest being ignored. - transition_route_groups (Sequence[str]): + transition_route_groups (MutableSequence[str]): A flow's transition route group serve two purposes: - They are responsible for matching the user's first @@ -171,33 +173,33 @@ class Flow(proto.Message): NLU related settings of the flow. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - transition_routes = proto.RepeatedField( + transition_routes: MutableSequence[page.TransitionRoute] = proto.RepeatedField( proto.MESSAGE, number=4, message=page.TransitionRoute, ) - event_handlers = proto.RepeatedField( + event_handlers: MutableSequence[page.EventHandler] = proto.RepeatedField( proto.MESSAGE, number=10, message=page.EventHandler, ) - transition_route_groups = proto.RepeatedField( + transition_route_groups: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=15, ) - nlu_settings = proto.Field( + nlu_settings: "NluSettings" = proto.Field( proto.MESSAGE, number=11, message="NluSettings", @@ -229,16 +231,16 @@ class CreateFlowRequest(proto.Message): before they can be used. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - flow = proto.Field( + flow: "Flow" = proto.Field( proto.MESSAGE, number=2, message="Flow", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -266,11 +268,11 @@ class DeleteFlowRequest(proto.Message): cleared). """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) @@ -306,19 +308,19 @@ class ListFlowsRequest(proto.Message): before they can be used. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=4, ) @@ -329,7 +331,7 @@ class ListFlowsResponse(proto.Message): [Flows.ListFlows][google.cloud.dialogflow.cx.v3.Flows.ListFlows]. Attributes: - flows (Sequence[google.cloud.dialogflowcx_v3.types.Flow]): + flows (MutableSequence[google.cloud.dialogflowcx_v3.types.Flow]): The list of flows. There will be a maximum number of items returned based on the page_size field in the request. next_page_token (str): @@ -342,12 +344,12 @@ class ListFlowsResponse(proto.Message): def raw_page(self): return self - flows = proto.RepeatedField( + flows: MutableSequence["Flow"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Flow", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -377,11 +379,11 @@ class GetFlowRequest(proto.Message): before they can be used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -413,17 +415,17 @@ class UpdateFlowRequest(proto.Message): before they can be used. """ - flow = proto.Field( + flow: "Flow" = proto.Field( proto.MESSAGE, number=1, message="Flow", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -439,7 +441,7 @@ class TrainFlowRequest(proto.Message): ``projects//locations//agents//flows/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -458,11 +460,11 @@ class ValidateFlowRequest(proto.Message): language is used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -481,11 +483,11 @@ class GetFlowValidationResultRequest(proto.Message): language is used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -499,22 +501,24 @@ class FlowValidationResult(proto.Message): name (str): The unique identifier of the flow validation result. Format: ``projects//locations//agents//flows//validationResult``. - validation_messages (Sequence[google.cloud.dialogflowcx_v3.types.ValidationMessage]): + validation_messages (MutableSequence[google.cloud.dialogflowcx_v3.types.ValidationMessage]): Contains all validation messages. update_time (google.protobuf.timestamp_pb2.Timestamp): Last time the flow was validated. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - validation_messages = proto.RepeatedField( + validation_messages: MutableSequence[ + validation_message.ValidationMessage + ] = proto.RepeatedField( proto.MESSAGE, number=2, message=validation_message.ValidationMessage, ) - update_time = proto.Field( + update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, @@ -563,21 +567,21 @@ class ImportOption(proto.Enum): KEEP = 1 FALLBACK = 2 - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - flow_uri = proto.Field( + flow_uri: str = proto.Field( proto.STRING, number=2, oneof="flow", ) - flow_content = proto.Field( + flow_content: bytes = proto.Field( proto.BYTES, number=3, oneof="flow", ) - import_option = proto.Field( + import_option: ImportOption = proto.Field( proto.ENUM, number=4, enum=ImportOption, @@ -594,7 +598,7 @@ class ImportFlowResponse(proto.Message): ``projects//locations//agents//flows/``. """ - flow = proto.Field( + flow: str = proto.Field( proto.STRING, number=1, ) @@ -625,15 +629,15 @@ class ExportFlowRequest(proto.Message): by the specified flow. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - flow_uri = proto.Field( + flow_uri: str = proto.Field( proto.STRING, number=2, ) - include_referenced_flows = proto.Field( + include_referenced_flows: bool = proto.Field( proto.BOOL, number=4, ) @@ -663,12 +667,12 @@ class ExportFlowResponse(proto.Message): This field is a member of `oneof`_ ``flow``. """ - flow_uri = proto.Field( + flow_uri: str = proto.Field( proto.STRING, number=1, oneof="flow", ) - flow_content = proto.Field( + flow_content: bytes = proto.Field( proto.BYTES, number=2, oneof="flow", diff --git a/google/cloud/dialogflowcx_v3/types/fulfillment.py b/google/cloud/dialogflowcx_v3/types/fulfillment.py index b7551a51..f334a394 100644 --- a/google/cloud/dialogflowcx_v3/types/fulfillment.py +++ b/google/cloud/dialogflowcx_v3/types/fulfillment.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3.types import response_message @@ -49,7 +51,7 @@ class Fulfillment(proto.Message): or both. Attributes: - messages (Sequence[google.cloud.dialogflowcx_v3.types.ResponseMessage]): + messages (MutableSequence[google.cloud.dialogflowcx_v3.types.ResponseMessage]): The list of rich message responses to present to the user. webhook (str): @@ -76,10 +78,10 @@ class Fulfillment(proto.Message): the webhook service to identify which fulfillment is being called, but it could be used for other purposes. This field is required if ``webhook`` is specified. - set_parameter_actions (Sequence[google.cloud.dialogflowcx_v3.types.Fulfillment.SetParameterAction]): + set_parameter_actions (MutableSequence[google.cloud.dialogflowcx_v3.types.Fulfillment.SetParameterAction]): Set parameter values before executing the webhook. - conditional_cases (Sequence[google.cloud.dialogflowcx_v3.types.Fulfillment.ConditionalCases]): + conditional_cases (MutableSequence[google.cloud.dialogflowcx_v3.types.Fulfillment.ConditionalCases]): Conditional cases for this fulfillment. """ @@ -94,11 +96,11 @@ class SetParameterAction(proto.Message): clears the parameter. """ - parameter = proto.Field( + parameter: str = proto.Field( proto.STRING, number=1, ) - value = proto.Field( + value: struct_pb2.Value = proto.Field( proto.MESSAGE, number=2, message=struct_pb2.Value, @@ -110,7 +112,7 @@ class ConditionalCases(proto.Message): all the rest ignored. Attributes: - cases (Sequence[google.cloud.dialogflowcx_v3.types.Fulfillment.ConditionalCases.Case]): + cases (MutableSequence[google.cloud.dialogflowcx_v3.types.Fulfillment.ConditionalCases.Case]): A list of cascading if-else conditions. """ @@ -128,7 +130,7 @@ class Case(proto.Message): See the `conditions reference `__. - case_content (Sequence[google.cloud.dialogflowcx_v3.types.Fulfillment.ConditionalCases.Case.CaseContent]): + case_content (MutableSequence[google.cloud.dialogflowcx_v3.types.Fulfillment.ConditionalCases.Case.CaseContent]): A list of case content. """ @@ -154,58 +156,62 @@ class CaseContent(proto.Message): This field is a member of `oneof`_ ``cases_or_message``. """ - message = proto.Field( + message: response_message.ResponseMessage = proto.Field( proto.MESSAGE, number=1, oneof="cases_or_message", message=response_message.ResponseMessage, ) - additional_cases = proto.Field( + additional_cases: "Fulfillment.ConditionalCases" = proto.Field( proto.MESSAGE, number=2, oneof="cases_or_message", message="Fulfillment.ConditionalCases", ) - condition = proto.Field( + condition: str = proto.Field( proto.STRING, number=1, ) - case_content = proto.RepeatedField( + case_content: MutableSequence[ + "Fulfillment.ConditionalCases.Case.CaseContent" + ] = proto.RepeatedField( proto.MESSAGE, number=2, message="Fulfillment.ConditionalCases.Case.CaseContent", ) - cases = proto.RepeatedField( + cases: MutableSequence[ + "Fulfillment.ConditionalCases.Case" + ] = proto.RepeatedField( proto.MESSAGE, number=1, message="Fulfillment.ConditionalCases.Case", ) - messages = proto.RepeatedField( + messages: MutableSequence[response_message.ResponseMessage] = proto.RepeatedField( proto.MESSAGE, number=1, message=response_message.ResponseMessage, ) - webhook = proto.Field( + webhook: str = proto.Field( proto.STRING, number=2, ) - return_partial_responses = proto.Field( + return_partial_responses: bool = proto.Field( proto.BOOL, number=8, ) - tag = proto.Field( + tag: str = proto.Field( proto.STRING, number=3, ) - set_parameter_actions = proto.RepeatedField( + set_parameter_actions: MutableSequence[SetParameterAction] = proto.RepeatedField( proto.MESSAGE, number=4, message=SetParameterAction, ) - conditional_cases = proto.RepeatedField( + conditional_cases: MutableSequence[ConditionalCases] = proto.RepeatedField( proto.MESSAGE, number=5, message=ConditionalCases, diff --git a/google/cloud/dialogflowcx_v3/types/intent.py b/google/cloud/dialogflowcx_v3/types/intent.py index 45a64043..d845a70b 100644 --- a/google/cloud/dialogflowcx_v3/types/intent.py +++ b/google/cloud/dialogflowcx_v3/types/intent.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -62,10 +64,10 @@ class Intent(proto.Message): display_name (str): Required. The human-readable name of the intent, unique within the agent. - training_phrases (Sequence[google.cloud.dialogflowcx_v3.types.Intent.TrainingPhrase]): + training_phrases (MutableSequence[google.cloud.dialogflowcx_v3.types.Intent.TrainingPhrase]): The collection of training phrases the agent is trained on to identify the intent. - parameters (Sequence[google.cloud.dialogflowcx_v3.types.Intent.Parameter]): + parameters (MutableSequence[google.cloud.dialogflowcx_v3.types.Intent.Parameter]): The collection of parameters associated with the intent. priority (int): @@ -87,7 +89,7 @@ class Intent(proto.Message): mistakenly matched, since training phrases assigned to fallback intents act as negative examples that triggers no-match event. - labels (Mapping[str, str]): + labels (MutableMapping[str, str]): The key/value metadata to label an intent. Labels can contain lowercase letters, digits and the symbols '-' and '_'. International characters are allowed, including letters @@ -117,7 +119,7 @@ class TrainingPhrase(proto.Message): id (str): Output only. The unique identifier of the training phrase. - parts (Sequence[google.cloud.dialogflowcx_v3.types.Intent.TrainingPhrase.Part]): + parts (MutableSequence[google.cloud.dialogflowcx_v3.types.Intent.TrainingPhrase.Part]): Required. The ordered list of training phrase parts. The parts are concatenated in order to form the training phrase. @@ -160,25 +162,25 @@ class Part(proto.Message): phrase. """ - text = proto.Field( + text: str = proto.Field( proto.STRING, number=1, ) - parameter_id = proto.Field( + parameter_id: str = proto.Field( proto.STRING, number=2, ) - id = proto.Field( + id: str = proto.Field( proto.STRING, number=1, ) - parts = proto.RepeatedField( + parts: MutableSequence["Intent.TrainingPhrase.Part"] = proto.RepeatedField( proto.MESSAGE, number=2, message="Intent.TrainingPhrase.Part", ) - repeat_count = proto.Field( + repeat_count: int = proto.Field( proto.INT32, number=3, ) @@ -214,55 +216,55 @@ class Parameter(proto.Message): is enabled. """ - id = proto.Field( + id: str = proto.Field( proto.STRING, number=1, ) - entity_type = proto.Field( + entity_type: str = proto.Field( proto.STRING, number=2, ) - is_list = proto.Field( + is_list: bool = proto.Field( proto.BOOL, number=3, ) - redact = proto.Field( + redact: bool = proto.Field( proto.BOOL, number=4, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - training_phrases = proto.RepeatedField( + training_phrases: MutableSequence[TrainingPhrase] = proto.RepeatedField( proto.MESSAGE, number=3, message=TrainingPhrase, ) - parameters = proto.RepeatedField( + parameters: MutableSequence[Parameter] = proto.RepeatedField( proto.MESSAGE, number=4, message=Parameter, ) - priority = proto.Field( + priority: int = proto.Field( proto.INT32, number=5, ) - is_fallback = proto.Field( + is_fallback: bool = proto.Field( proto.BOOL, number=6, ) - labels = proto.MapField( + labels: MutableMapping[str, str] = proto.MapField( proto.STRING, proto.STRING, number=7, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=8, ) @@ -298,24 +300,24 @@ class ListIntentsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) - intent_view = proto.Field( + intent_view: "IntentView" = proto.Field( proto.ENUM, number=5, enum="IntentView", ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=3, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=4, ) @@ -326,7 +328,7 @@ class ListIntentsResponse(proto.Message): [Intents.ListIntents][google.cloud.dialogflow.cx.v3.Intents.ListIntents]. Attributes: - intents (Sequence[google.cloud.dialogflowcx_v3.types.Intent]): + intents (MutableSequence[google.cloud.dialogflowcx_v3.types.Intent]): The list of intents. There will be a maximum number of items returned based on the page_size field in the request. next_page_token (str): @@ -339,12 +341,12 @@ class ListIntentsResponse(proto.Message): def raw_page(self): return self - intents = proto.RepeatedField( + intents: MutableSequence["Intent"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Intent", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -371,11 +373,11 @@ class GetIntentRequest(proto.Message): before they can be used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -403,16 +405,16 @@ class CreateIntentRequest(proto.Message): before they can be used. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - intent = proto.Field( + intent: "Intent" = proto.Field( proto.MESSAGE, number=2, message="Intent", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -441,16 +443,16 @@ class UpdateIntentRequest(proto.Message): updated. """ - intent = proto.Field( + intent: "Intent" = proto.Field( proto.MESSAGE, number=1, message="Intent", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask, @@ -467,7 +469,7 @@ class DeleteIntentRequest(proto.Message): ``projects//locations//agents//intents/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/google/cloud/dialogflowcx_v3/types/page.py b/google/cloud/dialogflowcx_v3/types/page.py index e0c1529a..bf5d7f66 100644 --- a/google/cloud/dialogflowcx_v3/types/page.py +++ b/google/cloud/dialogflowcx_v3/types/page.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3.types import fulfillment @@ -75,7 +77,7 @@ class Page(proto.Message): form (google.cloud.dialogflowcx_v3.types.Form): The form associated with the page, used for collecting parameters relevant to the page. - transition_route_groups (Sequence[str]): + transition_route_groups (MutableSequence[str]): Ordered list of [``TransitionRouteGroups``][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] associated with the page. Transition route groups must be @@ -91,7 +93,7 @@ class Page(proto.Message): takes precedence. Format:\ ``projects//locations//agents//flows//transitionRouteGroups/``. - transition_routes (Sequence[google.cloud.dialogflowcx_v3.types.TransitionRoute]): + transition_routes (MutableSequence[google.cloud.dialogflowcx_v3.types.TransitionRoute]): A list of transitions for the transition rules of this page. They route the conversation to another page in the same flow, or another flow. @@ -113,40 +115,40 @@ class Page(proto.Message): - TransitionRoutes defined in the [transition route groups][google.cloud.dialogflow.cx.v3.Page.transition_route_groups] with only condition specified. - event_handlers (Sequence[google.cloud.dialogflowcx_v3.types.EventHandler]): + event_handlers (MutableSequence[google.cloud.dialogflowcx_v3.types.EventHandler]): Handlers associated with the page to handle events such as webhook errors, no match or no input. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - entry_fulfillment = proto.Field( + entry_fulfillment: fulfillment.Fulfillment = proto.Field( proto.MESSAGE, number=7, message=fulfillment.Fulfillment, ) - form = proto.Field( + form: "Form" = proto.Field( proto.MESSAGE, number=4, message="Form", ) - transition_route_groups = proto.RepeatedField( + transition_route_groups: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=11, ) - transition_routes = proto.RepeatedField( + transition_routes: MutableSequence["TransitionRoute"] = proto.RepeatedField( proto.MESSAGE, number=9, message="TransitionRoute", ) - event_handlers = proto.RepeatedField( + event_handlers: MutableSequence["EventHandler"] = proto.RepeatedField( proto.MESSAGE, number=10, message="EventHandler", @@ -163,7 +165,7 @@ class Form(proto.Message): [session][google.cloud.dialogflow.cx.v3.SessionInfo.parameters]. Attributes: - parameters (Sequence[google.cloud.dialogflowcx_v3.types.Form.Parameter]): + parameters (MutableSequence[google.cloud.dialogflowcx_v3.types.Form.Parameter]): Parameters to collect from the user. """ @@ -217,7 +219,7 @@ class FillBehavior(proto.Message): Required. The fulfillment to provide the initial prompt that the agent can present to the user in order to fill the parameter. - reprompt_event_handlers (Sequence[google.cloud.dialogflowcx_v3.types.EventHandler]): + reprompt_event_handlers (MutableSequence[google.cloud.dialogflowcx_v3.types.EventHandler]): The handlers for parameter-level events, used to provide reprompt for the parameter or transition to a different page/flow. The supported events are: @@ -257,49 +259,51 @@ class FillBehavior(proto.Message): be re-prompted. """ - initial_prompt_fulfillment = proto.Field( + initial_prompt_fulfillment: fulfillment.Fulfillment = proto.Field( proto.MESSAGE, number=3, message=fulfillment.Fulfillment, ) - reprompt_event_handlers = proto.RepeatedField( + reprompt_event_handlers: MutableSequence[ + "EventHandler" + ] = proto.RepeatedField( proto.MESSAGE, number=5, message="EventHandler", ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - required = proto.Field( + required: bool = proto.Field( proto.BOOL, number=2, ) - entity_type = proto.Field( + entity_type: str = proto.Field( proto.STRING, number=3, ) - is_list = proto.Field( + is_list: bool = proto.Field( proto.BOOL, number=4, ) - fill_behavior = proto.Field( + fill_behavior: "Form.Parameter.FillBehavior" = proto.Field( proto.MESSAGE, number=7, message="Form.Parameter.FillBehavior", ) - default_value = proto.Field( + default_value: struct_pb2.Value = proto.Field( proto.MESSAGE, number=9, message=struct_pb2.Value, ) - redact = proto.Field( + redact: bool = proto.Field( proto.BOOL, number=11, ) - parameters = proto.RepeatedField( + parameters: MutableSequence[Parameter] = proto.RepeatedField( proto.MESSAGE, number=1, message=Parameter, @@ -355,25 +359,25 @@ class EventHandler(proto.Message): This field is a member of `oneof`_ ``target``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=6, ) - event = proto.Field( + event: str = proto.Field( proto.STRING, number=4, ) - trigger_fulfillment = proto.Field( + trigger_fulfillment: fulfillment.Fulfillment = proto.Field( proto.MESSAGE, number=5, message=fulfillment.Fulfillment, ) - target_page = proto.Field( + target_page: str = proto.Field( proto.STRING, number=2, oneof="target", ) - target_flow = proto.Field( + target_flow: str = proto.Field( proto.STRING, number=3, oneof="target", @@ -448,29 +452,29 @@ class TransitionRoute(proto.Message): This field is a member of `oneof`_ ``target``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=6, ) - intent = proto.Field( + intent: str = proto.Field( proto.STRING, number=1, ) - condition = proto.Field( + condition: str = proto.Field( proto.STRING, number=2, ) - trigger_fulfillment = proto.Field( + trigger_fulfillment: fulfillment.Fulfillment = proto.Field( proto.MESSAGE, number=3, message=fulfillment.Fulfillment, ) - target_page = proto.Field( + target_page: str = proto.Field( proto.STRING, number=4, oneof="target", ) - target_flow = proto.Field( + target_flow: str = proto.Field( proto.STRING, number=5, oneof="target", @@ -519,19 +523,19 @@ class ListPagesRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=3, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=4, ) @@ -542,7 +546,7 @@ class ListPagesResponse(proto.Message): [Pages.ListPages][google.cloud.dialogflow.cx.v3.Pages.ListPages]. Attributes: - pages (Sequence[google.cloud.dialogflowcx_v3.types.Page]): + pages (MutableSequence[google.cloud.dialogflowcx_v3.types.Page]): The list of pages. There will be a maximum number of items returned based on the page_size field in the request. next_page_token (str): @@ -555,12 +559,12 @@ class ListPagesResponse(proto.Message): def raw_page(self): return self - pages = proto.RepeatedField( + pages: MutableSequence["Page"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Page", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -602,11 +606,11 @@ class GetPageRequest(proto.Message): before they can be used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -649,16 +653,16 @@ class CreatePageRequest(proto.Message): before they can be used. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page = proto.Field( + page: "Page" = proto.Field( proto.MESSAGE, number=2, message="Page", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -702,16 +706,16 @@ class UpdatePageRequest(proto.Message): updated. """ - page = proto.Field( + page: "Page" = proto.Field( proto.MESSAGE, number=1, message="Page", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask, @@ -740,11 +744,11 @@ class DeletePageRequest(proto.Message): cleared). """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) diff --git a/google/cloud/dialogflowcx_v3/types/response_message.py b/google/cloud/dialogflowcx_v3/types/response_message.py index 3554ced6..1057dd56 100644 --- a/google/cloud/dialogflowcx_v3/types/response_message.py +++ b/google/cloud/dialogflowcx_v3/types/response_message.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import struct_pb2 # type: ignore @@ -120,7 +122,7 @@ class Text(proto.Message): r"""The text response message. Attributes: - text (Sequence[str]): + text (MutableSequence[str]): Required. A collection of text responses. allow_playback_interruption (bool): Output only. Whether the playback of this @@ -129,11 +131,11 @@ class Text(proto.Message): Dialogflow request. """ - text = proto.RepeatedField( + text: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - allow_playback_interruption = proto.Field( + allow_playback_interruption: bool = proto.Field( proto.BOOL, number=2, ) @@ -162,7 +164,7 @@ class LiveAgentHandoff(proto.Message): Dialogflow doesn't impose any structure on this. """ - metadata = proto.Field( + metadata: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=1, message=struct_pb2.Struct, @@ -194,7 +196,7 @@ class ConversationSuccess(proto.Message): any structure on this. """ - metadata = proto.Field( + metadata: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=1, message=struct_pb2.Struct, @@ -229,17 +231,17 @@ class OutputAudioText(proto.Message): Dialogflow request. """ - text = proto.Field( + text: str = proto.Field( proto.STRING, number=1, oneof="source", ) - ssml = proto.Field( + ssml: str = proto.Field( proto.STRING, number=2, oneof="source", ) - allow_playback_interruption = proto.Field( + allow_playback_interruption: bool = proto.Field( proto.BOOL, number=3, ) @@ -267,11 +269,11 @@ class PlayAudio(proto.Message): Dialogflow request. """ - audio_uri = proto.Field( + audio_uri: str = proto.Field( proto.STRING, number=1, ) - allow_playback_interruption = proto.Field( + allow_playback_interruption: bool = proto.Field( proto.BOOL, number=2, ) @@ -286,7 +288,7 @@ class MixedAudio(proto.Message): defined by the user. Attributes: - segments (Sequence[google.cloud.dialogflowcx_v3.types.ResponseMessage.MixedAudio.Segment]): + segments (MutableSequence[google.cloud.dialogflowcx_v3.types.ResponseMessage.MixedAudio.Segment]): Segments this audio response is composed of. """ @@ -320,22 +322,24 @@ class Segment(proto.Message): Dialogflow request. """ - audio = proto.Field( + audio: bytes = proto.Field( proto.BYTES, number=1, oneof="content", ) - uri = proto.Field( + uri: str = proto.Field( proto.STRING, number=2, oneof="content", ) - allow_playback_interruption = proto.Field( + allow_playback_interruption: bool = proto.Field( proto.BOOL, number=3, ) - segments = proto.RepeatedField( + segments: MutableSequence[ + "ResponseMessage.MixedAudio.Segment" + ] = proto.RepeatedField( proto.MESSAGE, number=1, message="ResponseMessage.MixedAudio.Segment", @@ -356,61 +360,61 @@ class TelephonyTransferCall(proto.Message): This field is a member of `oneof`_ ``endpoint``. """ - phone_number = proto.Field( + phone_number: str = proto.Field( proto.STRING, number=1, oneof="endpoint", ) - text = proto.Field( + text: Text = proto.Field( proto.MESSAGE, number=1, oneof="message", message=Text, ) - payload = proto.Field( + payload: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=2, oneof="message", message=struct_pb2.Struct, ) - conversation_success = proto.Field( + conversation_success: ConversationSuccess = proto.Field( proto.MESSAGE, number=9, oneof="message", message=ConversationSuccess, ) - output_audio_text = proto.Field( + output_audio_text: OutputAudioText = proto.Field( proto.MESSAGE, number=8, oneof="message", message=OutputAudioText, ) - live_agent_handoff = proto.Field( + live_agent_handoff: LiveAgentHandoff = proto.Field( proto.MESSAGE, number=10, oneof="message", message=LiveAgentHandoff, ) - end_interaction = proto.Field( + end_interaction: EndInteraction = proto.Field( proto.MESSAGE, number=11, oneof="message", message=EndInteraction, ) - play_audio = proto.Field( + play_audio: PlayAudio = proto.Field( proto.MESSAGE, number=12, oneof="message", message=PlayAudio, ) - mixed_audio = proto.Field( + mixed_audio: MixedAudio = proto.Field( proto.MESSAGE, number=13, oneof="message", message=MixedAudio, ) - telephony_transfer_call = proto.Field( + telephony_transfer_call: TelephonyTransferCall = proto.Field( proto.MESSAGE, number=18, oneof="message", diff --git a/google/cloud/dialogflowcx_v3/types/security_settings.py b/google/cloud/dialogflowcx_v3/types/security_settings.py index 5386a0c3..e21d9aee 100644 --- a/google/cloud/dialogflowcx_v3/types/security_settings.py +++ b/google/cloud/dialogflowcx_v3/types/security_settings.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -42,7 +44,7 @@ class GetSecuritySettingsRequest(proto.Message): ``projects//locations//securitySettings/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -62,12 +64,12 @@ class UpdateSecuritySettingsRequest(proto.Message): fields will be updated. """ - security_settings = proto.Field( + security_settings: "SecuritySettings" = proto.Field( proto.MESSAGE, number=1, message="SecuritySettings", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -89,15 +91,15 @@ class ListSecuritySettingsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -107,7 +109,7 @@ class ListSecuritySettingsResponse(proto.Message): r"""The response message for [SecuritySettings.ListSecuritySettings][]. Attributes: - security_settings (Sequence[google.cloud.dialogflowcx_v3.types.SecuritySettings]): + security_settings (MutableSequence[google.cloud.dialogflowcx_v3.types.SecuritySettings]): The list of security settings. next_page_token (str): Token to retrieve the next page of results, @@ -119,12 +121,12 @@ class ListSecuritySettingsResponse(proto.Message): def raw_page(self): return self - security_settings = proto.RepeatedField( + security_settings: MutableSequence["SecuritySettings"] = proto.RepeatedField( proto.MESSAGE, number=1, message="SecuritySettings", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -143,11 +145,11 @@ class CreateSecuritySettingsRequest(proto.Message): Required. The security settings to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - security_settings = proto.Field( + security_settings: "SecuritySettings" = proto.Field( proto.MESSAGE, number=2, message="SecuritySettings", @@ -165,7 +167,7 @@ class DeleteSecuritySettingsRequest(proto.Message): ``projects//locations//securitySettings/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -238,18 +240,16 @@ class SecuritySettings(proto.Message): Note: ``deidentify_template`` must be located in the same region as the ``SecuritySettings``. retention_window_days (int): - Retains data in interaction logging for the - specified number of days. This does not apply to - Cloud logging, which is owned by the user - not - Dialogflow. - User must set a value lower than Dialogflow's - default 365d TTL (time to live). Setting a value - higher than that has no effect. A missing value - or setting to 0 also means we use Dialogflow's - default TTL. + Retains the data for the specified number of + days. User must set a value lower than + Dialogflow's default 365d TTL (30 days for Agent + Assist traffic), higher value will be ignored + and use default. Setting a value higher than + that has no effect. A missing value or setting + to 0 also means we use default TTL. This field is a member of `oneof`_ ``data_retention``. - purge_data_types (Sequence[google.cloud.dialogflowcx_v3.types.SecuritySettings.PurgeDataType]): + purge_data_types (MutableSequence[google.cloud.dialogflowcx_v3.types.SecuritySettings.PurgeDataType]): List of types of data to remove when retention settings triggers purge. audio_export_settings (google.cloud.dialogflowcx_v3.types.SecuritySettings.AudioExportSettings): @@ -330,19 +330,19 @@ class AudioFormat(proto.Enum): MP3 = 2 OGG = 3 - gcs_bucket = proto.Field( + gcs_bucket: str = proto.Field( proto.STRING, number=1, ) - audio_export_pattern = proto.Field( + audio_export_pattern: str = proto.Field( proto.STRING, number=2, ) - enable_audio_redaction = proto.Field( + enable_audio_redaction: bool = proto.Field( proto.BOOL, number=3, ) - audio_format = proto.Field( + audio_format: "SecuritySettings.AudioExportSettings.AudioFormat" = proto.Field( proto.ENUM, number=4, enum="SecuritySettings.AudioExportSettings.AudioFormat", @@ -359,53 +359,53 @@ class InsightsExportSettings(proto.Message): analyzers. """ - enable_insights_export = proto.Field( + enable_insights_export: bool = proto.Field( proto.BOOL, number=1, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - redaction_strategy = proto.Field( + redaction_strategy: RedactionStrategy = proto.Field( proto.ENUM, number=3, enum=RedactionStrategy, ) - redaction_scope = proto.Field( + redaction_scope: RedactionScope = proto.Field( proto.ENUM, number=4, enum=RedactionScope, ) - inspect_template = proto.Field( + inspect_template: str = proto.Field( proto.STRING, number=9, ) - deidentify_template = proto.Field( + deidentify_template: str = proto.Field( proto.STRING, number=17, ) - retention_window_days = proto.Field( + retention_window_days: int = proto.Field( proto.INT32, number=6, oneof="data_retention", ) - purge_data_types = proto.RepeatedField( + purge_data_types: MutableSequence[PurgeDataType] = proto.RepeatedField( proto.ENUM, number=8, enum=PurgeDataType, ) - audio_export_settings = proto.Field( + audio_export_settings: AudioExportSettings = proto.Field( proto.MESSAGE, number=12, message=AudioExportSettings, ) - insights_export_settings = proto.Field( + insights_export_settings: InsightsExportSettings = proto.Field( proto.MESSAGE, number=13, message=InsightsExportSettings, diff --git a/google/cloud/dialogflowcx_v3/types/session.py b/google/cloud/dialogflowcx_v3/types/session.py index 3d1e2f1f..53b562bb 100644 --- a/google/cloud/dialogflowcx_v3/types/session.py +++ b/google/cloud/dialogflowcx_v3/types/session.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3.types import audio_config @@ -83,21 +85,21 @@ class DetectIntentRequest(proto.Message): generate the output audio. """ - session = proto.Field( + session: str = proto.Field( proto.STRING, number=1, ) - query_params = proto.Field( + query_params: "QueryParameters" = proto.Field( proto.MESSAGE, number=2, message="QueryParameters", ) - query_input = proto.Field( + query_input: "QueryInput" = proto.Field( proto.MESSAGE, number=3, message="QueryInput", ) - output_audio_config = proto.Field( + output_audio_config: audio_config.OutputAudioConfig = proto.Field( proto.MESSAGE, number=4, message=audio_config.OutputAudioConfig, @@ -146,30 +148,30 @@ class ResponseType(proto.Enum): PARTIAL = 1 FINAL = 2 - response_id = proto.Field( + response_id: str = proto.Field( proto.STRING, number=1, ) - query_result = proto.Field( + query_result: "QueryResult" = proto.Field( proto.MESSAGE, number=2, message="QueryResult", ) - output_audio = proto.Field( + output_audio: bytes = proto.Field( proto.BYTES, number=4, ) - output_audio_config = proto.Field( + output_audio_config: audio_config.OutputAudioConfig = proto.Field( proto.MESSAGE, number=5, message=audio_config.OutputAudioConfig, ) - response_type = proto.Field( + response_type: ResponseType = proto.Field( proto.ENUM, number=6, enum=ResponseType, ) - allow_cancellation = proto.Field( + allow_cancellation: bool = proto.Field( proto.BOOL, number=7, ) @@ -245,26 +247,26 @@ class StreamingDetectIntentRequest(proto.Message): the agent have been configured to return partial responses. """ - session = proto.Field( + session: str = proto.Field( proto.STRING, number=1, ) - query_params = proto.Field( + query_params: "QueryParameters" = proto.Field( proto.MESSAGE, number=2, message="QueryParameters", ) - query_input = proto.Field( + query_input: "QueryInput" = proto.Field( proto.MESSAGE, number=3, message="QueryInput", ) - output_audio_config = proto.Field( + output_audio_config: audio_config.OutputAudioConfig = proto.Field( proto.MESSAGE, number=4, message=audio_config.OutputAudioConfig, ) - enable_partial_response = proto.Field( + enable_partial_response: bool = proto.Field( proto.BOOL, number=5, ) @@ -318,13 +320,13 @@ class StreamingDetectIntentResponse(proto.Message): This field is a member of `oneof`_ ``response``. """ - recognition_result = proto.Field( + recognition_result: "StreamingRecognitionResult" = proto.Field( proto.MESSAGE, number=1, oneof="response", message="StreamingRecognitionResult", ) - detect_intent_response = proto.Field( + detect_intent_response: "DetectIntentResponse" = proto.Field( proto.MESSAGE, number=2, oneof="response", @@ -407,7 +409,7 @@ class StreamingRecognitionResult(proto.Message): ``is_final = false``. - Otherwise, the value is in (0.0, 1.0] where 0.0 means completely unstable and 1.0 means completely stable. - speech_word_info (Sequence[google.cloud.dialogflowcx_v3.types.SpeechWordInfo]): + speech_word_info (MutableSequence[google.cloud.dialogflowcx_v3.types.SpeechWordInfo]): Word-specific information for the words recognized by Speech in [transcript][google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.transcript]. @@ -427,38 +429,40 @@ class MessageType(proto.Enum): TRANSCRIPT = 1 END_OF_SINGLE_UTTERANCE = 2 - message_type = proto.Field( + message_type: MessageType = proto.Field( proto.ENUM, number=1, enum=MessageType, ) - transcript = proto.Field( + transcript: str = proto.Field( proto.STRING, number=2, ) - is_final = proto.Field( + is_final: bool = proto.Field( proto.BOOL, number=3, ) - confidence = proto.Field( + confidence: float = proto.Field( proto.FLOAT, number=4, ) - stability = proto.Field( + stability: float = proto.Field( proto.FLOAT, number=6, ) - speech_word_info = proto.RepeatedField( + speech_word_info: MutableSequence[ + audio_config.SpeechWordInfo + ] = proto.RepeatedField( proto.MESSAGE, number=7, message=audio_config.SpeechWordInfo, ) - speech_end_offset = proto.Field( + speech_end_offset: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=8, message=duration_pb2.Duration, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=10, ) @@ -476,7 +480,7 @@ class QueryParameters(proto.Message): geo_location (google.type.latlng_pb2.LatLng): The geo location of this conversational query. - session_entity_types (Sequence[google.cloud.dialogflowcx_v3.types.SessionEntityType]): + session_entity_types (MutableSequence[google.cloud.dialogflowcx_v3.types.SessionEntityType]): Additional session entity types to replace or extend developer entity types with. The entity synonyms apply to all languages and persist for @@ -542,7 +546,7 @@ class QueryParameters(proto.Message): Configures whether sentiment analysis should be performed. If not provided, sentiment analysis is not performed. - webhook_headers (Mapping[str, str]): + webhook_headers (MutableMapping[str, str]): This field can be used to pass HTTP headers for a webhook call. These headers will be sent to webhook along with the headers that have been @@ -556,7 +560,7 @@ class QueryParameters(proto.Message): "User-Agent", "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc. - flow_versions (Sequence[str]): + flow_versions (MutableSequence[str]): A list of flow versions to override for the request. Format: ``projects//locations//agents//flows//versions/``. @@ -566,48 +570,50 @@ class QueryParameters(proto.Message): at most one version specified in this list. """ - time_zone = proto.Field( + time_zone: str = proto.Field( proto.STRING, number=1, ) - geo_location = proto.Field( + geo_location: latlng_pb2.LatLng = proto.Field( proto.MESSAGE, number=2, message=latlng_pb2.LatLng, ) - session_entity_types = proto.RepeatedField( + session_entity_types: MutableSequence[ + session_entity_type.SessionEntityType + ] = proto.RepeatedField( proto.MESSAGE, number=3, message=session_entity_type.SessionEntityType, ) - payload = proto.Field( + payload: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=4, message=struct_pb2.Struct, ) - parameters = proto.Field( + parameters: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=5, message=struct_pb2.Struct, ) - current_page = proto.Field( + current_page: str = proto.Field( proto.STRING, number=6, ) - disable_webhook = proto.Field( + disable_webhook: bool = proto.Field( proto.BOOL, number=7, ) - analyze_query_text_sentiment = proto.Field( + analyze_query_text_sentiment: bool = proto.Field( proto.BOOL, number=8, ) - webhook_headers = proto.MapField( + webhook_headers: MutableMapping[str, str] = proto.MapField( proto.STRING, proto.STRING, number=10, ) - flow_versions = proto.RepeatedField( + flow_versions: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=14, ) @@ -659,37 +665,37 @@ class QueryInput(proto.Message): specify the same language. """ - text = proto.Field( + text: "TextInput" = proto.Field( proto.MESSAGE, number=2, oneof="input", message="TextInput", ) - intent = proto.Field( + intent: "IntentInput" = proto.Field( proto.MESSAGE, number=3, oneof="input", message="IntentInput", ) - audio = proto.Field( + audio: "AudioInput" = proto.Field( proto.MESSAGE, number=5, oneof="input", message="AudioInput", ) - event = proto.Field( + event: "EventInput" = proto.Field( proto.MESSAGE, number=6, oneof="input", message="EventInput", ) - dtmf = proto.Field( + dtmf: "DtmfInput" = proto.Field( proto.MESSAGE, number=7, oneof="input", message="DtmfInput", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=4, ) @@ -760,15 +766,15 @@ class QueryResult(proto.Message): - MapValue value: If parameter's entity type is a composite entity then use map from composite entity property names to property values, otherwise, use parameter value. - response_messages (Sequence[google.cloud.dialogflowcx_v3.types.ResponseMessage]): + response_messages (MutableSequence[google.cloud.dialogflowcx_v3.types.ResponseMessage]): The list of rich messages returned to the client. Responses vary from simple text messages to more sophisticated, structured payloads used to drive complex logic. - webhook_statuses (Sequence[google.rpc.status_pb2.Status]): + webhook_statuses (MutableSequence[google.rpc.status_pb2.Status]): The list of webhook call status in the order of call sequence. - webhook_payloads (Sequence[google.protobuf.struct_pb2.Struct]): + webhook_payloads (MutableSequence[google.protobuf.struct_pb2.Struct]): The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3.WebhookResponse.payload], in the order of call sequence. If some webhook call fails or @@ -828,81 +834,83 @@ class QueryResult(proto.Message): specified in the request. """ - text = proto.Field( + text: str = proto.Field( proto.STRING, number=1, oneof="query", ) - trigger_intent = proto.Field( + trigger_intent: str = proto.Field( proto.STRING, number=11, oneof="query", ) - transcript = proto.Field( + transcript: str = proto.Field( proto.STRING, number=12, oneof="query", ) - trigger_event = proto.Field( + trigger_event: str = proto.Field( proto.STRING, number=14, oneof="query", ) - dtmf = proto.Field( + dtmf: "DtmfInput" = proto.Field( proto.MESSAGE, number=23, oneof="query", message="DtmfInput", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) - parameters = proto.Field( + parameters: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=3, message=struct_pb2.Struct, ) - response_messages = proto.RepeatedField( + response_messages: MutableSequence[ + response_message.ResponseMessage + ] = proto.RepeatedField( proto.MESSAGE, number=4, message=response_message.ResponseMessage, ) - webhook_statuses = proto.RepeatedField( + webhook_statuses: MutableSequence[status_pb2.Status] = proto.RepeatedField( proto.MESSAGE, number=13, message=status_pb2.Status, ) - webhook_payloads = proto.RepeatedField( + webhook_payloads: MutableSequence[struct_pb2.Struct] = proto.RepeatedField( proto.MESSAGE, number=6, message=struct_pb2.Struct, ) - current_page = proto.Field( + current_page: page.Page = proto.Field( proto.MESSAGE, number=7, message=page.Page, ) - intent = proto.Field( + intent: gcdc_intent.Intent = proto.Field( proto.MESSAGE, number=8, message=gcdc_intent.Intent, ) - intent_detection_confidence = proto.Field( + intent_detection_confidence: float = proto.Field( proto.FLOAT, number=9, ) - match = proto.Field( + match: "Match" = proto.Field( proto.MESSAGE, number=15, message="Match", ) - diagnostic_info = proto.Field( + diagnostic_info: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=10, message=struct_pb2.Struct, ) - sentiment_analysis_result = proto.Field( + sentiment_analysis_result: "SentimentAnalysisResult" = proto.Field( proto.MESSAGE, number=17, message="SentimentAnalysisResult", @@ -919,7 +927,7 @@ class TextInput(proto.Message): exceed 256 characters. """ - text = proto.Field( + text: str = proto.Field( proto.STRING, number=1, ) @@ -935,7 +943,7 @@ class IntentInput(proto.Message): ``projects//locations//agents//intents/``. """ - intent = proto.Field( + intent: str = proto.Field( proto.STRING, number=1, ) @@ -961,12 +969,12 @@ class AudioInput(proto.Message): ``audio`` must be provided in all following requests. """ - config = proto.Field( + config: audio_config.InputAudioConfig = proto.Field( proto.MESSAGE, number=1, message=audio_config.InputAudioConfig, ) - audio = proto.Field( + audio: bytes = proto.Field( proto.BYTES, number=2, ) @@ -980,7 +988,7 @@ class EventInput(proto.Message): Name of the event. """ - event = proto.Field( + event: str = proto.Field( proto.STRING, number=1, ) @@ -996,11 +1004,11 @@ class DtmfInput(proto.Message): The finish digit (if any). """ - digits = proto.Field( + digits: str = proto.Field( proto.STRING, number=1, ) - finish_digit = proto.Field( + finish_digit: str = proto.Field( proto.STRING, number=2, ) @@ -1070,30 +1078,30 @@ class MatchType(proto.Enum): NO_INPUT = 5 EVENT = 6 - intent = proto.Field( + intent: gcdc_intent.Intent = proto.Field( proto.MESSAGE, number=1, message=gcdc_intent.Intent, ) - event = proto.Field( + event: str = proto.Field( proto.STRING, number=6, ) - parameters = proto.Field( + parameters: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=2, message=struct_pb2.Struct, ) - resolved_input = proto.Field( + resolved_input: str = proto.Field( proto.STRING, number=3, ) - match_type = proto.Field( + match_type: MatchType = proto.Field( proto.ENUM, number=4, enum=MatchType, ) - confidence = proto.Field( + confidence: float = proto.Field( proto.FLOAT, number=5, ) @@ -1123,16 +1131,16 @@ class MatchIntentRequest(proto.Message): Required. The input specification. """ - session = proto.Field( + session: str = proto.Field( proto.STRING, number=1, ) - query_params = proto.Field( + query_params: "QueryParameters" = proto.Field( proto.MESSAGE, number=2, message="QueryParameters", ) - query_input = proto.Field( + query_input: "QueryInput" = proto.Field( proto.MESSAGE, number=3, message="QueryInput", @@ -1176,7 +1184,7 @@ class MatchIntentResponse(proto.Message): event name. This field is a member of `oneof`_ ``query``. - matches (Sequence[google.cloud.dialogflowcx_v3.types.Match]): + matches (MutableSequence[google.cloud.dialogflowcx_v3.types.Match]): Match results, if more than one, ordered descendingly by the confidence we have that the particular intent matches the query. @@ -1186,32 +1194,32 @@ class MatchIntentResponse(proto.Message): but not limited to ``name`` and ``display_name``. """ - text = proto.Field( + text: str = proto.Field( proto.STRING, number=1, oneof="query", ) - trigger_intent = proto.Field( + trigger_intent: str = proto.Field( proto.STRING, number=2, oneof="query", ) - transcript = proto.Field( + transcript: str = proto.Field( proto.STRING, number=3, oneof="query", ) - trigger_event = proto.Field( + trigger_event: str = proto.Field( proto.STRING, number=6, oneof="query", ) - matches = proto.RepeatedField( + matches: MutableSequence["Match"] = proto.RepeatedField( proto.MESSAGE, number=4, message="Match", ) - current_page = proto.Field( + current_page: page.Page = proto.Field( proto.MESSAGE, number=5, message=page.Page, @@ -1232,17 +1240,17 @@ class FulfillIntentRequest(proto.Message): generate output audio. """ - match_intent_request = proto.Field( + match_intent_request: "MatchIntentRequest" = proto.Field( proto.MESSAGE, number=1, message="MatchIntentRequest", ) - match = proto.Field( + match: "Match" = proto.Field( proto.MESSAGE, number=2, message="Match", ) - output_audio_config = proto.Field( + output_audio_config: audio_config.OutputAudioConfig = proto.Field( proto.MESSAGE, number=3, message=audio_config.OutputAudioConfig, @@ -1278,20 +1286,20 @@ class FulfillIntentResponse(proto.Message): generate the output audio. """ - response_id = proto.Field( + response_id: str = proto.Field( proto.STRING, number=1, ) - query_result = proto.Field( + query_result: "QueryResult" = proto.Field( proto.MESSAGE, number=2, message="QueryResult", ) - output_audio = proto.Field( + output_audio: bytes = proto.Field( proto.BYTES, number=3, ) - output_audio_config = proto.Field( + output_audio_config: audio_config.OutputAudioConfig = proto.Field( proto.MESSAGE, number=4, message=audio_config.OutputAudioConfig, @@ -1314,11 +1322,11 @@ class SentimentAnalysisResult(proto.Message): of score (positive or negative). """ - score = proto.Field( + score: float = proto.Field( proto.FLOAT, number=1, ) - magnitude = proto.Field( + magnitude: float = proto.Field( proto.FLOAT, number=2, ) diff --git a/google/cloud/dialogflowcx_v3/types/session_entity_type.py b/google/cloud/dialogflowcx_v3/types/session_entity_type.py index 19f916b6..4dd0bece 100644 --- a/google/cloud/dialogflowcx_v3/types/session_entity_type.py +++ b/google/cloud/dialogflowcx_v3/types/session_entity_type.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3.types import entity_type @@ -63,7 +65,7 @@ class SessionEntityType(proto.Message): Required. Indicates whether the additional data should override or supplement the custom entity type definition. - entities (Sequence[google.cloud.dialogflowcx_v3.types.EntityType.Entity]): + entities (MutableSequence[google.cloud.dialogflowcx_v3.types.EntityType.Entity]): Required. The collection of entities to override or supplement the custom entity type. """ @@ -74,16 +76,16 @@ class EntityOverrideMode(proto.Enum): ENTITY_OVERRIDE_MODE_OVERRIDE = 1 ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - entity_override_mode = proto.Field( + entity_override_mode: EntityOverrideMode = proto.Field( proto.ENUM, number=3, enum=EntityOverrideMode, ) - entities = proto.RepeatedField( + entities: MutableSequence[entity_type.EntityType.Entity] = proto.RepeatedField( proto.MESSAGE, number=4, message=entity_type.EntityType.Entity, @@ -111,15 +113,15 @@ class ListSessionEntityTypesRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -130,7 +132,7 @@ class ListSessionEntityTypesResponse(proto.Message): [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityTypes.ListSessionEntityTypes]. Attributes: - session_entity_types (Sequence[google.cloud.dialogflowcx_v3.types.SessionEntityType]): + session_entity_types (MutableSequence[google.cloud.dialogflowcx_v3.types.SessionEntityType]): The list of session entity types. There will be a maximum number of items returned based on the page_size field in the request. @@ -144,12 +146,12 @@ class ListSessionEntityTypesResponse(proto.Message): def raw_page(self): return self - session_entity_types = proto.RepeatedField( + session_entity_types: MutableSequence["SessionEntityType"] = proto.RepeatedField( proto.MESSAGE, number=1, message="SessionEntityType", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -169,7 +171,7 @@ class GetSessionEntityTypeRequest(proto.Message): 'draft' environment. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -192,11 +194,11 @@ class CreateSessionEntityTypeRequest(proto.Message): Required. The session entity type to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - session_entity_type = proto.Field( + session_entity_type: "SessionEntityType" = proto.Field( proto.MESSAGE, number=2, message="SessionEntityType", @@ -219,12 +221,12 @@ class UpdateSessionEntityTypeRequest(proto.Message): The mask to control which fields get updated. """ - session_entity_type = proto.Field( + session_entity_type: "SessionEntityType" = proto.Field( proto.MESSAGE, number=1, message="SessionEntityType", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -246,7 +248,7 @@ class DeleteSessionEntityTypeRequest(proto.Message): 'draft' environment. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/google/cloud/dialogflowcx_v3/types/test_case.py b/google/cloud/dialogflowcx_v3/types/test_case.py index f86875cc..d20c6bcd 100644 --- a/google/cloud/dialogflowcx_v3/types/test_case.py +++ b/google/cloud/dialogflowcx_v3/types/test_case.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3.types import flow as gcdc_flow @@ -84,7 +86,7 @@ class TestCase(proto.Message): [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3.TestCases.CreateTestCase] will populate the name automatically. Otherwise use format: ``projects//locations//agents/ /testCases/``. - tags (Sequence[str]): + tags (MutableSequence[str]): Tags are short descriptions that users may apply to test cases for organizational and filtering purposes. Each tag should start with @@ -98,7 +100,7 @@ class TestCase(proto.Message): case. Limit of 400 characters. test_config (google.cloud.dialogflowcx_v3.types.TestConfig): Config for the test case. - test_case_conversation_turns (Sequence[google.cloud.dialogflowcx_v3.types.ConversationTurn]): + test_case_conversation_turns (MutableSequence[google.cloud.dialogflowcx_v3.types.ConversationTurn]): The conversation turns uttered when the test case was created, in chronological order. These include the canonical set of agent utterances @@ -110,38 +112,40 @@ class TestCase(proto.Message): The latest test result. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - tags = proto.RepeatedField( + tags: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=2, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=3, ) - notes = proto.Field( + notes: str = proto.Field( proto.STRING, number=4, ) - test_config = proto.Field( + test_config: "TestConfig" = proto.Field( proto.MESSAGE, number=13, message="TestConfig", ) - test_case_conversation_turns = proto.RepeatedField( + test_case_conversation_turns: MutableSequence[ + "ConversationTurn" + ] = proto.RepeatedField( proto.MESSAGE, number=5, message="ConversationTurn", ) - creation_time = proto.Field( + creation_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=10, message=timestamp_pb2.Timestamp, ) - last_test_result = proto.Field( + last_test_result: "TestCaseResult" = proto.Field( proto.MESSAGE, number=12, message="TestCaseResult", @@ -159,7 +163,7 @@ class TestCaseResult(proto.Message): environment (str): Environment where the test was run. If not set, it indicates the draft environment. - conversation_turns (Sequence[google.cloud.dialogflowcx_v3.types.ConversationTurn]): + conversation_turns (MutableSequence[google.cloud.dialogflowcx_v3.types.ConversationTurn]): The conversation turns uttered during the test case replay in chronological order. test_result (google.cloud.dialogflowcx_v3.types.TestResult): @@ -169,25 +173,25 @@ class TestCaseResult(proto.Message): The time that the test was run. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - environment = proto.Field( + environment: str = proto.Field( proto.STRING, number=2, ) - conversation_turns = proto.RepeatedField( + conversation_turns: MutableSequence["ConversationTurn"] = proto.RepeatedField( proto.MESSAGE, number=3, message="ConversationTurn", ) - test_result = proto.Field( + test_result: "TestResult" = proto.Field( proto.ENUM, number=4, enum="TestResult", ) - test_time = proto.Field( + test_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, @@ -198,7 +202,7 @@ class TestConfig(proto.Message): r"""Represents configurations for a test case. Attributes: - tracking_parameters (Sequence[str]): + tracking_parameters (MutableSequence[str]): Session parameters to be compared when calculating differences. flow (str): @@ -222,15 +226,15 @@ class TestConfig(proto.Message): start flow. """ - tracking_parameters = proto.RepeatedField( + tracking_parameters: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - flow = proto.Field( + flow: str = proto.Field( proto.STRING, number=2, ) - page = proto.Field( + page: str = proto.Field( proto.STRING, number=3, ) @@ -270,21 +274,21 @@ class UserInput(proto.Message): Whether sentiment analysis is enabled. """ - input = proto.Field( + input: session.QueryInput = proto.Field( proto.MESSAGE, number=5, message=session.QueryInput, ) - injected_parameters = proto.Field( + injected_parameters: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=2, message=struct_pb2.Struct, ) - is_webhook_enabled = proto.Field( + is_webhook_enabled: bool = proto.Field( proto.BOOL, number=3, ) - enable_sentiment_analysis = proto.Field( + enable_sentiment_analysis: bool = proto.Field( proto.BOOL, number=7, ) @@ -296,7 +300,7 @@ class VirtualAgentOutput(proto.Message): session_parameters (google.protobuf.struct_pb2.Struct): The session parameters available to the bot at this point. - differences (Sequence[google.cloud.dialogflowcx_v3.types.TestRunDifference]): + differences (MutableSequence[google.cloud.dialogflowcx_v3.types.TestRunDifference]): Output only. If this is part of a [result conversation turn][TestCaseResult.conversation_turns], the list of differences between the original run and the replay for this @@ -313,7 +317,7 @@ class VirtualAgentOutput(proto.Message): current_page (google.cloud.dialogflowcx_v3.types.Page): The [Page][google.cloud.dialogflow.cx.v3.Page] on which the utterance was spoken. Only name and displayName will be set. - text_responses (Sequence[google.cloud.dialogflowcx_v3.types.ResponseMessage.Text]): + text_responses (MutableSequence[google.cloud.dialogflowcx_v3.types.ResponseMessage.Text]): The [text][google.cloud.dialogflow.cx.v3.ResponseMessage.Text] responses from the agent for the turn. @@ -322,48 +326,50 @@ class VirtualAgentOutput(proto.Message): result. If set, other output is empty. """ - session_parameters = proto.Field( + session_parameters: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=4, message=struct_pb2.Struct, ) - differences = proto.RepeatedField( + differences: MutableSequence["TestRunDifference"] = proto.RepeatedField( proto.MESSAGE, number=5, message="TestRunDifference", ) - diagnostic_info = proto.Field( + diagnostic_info: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=6, message=struct_pb2.Struct, ) - triggered_intent = proto.Field( + triggered_intent: gcdc_intent.Intent = proto.Field( proto.MESSAGE, number=7, message=gcdc_intent.Intent, ) - current_page = proto.Field( + current_page: gcdc_page.Page = proto.Field( proto.MESSAGE, number=8, message=gcdc_page.Page, ) - text_responses = proto.RepeatedField( + text_responses: MutableSequence[ + response_message.ResponseMessage.Text + ] = proto.RepeatedField( proto.MESSAGE, number=9, message=response_message.ResponseMessage.Text, ) - status = proto.Field( + status: status_pb2.Status = proto.Field( proto.MESSAGE, number=10, message=status_pb2.Status, ) - user_input = proto.Field( + user_input: UserInput = proto.Field( proto.MESSAGE, number=1, message=UserInput, ) - virtual_agent_output = proto.Field( + virtual_agent_output: VirtualAgentOutput = proto.Field( proto.MESSAGE, number=2, message=VirtualAgentOutput, @@ -390,12 +396,12 @@ class DiffType(proto.Enum): PARAMETERS = 3 UTTERANCE = 4 - type_ = proto.Field( + type_: DiffType = proto.Field( proto.ENUM, number=1, enum=DiffType, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=2, ) @@ -408,7 +414,7 @@ class TransitionCoverage(proto.Message): of a parent's test cases. Attributes: - transitions (Sequence[google.cloud.dialogflowcx_v3.types.TransitionCoverage.Transition]): + transitions (MutableSequence[google.cloud.dialogflowcx_v3.types.TransitionCoverage.Transition]): The list of Transitions present in the agent. coverage_score (float): The percent of transitions in the agent that @@ -440,13 +446,13 @@ class TransitionNode(proto.Message): This field is a member of `oneof`_ ``kind``. """ - page = proto.Field( + page: gcdc_page.Page = proto.Field( proto.MESSAGE, number=1, oneof="kind", message=gcdc_page.Page, ) - flow = proto.Field( + flow: gcdc_flow.Flow = proto.Field( proto.MESSAGE, number=2, oneof="kind", @@ -484,43 +490,43 @@ class Transition(proto.Message): This field is a member of `oneof`_ ``detail``. """ - source = proto.Field( + source: "TransitionCoverage.TransitionNode" = proto.Field( proto.MESSAGE, number=1, message="TransitionCoverage.TransitionNode", ) - index = proto.Field( + index: int = proto.Field( proto.INT32, number=4, ) - target = proto.Field( + target: "TransitionCoverage.TransitionNode" = proto.Field( proto.MESSAGE, number=2, message="TransitionCoverage.TransitionNode", ) - covered = proto.Field( + covered: bool = proto.Field( proto.BOOL, number=3, ) - transition_route = proto.Field( + transition_route: gcdc_page.TransitionRoute = proto.Field( proto.MESSAGE, number=5, oneof="detail", message=gcdc_page.TransitionRoute, ) - event_handler = proto.Field( + event_handler: gcdc_page.EventHandler = proto.Field( proto.MESSAGE, number=6, oneof="detail", message=gcdc_page.EventHandler, ) - transitions = proto.RepeatedField( + transitions: MutableSequence[Transition] = proto.RepeatedField( proto.MESSAGE, number=1, message=Transition, ) - coverage_score = proto.Field( + coverage_score: float = proto.Field( proto.FLOAT, number=2, ) @@ -533,7 +539,7 @@ class TransitionRouteGroupCoverage(proto.Message): group. Attributes: - coverages (Sequence[google.cloud.dialogflowcx_v3.types.TransitionRouteGroupCoverage.Coverage]): + coverages (MutableSequence[google.cloud.dialogflowcx_v3.types.TransitionRouteGroupCoverage.Coverage]): Transition route group coverages. coverage_score (float): The percent of transition routes in all the @@ -547,7 +553,7 @@ class Coverage(proto.Message): route_group (google.cloud.dialogflowcx_v3.types.TransitionRouteGroup): Transition route group metadata. Only name and displayName will be set. - transitions (Sequence[google.cloud.dialogflowcx_v3.types.TransitionRouteGroupCoverage.Coverage.Transition]): + transitions (MutableSequence[google.cloud.dialogflowcx_v3.types.TransitionRouteGroupCoverage.Coverage.Transition]): The list of transition routes and coverage in the transition route group. coverage_score (float): @@ -567,37 +573,39 @@ class Transition(proto.Message): cases. """ - transition_route = proto.Field( + transition_route: gcdc_page.TransitionRoute = proto.Field( proto.MESSAGE, number=1, message=gcdc_page.TransitionRoute, ) - covered = proto.Field( + covered: bool = proto.Field( proto.BOOL, number=2, ) - route_group = proto.Field( + route_group: transition_route_group.TransitionRouteGroup = proto.Field( proto.MESSAGE, number=1, message=transition_route_group.TransitionRouteGroup, ) - transitions = proto.RepeatedField( + transitions: MutableSequence[ + "TransitionRouteGroupCoverage.Coverage.Transition" + ] = proto.RepeatedField( proto.MESSAGE, number=2, message="TransitionRouteGroupCoverage.Coverage.Transition", ) - coverage_score = proto.Field( + coverage_score: float = proto.Field( proto.FLOAT, number=3, ) - coverages = proto.RepeatedField( + coverages: MutableSequence[Coverage] = proto.RepeatedField( proto.MESSAGE, number=1, message=Coverage, ) - coverage_score = proto.Field( + coverage_score: float = proto.Field( proto.FLOAT, number=2, ) @@ -609,7 +617,7 @@ class IntentCoverage(proto.Message): test cases. Attributes: - intents (Sequence[google.cloud.dialogflowcx_v3.types.IntentCoverage.Intent]): + intents (MutableSequence[google.cloud.dialogflowcx_v3.types.IntentCoverage.Intent]): The list of Intents present in the agent coverage_score (float): The percent of intents in the agent that are @@ -627,21 +635,21 @@ class Intent(proto.Message): least one of the agent's test cases. """ - intent = proto.Field( + intent: str = proto.Field( proto.STRING, number=1, ) - covered = proto.Field( + covered: bool = proto.Field( proto.BOOL, number=2, ) - intents = proto.RepeatedField( + intents: MutableSequence[Intent] = proto.RepeatedField( proto.MESSAGE, number=1, message=Intent, ) - coverage_score = proto.Field( + coverage_score: float = proto.Field( proto.FLOAT, number=2, ) @@ -666,11 +674,11 @@ class CoverageType(proto.Enum): PAGE_TRANSITION = 2 TRANSITION_ROUTE_GROUP = 3 - agent = proto.Field( + agent: str = proto.Field( proto.STRING, number=3, ) - type_ = proto.Field( + type_: CoverageType = proto.Field( proto.ENUM, number=2, enum=CoverageType, @@ -707,23 +715,23 @@ class CalculateCoverageResponse(proto.Message): This field is a member of `oneof`_ ``coverage_type``. """ - agent = proto.Field( + agent: str = proto.Field( proto.STRING, number=5, ) - intent_coverage = proto.Field( + intent_coverage: "IntentCoverage" = proto.Field( proto.MESSAGE, number=2, oneof="coverage_type", message="IntentCoverage", ) - transition_coverage = proto.Field( + transition_coverage: "TransitionCoverage" = proto.Field( proto.MESSAGE, number=4, oneof="coverage_type", message="TransitionCoverage", ) - route_group_coverage = proto.Field( + route_group_coverage: "TransitionRouteGroupCoverage" = proto.Field( proto.MESSAGE, number=6, oneof="coverage_type", @@ -761,19 +769,19 @@ class TestCaseView(proto.Enum): BASIC = 1 FULL = 2 - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) - view = proto.Field( + view: TestCaseView = proto.Field( proto.ENUM, number=4, enum=TestCaseView, @@ -785,7 +793,7 @@ class ListTestCasesResponse(proto.Message): [TestCases.ListTestCases][google.cloud.dialogflow.cx.v3.TestCases.ListTestCases]. Attributes: - test_cases (Sequence[google.cloud.dialogflowcx_v3.types.TestCase]): + test_cases (MutableSequence[google.cloud.dialogflowcx_v3.types.TestCase]): The list of test cases. There will be a maximum number of items returned based on the page_size field in the request. next_page_token (str): @@ -798,12 +806,12 @@ class ListTestCasesResponse(proto.Message): def raw_page(self): return self - test_cases = proto.RepeatedField( + test_cases: MutableSequence["TestCase"] = proto.RepeatedField( proto.MESSAGE, number=1, message="TestCase", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -817,16 +825,16 @@ class BatchDeleteTestCasesRequest(proto.Message): parent (str): Required. The agent to delete test cases from. Format: ``projects//locations//agents/``. - names (Sequence[str]): + names (MutableSequence[str]): Required. Format of test case names: ``projects//locations/ /agents//testCases/``. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - names = proto.RepeatedField( + names: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) @@ -844,11 +852,11 @@ class CreateTestCaseRequest(proto.Message): Required. The test case to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - test_case = proto.Field( + test_case: "TestCase" = proto.Field( proto.MESSAGE, number=2, message="TestCase", @@ -871,12 +879,12 @@ class UpdateTestCaseRequest(proto.Message): cannot be updated. """ - test_case = proto.Field( + test_case: "TestCase" = proto.Field( proto.MESSAGE, number=1, message="TestCase", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -893,7 +901,7 @@ class GetTestCaseRequest(proto.Message): ``projects//locations//agents//testCases/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -913,11 +921,11 @@ class RunTestCaseRequest(proto.Message): ``projects//locations//agents//environments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - environment = proto.Field( + environment: str = proto.Field( proto.STRING, number=2, ) @@ -932,7 +940,7 @@ class RunTestCaseResponse(proto.Message): The result. """ - result = proto.Field( + result: "TestCaseResult" = proto.Field( proto.MESSAGE, number=2, message="TestCaseResult", @@ -958,20 +966,20 @@ class BatchRunTestCasesRequest(proto.Message): environment (str): Optional. If not set, draft environment is assumed. Format: ``projects//locations//agents//environments/``. - test_cases (Sequence[str]): + test_cases (MutableSequence[str]): Required. Format: ``projects//locations//agents//testCases/``. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - environment = proto.Field( + environment: str = proto.Field( proto.STRING, number=2, ) - test_cases = proto.RepeatedField( + test_cases: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) @@ -982,13 +990,13 @@ class BatchRunTestCasesResponse(proto.Message): [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3.TestCases.BatchRunTestCases]. Attributes: - results (Sequence[google.cloud.dialogflowcx_v3.types.TestCaseResult]): + results (MutableSequence[google.cloud.dialogflowcx_v3.types.TestCaseResult]): The test case results. The detailed [conversation turns][google.cloud.dialogflow.cx.v3.TestCaseResult.conversation_turns] are empty in this response. """ - results = proto.RepeatedField( + results: MutableSequence["TestCaseResult"] = proto.RepeatedField( proto.MESSAGE, number=1, message="TestCaseResult", @@ -1001,11 +1009,11 @@ class BatchRunTestCasesMetadata(proto.Message): long running operation. Attributes: - errors (Sequence[google.cloud.dialogflowcx_v3.types.TestError]): + errors (MutableSequence[google.cloud.dialogflowcx_v3.types.TestError]): The test errors. """ - errors = proto.RepeatedField( + errors: MutableSequence["TestError"] = proto.RepeatedField( proto.MESSAGE, number=1, message="TestError", @@ -1024,16 +1032,16 @@ class TestError(proto.Message): The timestamp when the test was completed. """ - test_case = proto.Field( + test_case: str = proto.Field( proto.STRING, number=1, ) - status = proto.Field( + status: status_pb2.Status = proto.Field( proto.MESSAGE, number=2, message=status_pb2.Status, ) - test_time = proto.Field( + test_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, @@ -1074,16 +1082,16 @@ class ImportTestCasesRequest(proto.Message): This field is a member of `oneof`_ ``source``. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - gcs_uri = proto.Field( + gcs_uri: str = proto.Field( proto.STRING, number=2, oneof="source", ) - content = proto.Field( + content: bytes = proto.Field( proto.BYTES, number=3, oneof="source", @@ -1095,12 +1103,12 @@ class ImportTestCasesResponse(proto.Message): [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3.TestCases.ImportTestCases]. Attributes: - names (Sequence[str]): + names (MutableSequence[str]): The unique identifiers of the new test cases. Format: ``projects//locations//agents//testCases/``. """ - names = proto.RepeatedField( + names: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) @@ -1112,11 +1120,11 @@ class ImportTestCasesMetadata(proto.Message): long running operation. Attributes: - errors (Sequence[google.cloud.dialogflowcx_v3.types.TestCaseError]): + errors (MutableSequence[google.cloud.dialogflowcx_v3.types.TestCaseError]): Errors for failed test cases. """ - errors = proto.RepeatedField( + errors: MutableSequence["TestCaseError"] = proto.RepeatedField( proto.MESSAGE, number=1, message="TestCaseError", @@ -1133,12 +1141,12 @@ class TestCaseError(proto.Message): The status associated with the test case. """ - test_case = proto.Field( + test_case: "TestCase" = proto.Field( proto.MESSAGE, number=1, message="TestCase", ) - status = proto.Field( + status: status_pb2.Status = proto.Field( proto.MESSAGE, number=2, message=status_pb2.Status, @@ -1192,21 +1200,21 @@ class DataFormat(proto.Enum): BLOB = 1 JSON = 2 - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - gcs_uri = proto.Field( + gcs_uri: str = proto.Field( proto.STRING, number=2, oneof="destination", ) - data_format = proto.Field( + data_format: DataFormat = proto.Field( proto.ENUM, number=3, enum=DataFormat, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=4, ) @@ -1236,12 +1244,12 @@ class ExportTestCasesResponse(proto.Message): This field is a member of `oneof`_ ``destination``. """ - gcs_uri = proto.Field( + gcs_uri: str = proto.Field( proto.STRING, number=1, oneof="destination", ) - content = proto.Field( + content: bytes = proto.Field( proto.BYTES, number=2, oneof="destination", @@ -1300,19 +1308,19 @@ class ListTestCaseResultsRequest(proto.Message): 1602540713. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=4, ) @@ -1323,7 +1331,7 @@ class ListTestCaseResultsResponse(proto.Message): [TestCases.ListTestCaseResults][google.cloud.dialogflow.cx.v3.TestCases.ListTestCaseResults]. Attributes: - test_case_results (Sequence[google.cloud.dialogflowcx_v3.types.TestCaseResult]): + test_case_results (MutableSequence[google.cloud.dialogflowcx_v3.types.TestCaseResult]): The list of test case results. next_page_token (str): Token to retrieve the next page of results, @@ -1335,12 +1343,12 @@ class ListTestCaseResultsResponse(proto.Message): def raw_page(self): return self - test_case_results = proto.RepeatedField( + test_case_results: MutableSequence["TestCaseResult"] = proto.RepeatedField( proto.MESSAGE, number=1, message="TestCaseResult", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -1356,7 +1364,7 @@ class GetTestCaseResultRequest(proto.Message): ``projects//locations//agents//testCases//results/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/google/cloud/dialogflowcx_v3/types/transition_route_group.py b/google/cloud/dialogflowcx_v3/types/transition_route_group.py index 05f05e58..96f33960 100644 --- a/google/cloud/dialogflowcx_v3/types/transition_route_group.py +++ b/google/cloud/dialogflowcx_v3/types/transition_route_group.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3.types import page @@ -49,20 +51,20 @@ class TransitionRouteGroup(proto.Message): transition route group, unique within the flow. The display name can be no longer than 30 characters. - transition_routes (Sequence[google.cloud.dialogflowcx_v3.types.TransitionRoute]): + transition_routes (MutableSequence[google.cloud.dialogflowcx_v3.types.TransitionRoute]): Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - transition_routes = proto.RepeatedField( + transition_routes: MutableSequence[page.TransitionRoute] = proto.RepeatedField( proto.MESSAGE, number=5, message=page.TransitionRoute, @@ -100,19 +102,19 @@ class ListTransitionRouteGroupsRequest(proto.Message): before they can be used. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=4, ) @@ -123,7 +125,7 @@ class ListTransitionRouteGroupsResponse(proto.Message): [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.ListTransitionRouteGroups]. Attributes: - transition_route_groups (Sequence[google.cloud.dialogflowcx_v3.types.TransitionRouteGroup]): + transition_route_groups (MutableSequence[google.cloud.dialogflowcx_v3.types.TransitionRouteGroup]): The list of transition route groups. There will be a maximum number of items returned based on the page_size field in the request. The list may in some cases be empty or contain @@ -139,12 +141,14 @@ class ListTransitionRouteGroupsResponse(proto.Message): def raw_page(self): return self - transition_route_groups = proto.RepeatedField( + transition_route_groups: MutableSequence[ + "TransitionRouteGroup" + ] = proto.RepeatedField( proto.MESSAGE, number=1, message="TransitionRouteGroup", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -176,11 +180,11 @@ class GetTransitionRouteGroupRequest(proto.Message): before they can be used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -215,16 +219,16 @@ class CreateTransitionRouteGroupRequest(proto.Message): before they can be used. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - transition_route_group = proto.Field( + transition_route_group: "TransitionRouteGroup" = proto.Field( proto.MESSAGE, number=2, message="TransitionRouteGroup", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -256,17 +260,17 @@ class UpdateTransitionRouteGroupRequest(proto.Message): before they can be used. """ - transition_route_group = proto.Field( + transition_route_group: "TransitionRouteGroup" = proto.Field( proto.MESSAGE, number=1, message="TransitionRouteGroup", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -294,11 +298,11 @@ class DeleteTransitionRouteGroupRequest(proto.Message): transition route group, as well as any reference to it. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) diff --git a/google/cloud/dialogflowcx_v3/types/validation_message.py b/google/cloud/dialogflowcx_v3/types/validation_message.py index 9ae972eb..7ac82a08 100644 --- a/google/cloud/dialogflowcx_v3/types/validation_message.py +++ b/google/cloud/dialogflowcx_v3/types/validation_message.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore @@ -32,10 +34,10 @@ class ValidationMessage(proto.Message): resource_type (google.cloud.dialogflowcx_v3.types.ValidationMessage.ResourceType): The type of the resources where the message is found. - resources (Sequence[str]): + resources (MutableSequence[str]): The names of the resources where the message is found. - resource_names (Sequence[google.cloud.dialogflowcx_v3.types.ResourceName]): + resource_names (MutableSequence[google.cloud.dialogflowcx_v3.types.ResourceName]): The resource names of the resources where the message is found. severity (google.cloud.dialogflowcx_v3.types.ValidationMessage.Severity): @@ -68,26 +70,26 @@ class Severity(proto.Enum): WARNING = 2 ERROR = 3 - resource_type = proto.Field( + resource_type: ResourceType = proto.Field( proto.ENUM, number=1, enum=ResourceType, ) - resources = proto.RepeatedField( + resources: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=2, ) - resource_names = proto.RepeatedField( + resource_names: MutableSequence["ResourceName"] = proto.RepeatedField( proto.MESSAGE, number=6, message="ResourceName", ) - severity = proto.Field( + severity: Severity = proto.Field( proto.ENUM, number=3, enum=Severity, ) - detail = proto.Field( + detail: str = proto.Field( proto.STRING, number=4, ) @@ -103,11 +105,11 @@ class ResourceName(proto.Message): Display name. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) diff --git a/google/cloud/dialogflowcx_v3/types/version.py b/google/cloud/dialogflowcx_v3/types/version.py index c62f091f..5bb0bd7b 100644 --- a/google/cloud/dialogflowcx_v3/types/version.py +++ b/google/cloud/dialogflowcx_v3/types/version.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3.types import flow @@ -48,7 +50,7 @@ class CreateVersionOperationMetadata(proto.Message): ``projects//locations//agents//flows//versions/``. """ - version = proto.Field( + version: str = proto.Field( proto.STRING, number=1, ) @@ -89,29 +91,29 @@ class State(proto.Enum): SUCCEEDED = 2 FAILED = 3 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - nlu_settings = proto.Field( + nlu_settings: flow.NluSettings = proto.Field( proto.MESSAGE, number=4, message=flow.NluSettings, ) - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, ) - state = proto.Field( + state: State = proto.Field( proto.ENUM, number=6, enum=State, @@ -135,15 +137,15 @@ class ListVersionsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -154,7 +156,7 @@ class ListVersionsResponse(proto.Message): [Versions.ListVersions][google.cloud.dialogflow.cx.v3.Versions.ListVersions]. Attributes: - versions (Sequence[google.cloud.dialogflowcx_v3.types.Version]): + versions (MutableSequence[google.cloud.dialogflowcx_v3.types.Version]): A list of versions. There will be a maximum number of items returned based on the page_size field in the request. The list may in some cases be empty or contain fewer entries @@ -169,12 +171,12 @@ class ListVersionsResponse(proto.Message): def raw_page(self): return self - versions = proto.RepeatedField( + versions: MutableSequence["Version"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Version", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -191,7 +193,7 @@ class GetVersionRequest(proto.Message): ``projects//locations//agents//flows//versions/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -211,11 +213,11 @@ class CreateVersionRequest(proto.Message): Required. The version to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - version = proto.Field( + version: "Version" = proto.Field( proto.MESSAGE, number=2, message="Version", @@ -235,12 +237,12 @@ class UpdateVersionRequest(proto.Message): updated. """ - version = proto.Field( + version: "Version" = proto.Field( proto.MESSAGE, number=1, message="Version", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -259,7 +261,7 @@ class DeleteVersionRequest(proto.Message): ``projects//locations//agents//flows//versions/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -283,11 +285,11 @@ class LoadVersionRequest(proto.Message): (i.e. intents, entities, webhooks). """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - allow_override_agent_resources = proto.Field( + allow_override_agent_resources: bool = proto.Field( proto.BOOL, number=2, ) @@ -320,15 +322,15 @@ class CompareVersionsRequest(proto.Message): before they can be used. """ - base_version = proto.Field( + base_version: str = proto.Field( proto.STRING, number=1, ) - target_version = proto.Field( + target_version: str = proto.Field( proto.STRING, number=2, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -349,15 +351,15 @@ class CompareVersionsResponse(proto.Message): The timestamp when the two version compares. """ - base_version_content_json = proto.Field( + base_version_content_json: str = proto.Field( proto.STRING, number=1, ) - target_version_content_json = proto.Field( + target_version_content_json: str = proto.Field( proto.STRING, number=2, ) - compare_time = proto.Field( + compare_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, diff --git a/google/cloud/dialogflowcx_v3/types/webhook.py b/google/cloud/dialogflowcx_v3/types/webhook.py index 71f5df7d..1b56a42c 100644 --- a/google/cloud/dialogflowcx_v3/types/webhook.py +++ b/google/cloud/dialogflowcx_v3/types/webhook.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3.types import response_message @@ -95,10 +97,10 @@ class GenericWebService(proto.Message): The user name for HTTP Basic authentication. password (str): The password for HTTP Basic authentication. - request_headers (Mapping[str, str]): + request_headers (MutableMapping[str, str]): The HTTP request headers to send together with webhook requests. - allowed_ca_certs (Sequence[bytes]): + allowed_ca_certs (MutableSequence[bytes]): Optional. Specifies a list of allowed custom CA certificates (in DER format) for HTTPS verification. This overrides the default SSL trust store. If this is empty or unspecified, @@ -115,24 +117,24 @@ class GenericWebService(proto.Message): -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") """ - uri = proto.Field( + uri: str = proto.Field( proto.STRING, number=1, ) - username = proto.Field( + username: str = proto.Field( proto.STRING, number=2, ) - password = proto.Field( + password: str = proto.Field( proto.STRING, number=3, ) - request_headers = proto.MapField( + request_headers: MutableMapping[str, str] = proto.MapField( proto.STRING, proto.STRING, number=4, ) - allowed_ca_certs = proto.RepeatedField( + allowed_ca_certs: MutableSequence[bytes] = proto.RepeatedField( proto.BYTES, number=5, ) @@ -154,42 +156,42 @@ class ServiceDirectoryConfig(proto.Message): webhook. """ - service = proto.Field( + service: str = proto.Field( proto.STRING, number=1, ) - generic_web_service = proto.Field( + generic_web_service: "Webhook.GenericWebService" = proto.Field( proto.MESSAGE, number=2, message="Webhook.GenericWebService", ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - generic_web_service = proto.Field( + generic_web_service: GenericWebService = proto.Field( proto.MESSAGE, number=4, oneof="webhook", message=GenericWebService, ) - service_directory = proto.Field( + service_directory: ServiceDirectoryConfig = proto.Field( proto.MESSAGE, number=7, oneof="webhook", message=ServiceDirectoryConfig, ) - timeout = proto.Field( + timeout: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=6, message=duration_pb2.Duration, ) - disabled = proto.Field( + disabled: bool = proto.Field( proto.BOOL, number=5, ) @@ -211,15 +213,15 @@ class ListWebhooksRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -230,7 +232,7 @@ class ListWebhooksResponse(proto.Message): [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3.Webhooks.ListWebhooks]. Attributes: - webhooks (Sequence[google.cloud.dialogflowcx_v3.types.Webhook]): + webhooks (MutableSequence[google.cloud.dialogflowcx_v3.types.Webhook]): The list of webhooks. There will be a maximum number of items returned based on the page_size field in the request. next_page_token (str): @@ -243,12 +245,12 @@ class ListWebhooksResponse(proto.Message): def raw_page(self): return self - webhooks = proto.RepeatedField( + webhooks: MutableSequence["Webhook"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Webhook", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -264,7 +266,7 @@ class GetWebhookRequest(proto.Message): ``projects//locations//agents//webhooks/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -282,11 +284,11 @@ class CreateWebhookRequest(proto.Message): Required. The webhook to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - webhook = proto.Field( + webhook: "Webhook" = proto.Field( proto.MESSAGE, number=2, message="Webhook", @@ -306,12 +308,12 @@ class UpdateWebhookRequest(proto.Message): updated. """ - webhook = proto.Field( + webhook: "Webhook" = proto.Field( proto.MESSAGE, number=1, message="Webhook", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -341,11 +343,11 @@ class DeleteWebhookRequest(proto.Message): fulfillments that point to this webhook will be removed). """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) @@ -408,7 +410,7 @@ class WebhookRequest(proto.Message): Information about page status. session_info (google.cloud.dialogflowcx_v3.types.SessionInfo): Information about session status. - messages (Sequence[google.cloud.dialogflowcx_v3.types.ResponseMessage]): + messages (MutableSequence[google.cloud.dialogflowcx_v3.types.ResponseMessage]): The list of rich message responses to present to the user. Webhook can choose to append or replace this list in [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3.WebhookResponse.fulfillment_response]; @@ -436,7 +438,7 @@ class FulfillmentInfo(proto.Message): called, but it could be used for other purposes. """ - tag = proto.Field( + tag: str = proto.Field( proto.STRING, number=1, ) @@ -452,7 +454,7 @@ class IntentInfo(proto.Message): display_name (str): Always present. The display name of the last matched [intent][google.cloud.dialogflow.cx.v3.Intent]. - parameters (Mapping[str, google.cloud.dialogflowcx_v3.types.WebhookRequest.IntentInfo.IntentParameterValue]): + parameters (MutableMapping[str, google.cloud.dialogflowcx_v3.types.WebhookRequest.IntentInfo.IntentParameterValue]): Parameters identified as a result of intent matching. This is a map of the name of the identified parameter to the value of the @@ -477,31 +479,33 @@ class IntentParameterValue(proto.Message): parameter extracted from user utterance. """ - original_value = proto.Field( + original_value: str = proto.Field( proto.STRING, number=1, ) - resolved_value = proto.Field( + resolved_value: struct_pb2.Value = proto.Field( proto.MESSAGE, number=2, message=struct_pb2.Value, ) - last_matched_intent = proto.Field( + last_matched_intent: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=3, ) - parameters = proto.MapField( + parameters: MutableMapping[ + str, "WebhookRequest.IntentInfo.IntentParameterValue" + ] = proto.MapField( proto.STRING, proto.MESSAGE, number=2, message="WebhookRequest.IntentInfo.IntentParameterValue", ) - confidence = proto.Field( + confidence: float = proto.Field( proto.FLOAT, number=4, ) @@ -519,74 +523,74 @@ class SentimentAnalysisResult(proto.Message): of score (positive or negative). """ - score = proto.Field( + score: float = proto.Field( proto.FLOAT, number=1, ) - magnitude = proto.Field( + magnitude: float = proto.Field( proto.FLOAT, number=2, ) - detect_intent_response_id = proto.Field( + detect_intent_response_id: str = proto.Field( proto.STRING, number=1, ) - text = proto.Field( + text: str = proto.Field( proto.STRING, number=10, oneof="query", ) - trigger_intent = proto.Field( + trigger_intent: str = proto.Field( proto.STRING, number=11, oneof="query", ) - transcript = proto.Field( + transcript: str = proto.Field( proto.STRING, number=12, oneof="query", ) - trigger_event = proto.Field( + trigger_event: str = proto.Field( proto.STRING, number=14, oneof="query", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=15, ) - fulfillment_info = proto.Field( + fulfillment_info: FulfillmentInfo = proto.Field( proto.MESSAGE, number=6, message=FulfillmentInfo, ) - intent_info = proto.Field( + intent_info: IntentInfo = proto.Field( proto.MESSAGE, number=3, message=IntentInfo, ) - page_info = proto.Field( + page_info: "PageInfo" = proto.Field( proto.MESSAGE, number=4, message="PageInfo", ) - session_info = proto.Field( + session_info: "SessionInfo" = proto.Field( proto.MESSAGE, number=5, message="SessionInfo", ) - messages = proto.RepeatedField( + messages: MutableSequence[response_message.ResponseMessage] = proto.RepeatedField( proto.MESSAGE, number=7, message=response_message.ResponseMessage, ) - payload = proto.Field( + payload: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=8, message=struct_pb2.Struct, ) - sentiment_analysis_result = proto.Field( + sentiment_analysis_result: SentimentAnalysisResult = proto.Field( proto.MESSAGE, number=9, message=SentimentAnalysisResult, @@ -636,7 +640,7 @@ class FulfillmentResponse(proto.Message): r"""Represents a fulfillment response to the user. Attributes: - messages (Sequence[google.cloud.dialogflowcx_v3.types.ResponseMessage]): + messages (MutableSequence[google.cloud.dialogflowcx_v3.types.ResponseMessage]): The list of rich message responses to present to the user. merge_behavior (google.cloud.dialogflowcx_v3.types.WebhookResponse.FulfillmentResponse.MergeBehavior): @@ -649,43 +653,47 @@ class MergeBehavior(proto.Enum): APPEND = 1 REPLACE = 2 - messages = proto.RepeatedField( + messages: MutableSequence[ + response_message.ResponseMessage + ] = proto.RepeatedField( proto.MESSAGE, number=1, message=response_message.ResponseMessage, ) - merge_behavior = proto.Field( - proto.ENUM, - number=2, - enum="WebhookResponse.FulfillmentResponse.MergeBehavior", + merge_behavior: "WebhookResponse.FulfillmentResponse.MergeBehavior" = ( + proto.Field( + proto.ENUM, + number=2, + enum="WebhookResponse.FulfillmentResponse.MergeBehavior", + ) ) - fulfillment_response = proto.Field( + fulfillment_response: FulfillmentResponse = proto.Field( proto.MESSAGE, number=1, message=FulfillmentResponse, ) - page_info = proto.Field( + page_info: "PageInfo" = proto.Field( proto.MESSAGE, number=2, message="PageInfo", ) - session_info = proto.Field( + session_info: "SessionInfo" = proto.Field( proto.MESSAGE, number=3, message="SessionInfo", ) - payload = proto.Field( + payload: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=4, message=struct_pb2.Struct, ) - target_page = proto.Field( + target_page: str = proto.Field( proto.STRING, number=5, oneof="transition", ) - target_flow = proto.Field( + target_flow: str = proto.Field( proto.STRING, number=6, oneof="transition", @@ -722,7 +730,7 @@ class FormInfo(proto.Message): r"""Represents form information. Attributes: - parameter_info (Sequence[google.cloud.dialogflowcx_v3.types.PageInfo.FormInfo.ParameterInfo]): + parameter_info (MutableSequence[google.cloud.dialogflowcx_v3.types.PageInfo.FormInfo.ParameterInfo]): Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest] and @@ -783,44 +791,46 @@ class ParameterState(proto.Enum): INVALID = 2 FILLED = 3 - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - required = proto.Field( + required: bool = proto.Field( proto.BOOL, number=2, ) - state = proto.Field( + state: "PageInfo.FormInfo.ParameterInfo.ParameterState" = proto.Field( proto.ENUM, number=3, enum="PageInfo.FormInfo.ParameterInfo.ParameterState", ) - value = proto.Field( + value: struct_pb2.Value = proto.Field( proto.MESSAGE, number=4, message=struct_pb2.Value, ) - just_collected = proto.Field( + just_collected: bool = proto.Field( proto.BOOL, number=5, ) - parameter_info = proto.RepeatedField( + parameter_info: MutableSequence[ + "PageInfo.FormInfo.ParameterInfo" + ] = proto.RepeatedField( proto.MESSAGE, number=2, message="PageInfo.FormInfo.ParameterInfo", ) - current_page = proto.Field( + current_page: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=4, ) - form_info = proto.Field( + form_info: FormInfo = proto.Field( proto.MESSAGE, number=3, message=FormInfo, @@ -845,7 +855,7 @@ class SessionInfo(proto.Message): or ``projects//locations//agents//environments//sessions/`` if environment is specified. - parameters (Mapping[str, google.protobuf.struct_pb2.Value]): + parameters (MutableMapping[str, google.protobuf.struct_pb2.Value]): Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3.WebhookRequest]. Optional for @@ -858,11 +868,11 @@ class SessionInfo(proto.Message): The map is keyed by parameters' display names. """ - session = proto.Field( + session: str = proto.Field( proto.STRING, number=1, ) - parameters = proto.MapField( + parameters: MutableMapping[str, struct_pb2.Value] = proto.MapField( proto.STRING, proto.MESSAGE, number=2, diff --git a/google/cloud/dialogflowcx_v3beta1/__init__.py b/google/cloud/dialogflowcx_v3beta1/__init__.py index ab54c15f..065d9620 100644 --- a/google/cloud/dialogflowcx_v3beta1/__init__.py +++ b/google/cloud/dialogflowcx_v3beta1/__init__.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.cloud.dialogflowcx import gapic_version as package_version + +__version__ = package_version.__version__ + from .services.agents import AgentsClient from .services.agents import AgentsAsyncClient diff --git a/google/cloud/dialogflowcx_v3beta1/gapic_version.py b/google/cloud/dialogflowcx_v3beta1/gapic_version.py new file mode 100644 index 00000000..624a2e53 --- /dev/null +++ b/google/cloud/dialogflowcx_v3beta1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# 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. +# +__version__ = "1.14.0" # {x-release-please-version} diff --git a/google/cloud/dialogflowcx_v3beta1/py.typed b/google/cloud/dialogflowcx_v3beta1/py.typed index 60fdca49..e6386621 100644 --- a/google/cloud/dialogflowcx_v3beta1/py.typed +++ b/google/cloud/dialogflowcx_v3beta1/py.typed @@ -1,2 +1,2 @@ # Marker file for PEP 561. -# The google-cloud-dialogflowcx package uses inline types. +# The google-cloud-dialogflow-cx package uses inline types. diff --git a/google/cloud/dialogflowcx_v3beta1/services/agents/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/agents/async_client.py index ea9dcc42..eff9e373 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/agents/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/agents/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -178,9 +189,9 @@ def transport(self) -> AgentsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, AgentsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the agents client. @@ -224,11 +235,11 @@ def __init__( async def list_agents( self, - request: Union[agent.ListAgentsRequest, dict] = None, + request: Optional[Union[agent.ListAgentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListAgentsAsyncPager: r"""Returns the list of all agents in the specified @@ -262,7 +273,7 @@ async def sample_list_agents(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListAgentsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListAgentsRequest, dict]]): The request object. The request message for [Agents.ListAgents][google.cloud.dialogflow.cx.v3beta1.Agents.ListAgents]. parent (:class:`str`): @@ -340,11 +351,11 @@ async def sample_list_agents(): async def get_agent( self, - request: Union[agent.GetAgentRequest, dict] = None, + request: Optional[Union[agent.GetAgentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> agent.Agent: r"""Retrieves the specified agent. @@ -376,7 +387,7 @@ async def sample_get_agent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetAgentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetAgentRequest, dict]]): The request object. The request message for [Agents.GetAgent][google.cloud.dialogflow.cx.v3beta1.Agents.GetAgent]. name (:class:`str`): @@ -454,12 +465,12 @@ async def sample_get_agent(): async def create_agent( self, - request: Union[gcdc_agent.CreateAgentRequest, dict] = None, + request: Optional[Union[gcdc_agent.CreateAgentRequest, dict]] = None, *, - parent: str = None, - agent: gcdc_agent.Agent = None, + parent: Optional[str] = None, + agent: Optional[gcdc_agent.Agent] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_agent.Agent: r"""Creates an agent in the specified location. @@ -501,7 +512,7 @@ async def sample_create_agent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CreateAgentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CreateAgentRequest, dict]]): The request object. The request message for [Agents.CreateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.CreateAgent]. parent (:class:`str`): @@ -586,12 +597,12 @@ async def sample_create_agent(): async def update_agent( self, - request: Union[gcdc_agent.UpdateAgentRequest, dict] = None, + request: Optional[Union[gcdc_agent.UpdateAgentRequest, dict]] = None, *, - agent: gcdc_agent.Agent = None, - update_mask: field_mask_pb2.FieldMask = None, + agent: Optional[gcdc_agent.Agent] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_agent.Agent: r"""Updates the specified agent. @@ -632,7 +643,7 @@ async def sample_update_agent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.UpdateAgentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.UpdateAgentRequest, dict]]): The request object. The request message for [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent]. agent (:class:`google.cloud.dialogflowcx_v3beta1.types.Agent`): @@ -720,11 +731,11 @@ async def sample_update_agent(): async def delete_agent( self, - request: Union[agent.DeleteAgentRequest, dict] = None, + request: Optional[Union[agent.DeleteAgentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified agent. @@ -753,7 +764,7 @@ async def sample_delete_agent(): await client.delete_agent(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.DeleteAgentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.DeleteAgentRequest, dict]]): The request object. The request message for [Agents.DeleteAgent][google.cloud.dialogflow.cx.v3beta1.Agents.DeleteAgent]. name (:class:`str`): @@ -810,10 +821,10 @@ async def sample_delete_agent(): async def export_agent( self, - request: Union[agent.ExportAgentRequest, dict] = None, + request: Optional[Union[agent.ExportAgentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Exports the specified agent to a binary file. @@ -853,13 +864,13 @@ async def sample_export_agent(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ExportAgentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ExportAgentRequest, dict]]): The request object. The request message for [Agents.ExportAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ExportAgent]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -916,10 +927,10 @@ async def sample_export_agent(): async def restore_agent( self, - request: Union[agent.RestoreAgentRequest, dict] = None, + request: Optional[Union[agent.RestoreAgentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Restores the specified agent from a binary file. @@ -968,13 +979,13 @@ async def sample_restore_agent(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.RestoreAgentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.RestoreAgentRequest, dict]]): The request object. The request message for [Agents.RestoreAgent][google.cloud.dialogflow.cx.v3beta1.Agents.RestoreAgent]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1037,10 +1048,10 @@ async def sample_restore_agent(): async def validate_agent( self, - request: Union[agent.ValidateAgentRequest, dict] = None, + request: Optional[Union[agent.ValidateAgentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> agent.AgentValidationResult: r"""Validates the specified agent and creates or updates @@ -1075,7 +1086,7 @@ async def sample_validate_agent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ValidateAgentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ValidateAgentRequest, dict]]): The request object. The request message for [Agents.ValidateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.ValidateAgent]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1120,11 +1131,11 @@ async def sample_validate_agent(): async def get_agent_validation_result( self, - request: Union[agent.GetAgentValidationResultRequest, dict] = None, + request: Optional[Union[agent.GetAgentValidationResultRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> agent.AgentValidationResult: r"""Gets the latest agent validation result. Agent @@ -1157,7 +1168,7 @@ async def sample_get_agent_validation_result(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetAgentValidationResultRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetAgentValidationResultRequest, dict]]): The request object. The request message for [Agents.GetAgentValidationResult][google.cloud.dialogflow.cx.v3beta1.Agents.GetAgentValidationResult]. name (:class:`str`): @@ -1223,10 +1234,10 @@ async def sample_get_agent_validation_result(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1277,10 +1288,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1331,10 +1342,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1385,10 +1396,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1439,10 +1450,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1498,14 +1509,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("AgentsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/agents/client.py b/google/cloud/dialogflowcx_v3beta1/services/agents/client.py index efb2f79c..963efe33 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/agents/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/agents/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -65,7 +77,7 @@ class AgentsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[AgentsTransport]: """Returns an appropriate transport class. @@ -458,8 +470,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, AgentsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, AgentsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the agents client. @@ -473,7 +485,7 @@ def __init__( transport (Union[str, AgentsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -503,6 +515,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -555,11 +568,11 @@ def __init__( def list_agents( self, - request: Union[agent.ListAgentsRequest, dict] = None, + request: Optional[Union[agent.ListAgentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListAgentsPager: r"""Returns the list of all agents in the specified @@ -671,11 +684,11 @@ def sample_list_agents(): def get_agent( self, - request: Union[agent.GetAgentRequest, dict] = None, + request: Optional[Union[agent.GetAgentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> agent.Agent: r"""Retrieves the specified agent. @@ -785,12 +798,12 @@ def sample_get_agent(): def create_agent( self, - request: Union[gcdc_agent.CreateAgentRequest, dict] = None, + request: Optional[Union[gcdc_agent.CreateAgentRequest, dict]] = None, *, - parent: str = None, - agent: gcdc_agent.Agent = None, + parent: Optional[str] = None, + agent: Optional[gcdc_agent.Agent] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_agent.Agent: r"""Creates an agent in the specified location. @@ -917,12 +930,12 @@ def sample_create_agent(): def update_agent( self, - request: Union[gcdc_agent.UpdateAgentRequest, dict] = None, + request: Optional[Union[gcdc_agent.UpdateAgentRequest, dict]] = None, *, - agent: gcdc_agent.Agent = None, - update_mask: field_mask_pb2.FieldMask = None, + agent: Optional[gcdc_agent.Agent] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_agent.Agent: r"""Updates the specified agent. @@ -1051,11 +1064,11 @@ def sample_update_agent(): def delete_agent( self, - request: Union[agent.DeleteAgentRequest, dict] = None, + request: Optional[Union[agent.DeleteAgentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified agent. @@ -1141,10 +1154,10 @@ def sample_delete_agent(): def export_agent( self, - request: Union[agent.ExportAgentRequest, dict] = None, + request: Optional[Union[agent.ExportAgentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Exports the specified agent to a binary file. @@ -1248,10 +1261,10 @@ def sample_export_agent(): def restore_agent( self, - request: Union[agent.RestoreAgentRequest, dict] = None, + request: Optional[Union[agent.RestoreAgentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Restores the specified agent from a binary file. @@ -1370,10 +1383,10 @@ def sample_restore_agent(): def validate_agent( self, - request: Union[agent.ValidateAgentRequest, dict] = None, + request: Optional[Union[agent.ValidateAgentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> agent.AgentValidationResult: r"""Validates the specified agent and creates or updates @@ -1454,11 +1467,11 @@ def sample_validate_agent(): def get_agent_validation_result( self, - request: Union[agent.GetAgentValidationResultRequest, dict] = None, + request: Optional[Union[agent.GetAgentValidationResultRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> agent.AgentValidationResult: r"""Gets the latest agent validation result. Agent @@ -1572,10 +1585,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1626,10 +1639,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1680,10 +1693,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1734,10 +1747,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1788,10 +1801,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1841,14 +1854,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("AgentsClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/agents/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/agents/transports/base.py index 9a4571e1..a38c1daa 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/agents/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/agents/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class AgentsTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/agents/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/agents/transports/grpc.py index 65d597d2..af2bf165 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/agents/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/agents/transports/grpc.py @@ -54,14 +54,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -189,8 +189,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/agents/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/agents/transports/grpc_asyncio.py index 2b7f40bf..760c4a14 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/agents/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/agents/transports/grpc_asyncio.py @@ -56,7 +56,7 @@ class AgentsGrpcAsyncIOTransport(AgentsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -99,15 +99,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/changelogs/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/changelogs/async_client.py index 8e99d1b0..4595ed24 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/changelogs/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/changelogs/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -157,9 +168,9 @@ def transport(self) -> ChangelogsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, ChangelogsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the changelogs client. @@ -203,11 +214,11 @@ def __init__( async def list_changelogs( self, - request: Union[changelog.ListChangelogsRequest, dict] = None, + request: Optional[Union[changelog.ListChangelogsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListChangelogsAsyncPager: r"""Returns the list of Changelogs. @@ -240,7 +251,7 @@ async def sample_list_changelogs(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListChangelogsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListChangelogsRequest, dict]]): The request object. The request message for [Changelogs.ListChangelogs][google.cloud.dialogflow.cx.v3beta1.Changelogs.ListChangelogs]. parent (:class:`str`): @@ -318,11 +329,11 @@ async def sample_list_changelogs(): async def get_changelog( self, - request: Union[changelog.GetChangelogRequest, dict] = None, + request: Optional[Union[changelog.GetChangelogRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> changelog.Changelog: r"""Retrieves the specified Changelog. @@ -354,7 +365,7 @@ async def sample_get_changelog(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetChangelogRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetChangelogRequest, dict]]): The request object. The request message for [Changelogs.GetChangelog][google.cloud.dialogflow.cx.v3beta1.Changelogs.GetChangelog]. name (:class:`str`): @@ -420,10 +431,10 @@ async def sample_get_changelog(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -474,10 +485,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -528,10 +539,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -582,10 +593,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -636,10 +647,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -695,14 +706,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ChangelogsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/changelogs/client.py b/google/cloud/dialogflowcx_v3beta1/services/changelogs/client.py index 99bbd63f..dd9543ea 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/changelogs/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/changelogs/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -58,7 +70,7 @@ class ChangelogsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[ChangelogsTransport]: """Returns an appropriate transport class. @@ -337,8 +349,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, ChangelogsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, ChangelogsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the changelogs client. @@ -352,7 +364,7 @@ def __init__( transport (Union[str, ChangelogsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -382,6 +394,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -434,11 +447,11 @@ def __init__( def list_changelogs( self, - request: Union[changelog.ListChangelogsRequest, dict] = None, + request: Optional[Union[changelog.ListChangelogsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListChangelogsPager: r"""Returns the list of Changelogs. @@ -549,11 +562,11 @@ def sample_list_changelogs(): def get_changelog( self, - request: Union[changelog.GetChangelogRequest, dict] = None, + request: Optional[Union[changelog.GetChangelogRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> changelog.Changelog: r"""Retrieves the specified Changelog. @@ -664,10 +677,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -718,10 +731,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -772,10 +785,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -826,10 +839,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -880,10 +893,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -933,14 +946,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ChangelogsClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/base.py index 8f4c8894..aae1f2c2 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -29,14 +30,9 @@ from google.cloud.location import locations_pb2 # type: ignore from google.longrunning import operations_pb2 -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ChangelogsTransport(abc.ABC): @@ -53,7 +49,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/grpc.py index 12cc8dfc..a4224cb2 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/grpc.py @@ -50,14 +50,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -184,8 +184,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/grpc_asyncio.py index ae4246c1..5d354fbc 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/changelogs/transports/grpc_asyncio.py @@ -52,7 +52,7 @@ class ChangelogsGrpcAsyncIOTransport(ChangelogsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -95,15 +95,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/deployments/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/deployments/async_client.py index bdd03197..e79a0657 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/deployments/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/deployments/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -167,9 +178,9 @@ def transport(self) -> DeploymentsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, DeploymentsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the deployments client. @@ -213,11 +224,11 @@ def __init__( async def list_deployments( self, - request: Union[deployment.ListDeploymentsRequest, dict] = None, + request: Optional[Union[deployment.ListDeploymentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListDeploymentsAsyncPager: r"""Returns the list of all deployments in the specified @@ -251,7 +262,7 @@ async def sample_list_deployments(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListDeploymentsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListDeploymentsRequest, dict]]): The request object. The request message for [Deployments.ListDeployments][google.cloud.dialogflow.cx.v3beta1.Deployments.ListDeployments]. parent (:class:`str`): @@ -331,11 +342,11 @@ async def sample_list_deployments(): async def get_deployment( self, - request: Union[deployment.GetDeploymentRequest, dict] = None, + request: Optional[Union[deployment.GetDeploymentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> deployment.Deployment: r"""Retrieves the specified @@ -368,7 +379,7 @@ async def sample_get_deployment(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetDeploymentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetDeploymentRequest, dict]]): The request object. The request message for [Deployments.GetDeployment][google.cloud.dialogflow.cx.v3beta1.Deployments.GetDeployment]. name (:class:`str`): @@ -441,10 +452,10 @@ async def sample_get_deployment(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -495,10 +506,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -549,10 +560,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -603,10 +614,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -657,10 +668,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -716,14 +727,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DeploymentsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/deployments/client.py b/google/cloud/dialogflowcx_v3beta1/services/deployments/client.py index 20c3187a..82120bd2 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/deployments/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/deployments/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -58,7 +70,7 @@ class DeploymentsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[DeploymentsTransport]: """Returns an appropriate transport class. @@ -417,8 +429,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, DeploymentsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, DeploymentsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the deployments client. @@ -432,7 +444,7 @@ def __init__( transport (Union[str, DeploymentsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -462,6 +474,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -514,11 +527,11 @@ def __init__( def list_deployments( self, - request: Union[deployment.ListDeploymentsRequest, dict] = None, + request: Optional[Union[deployment.ListDeploymentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListDeploymentsPager: r"""Returns the list of all deployments in the specified @@ -632,11 +645,11 @@ def sample_list_deployments(): def get_deployment( self, - request: Union[deployment.GetDeploymentRequest, dict] = None, + request: Optional[Union[deployment.GetDeploymentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> deployment.Deployment: r"""Retrieves the specified @@ -755,10 +768,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -809,10 +822,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -863,10 +876,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -917,10 +930,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -971,10 +984,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1024,14 +1037,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("DeploymentsClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/base.py index 447317d0..1ab2d5a4 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -29,14 +30,9 @@ from google.cloud.location import locations_pb2 # type: ignore from google.longrunning import operations_pb2 -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class DeploymentsTransport(abc.ABC): @@ -53,7 +49,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/grpc.py index 7658cf32..272083ae 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/grpc.py @@ -50,14 +50,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -184,8 +184,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/grpc_asyncio.py index 27ba536d..39e6a21b 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/deployments/transports/grpc_asyncio.py @@ -52,7 +52,7 @@ class DeploymentsGrpcAsyncIOTransport(DeploymentsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -95,15 +95,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/entity_types/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/entity_types/async_client.py index 45214792..cc6bf083 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/entity_types/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/entity_types/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -160,9 +171,9 @@ def transport(self) -> EntityTypesTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, EntityTypesTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the entity types client. @@ -206,11 +217,11 @@ def __init__( async def list_entity_types( self, - request: Union[entity_type.ListEntityTypesRequest, dict] = None, + request: Optional[Union[entity_type.ListEntityTypesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEntityTypesAsyncPager: r"""Returns the list of all entity types in the specified @@ -244,7 +255,7 @@ async def sample_list_entity_types(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListEntityTypesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListEntityTypesRequest, dict]]): The request object. The request message for [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes]. parent (:class:`str`): @@ -323,11 +334,11 @@ async def sample_list_entity_types(): async def get_entity_type( self, - request: Union[entity_type.GetEntityTypeRequest, dict] = None, + request: Optional[Union[entity_type.GetEntityTypeRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> entity_type.EntityType: r"""Retrieves the specified entity type. @@ -359,7 +370,7 @@ async def sample_get_entity_type(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetEntityTypeRequest, dict]]): The request object. The request message for [EntityTypes.GetEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.GetEntityType]. name (:class:`str`): @@ -457,12 +468,12 @@ async def sample_get_entity_type(): async def create_entity_type( self, - request: Union[gcdc_entity_type.CreateEntityTypeRequest, dict] = None, + request: Optional[Union[gcdc_entity_type.CreateEntityTypeRequest, dict]] = None, *, - parent: str = None, - entity_type: gcdc_entity_type.EntityType = None, + parent: Optional[str] = None, + entity_type: Optional[gcdc_entity_type.EntityType] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_entity_type.EntityType: r"""Creates an entity type in the specified agent. @@ -499,7 +510,7 @@ async def sample_create_entity_type(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CreateEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CreateEntityTypeRequest, dict]]): The request object. The request message for [EntityTypes.CreateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.CreateEntityType]. parent (:class:`str`): @@ -604,12 +615,12 @@ async def sample_create_entity_type(): async def update_entity_type( self, - request: Union[gcdc_entity_type.UpdateEntityTypeRequest, dict] = None, + request: Optional[Union[gcdc_entity_type.UpdateEntityTypeRequest, dict]] = None, *, - entity_type: gcdc_entity_type.EntityType = None, - update_mask: field_mask_pb2.FieldMask = None, + entity_type: Optional[gcdc_entity_type.EntityType] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_entity_type.EntityType: r"""Updates the specified entity type. @@ -649,7 +660,7 @@ async def sample_update_entity_type(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.UpdateEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.UpdateEntityTypeRequest, dict]]): The request object. The request message for [EntityTypes.UpdateEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.UpdateEntityType]. entity_type (:class:`google.cloud.dialogflowcx_v3beta1.types.EntityType`): @@ -756,11 +767,11 @@ async def sample_update_entity_type(): async def delete_entity_type( self, - request: Union[entity_type.DeleteEntityTypeRequest, dict] = None, + request: Optional[Union[entity_type.DeleteEntityTypeRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified entity type. @@ -793,7 +804,7 @@ async def sample_delete_entity_type(): await client.delete_entity_type(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.DeleteEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.DeleteEntityTypeRequest, dict]]): The request object. The request message for [EntityTypes.DeleteEntityType][google.cloud.dialogflow.cx.v3beta1.EntityTypes.DeleteEntityType]. name (:class:`str`): @@ -850,10 +861,10 @@ async def sample_delete_entity_type(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -904,10 +915,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -958,10 +969,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1012,10 +1023,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1066,10 +1077,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1125,14 +1136,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("EntityTypesAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/entity_types/client.py b/google/cloud/dialogflowcx_v3beta1/services/entity_types/client.py index 69e3c1dd..99364e13 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/entity_types/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/entity_types/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -59,7 +71,7 @@ class EntityTypesClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[EntityTypesTransport]: """Returns an appropriate transport class. @@ -338,8 +350,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, EntityTypesTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, EntityTypesTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the entity types client. @@ -353,7 +365,7 @@ def __init__( transport (Union[str, EntityTypesTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -383,6 +395,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -435,11 +448,11 @@ def __init__( def list_entity_types( self, - request: Union[entity_type.ListEntityTypesRequest, dict] = None, + request: Optional[Union[entity_type.ListEntityTypesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEntityTypesPager: r"""Returns the list of all entity types in the specified @@ -552,11 +565,11 @@ def sample_list_entity_types(): def get_entity_type( self, - request: Union[entity_type.GetEntityTypeRequest, dict] = None, + request: Optional[Union[entity_type.GetEntityTypeRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> entity_type.EntityType: r"""Retrieves the specified entity type. @@ -686,12 +699,12 @@ def sample_get_entity_type(): def create_entity_type( self, - request: Union[gcdc_entity_type.CreateEntityTypeRequest, dict] = None, + request: Optional[Union[gcdc_entity_type.CreateEntityTypeRequest, dict]] = None, *, - parent: str = None, - entity_type: gcdc_entity_type.EntityType = None, + parent: Optional[str] = None, + entity_type: Optional[gcdc_entity_type.EntityType] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_entity_type.EntityType: r"""Creates an entity type in the specified agent. @@ -833,12 +846,12 @@ def sample_create_entity_type(): def update_entity_type( self, - request: Union[gcdc_entity_type.UpdateEntityTypeRequest, dict] = None, + request: Optional[Union[gcdc_entity_type.UpdateEntityTypeRequest, dict]] = None, *, - entity_type: gcdc_entity_type.EntityType = None, - update_mask: field_mask_pb2.FieldMask = None, + entity_type: Optional[gcdc_entity_type.EntityType] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_entity_type.EntityType: r"""Updates the specified entity type. @@ -985,11 +998,11 @@ def sample_update_entity_type(): def delete_entity_type( self, - request: Union[entity_type.DeleteEntityTypeRequest, dict] = None, + request: Optional[Union[entity_type.DeleteEntityTypeRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified entity type. @@ -1092,10 +1105,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1146,10 +1159,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1200,10 +1213,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1254,10 +1267,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1308,10 +1321,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1361,14 +1374,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("EntityTypesClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/base.py index da51be64..d7689e0f 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -31,14 +32,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class EntityTypesTransport(abc.ABC): @@ -55,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/grpc.py index bc4e695e..bf36b472 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/grpc.py @@ -52,14 +52,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -186,8 +186,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/grpc_asyncio.py index 24d20c34..d87bbfc2 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/entity_types/transports/grpc_asyncio.py @@ -54,7 +54,7 @@ class EntityTypesGrpcAsyncIOTransport(EntityTypesTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -97,15 +97,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/environments/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/environments/async_client.py index 75728218..3e139ad0 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/environments/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/environments/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -182,9 +193,9 @@ def transport(self) -> EnvironmentsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, EnvironmentsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the environments client. @@ -228,11 +239,11 @@ def __init__( async def list_environments( self, - request: Union[environment.ListEnvironmentsRequest, dict] = None, + request: Optional[Union[environment.ListEnvironmentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEnvironmentsAsyncPager: r"""Returns the list of all environments in the specified @@ -266,7 +277,7 @@ async def sample_list_environments(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListEnvironmentsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListEnvironmentsRequest, dict]]): The request object. The request message for [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironments]. parent (:class:`str`): @@ -346,11 +357,11 @@ async def sample_list_environments(): async def get_environment( self, - request: Union[environment.GetEnvironmentRequest, dict] = None, + request: Optional[Union[environment.GetEnvironmentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> environment.Environment: r"""Retrieves the specified @@ -383,7 +394,7 @@ async def sample_get_environment(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetEnvironmentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetEnvironmentRequest, dict]]): The request object. The request message for [Environments.GetEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.GetEnvironment]. name (:class:`str`): @@ -464,12 +475,14 @@ async def sample_get_environment(): async def create_environment( self, - request: Union[gcdc_environment.CreateEnvironmentRequest, dict] = None, + request: Optional[ + Union[gcdc_environment.CreateEnvironmentRequest, dict] + ] = None, *, - parent: str = None, - environment: gcdc_environment.Environment = None, + parent: Optional[str] = None, + environment: Optional[gcdc_environment.Environment] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates an @@ -516,13 +529,13 @@ async def sample_create_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CreateEnvironmentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CreateEnvironmentRequest, dict]]): The request object. The request message for [Environments.CreateEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.CreateEnvironment]. parent (:class:`str`): @@ -618,12 +631,14 @@ async def sample_create_environment(): async def update_environment( self, - request: Union[gcdc_environment.UpdateEnvironmentRequest, dict] = None, + request: Optional[ + Union[gcdc_environment.UpdateEnvironmentRequest, dict] + ] = None, *, - environment: gcdc_environment.Environment = None, - update_mask: field_mask_pb2.FieldMask = None, + environment: Optional[gcdc_environment.Environment] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Updates the specified @@ -668,13 +683,13 @@ async def sample_update_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.UpdateEnvironmentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.UpdateEnvironmentRequest, dict]]): The request object. The request message for [Environments.UpdateEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.UpdateEnvironment]. environment (:class:`google.cloud.dialogflowcx_v3beta1.types.Environment`): @@ -768,11 +783,11 @@ async def sample_update_environment(): async def delete_environment( self, - request: Union[environment.DeleteEnvironmentRequest, dict] = None, + request: Optional[Union[environment.DeleteEnvironmentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -802,7 +817,7 @@ async def sample_delete_environment(): await client.delete_environment(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.DeleteEnvironmentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.DeleteEnvironmentRequest, dict]]): The request object. The request message for [Environments.DeleteEnvironment][google.cloud.dialogflow.cx.v3beta1.Environments.DeleteEnvironment]. name (:class:`str`): @@ -861,11 +876,13 @@ async def sample_delete_environment(): async def lookup_environment_history( self, - request: Union[environment.LookupEnvironmentHistoryRequest, dict] = None, + request: Optional[ + Union[environment.LookupEnvironmentHistoryRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.LookupEnvironmentHistoryAsyncPager: r"""Looks up the history of the specified @@ -899,7 +916,7 @@ async def sample_lookup_environment_history(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.LookupEnvironmentHistoryRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.LookupEnvironmentHistoryRequest, dict]]): The request object. The request message for [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistory]. name (:class:`str`): @@ -978,10 +995,10 @@ async def sample_lookup_environment_history(): async def run_continuous_test( self, - request: Union[environment.RunContinuousTestRequest, dict] = None, + request: Optional[Union[environment.RunContinuousTestRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Kicks off a continuous test under the specified @@ -1022,13 +1039,13 @@ async def sample_run_continuous_test(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.RunContinuousTestRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.RunContinuousTestRequest, dict]]): The request object. The request message for [Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3beta1.Environments.RunContinuousTest]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1087,11 +1104,13 @@ async def sample_run_continuous_test(): async def list_continuous_test_results( self, - request: Union[environment.ListContinuousTestResultsRequest, dict] = None, + request: Optional[ + Union[environment.ListContinuousTestResultsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListContinuousTestResultsAsyncPager: r"""Fetches a list of continuous test results for a given @@ -1125,7 +1144,7 @@ async def sample_list_continuous_test_results(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListContinuousTestResultsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListContinuousTestResultsRequest, dict]]): The request object. The request message for [Environments.ListContinuousTestResults][google.cloud.dialogflow.cx.v3beta1.Environments.ListContinuousTestResults]. parent (:class:`str`): @@ -1203,10 +1222,10 @@ async def sample_list_continuous_test_results(): async def deploy_flow( self, - request: Union[environment.DeployFlowRequest, dict] = None, + request: Optional[Union[environment.DeployFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Deploys a flow to the specified @@ -1248,13 +1267,13 @@ async def sample_deploy_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.DeployFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.DeployFlowRequest, dict]]): The request object. The request message for [Environments.DeployFlow][google.cloud.dialogflow.cx.v3beta1.Environments.DeployFlow]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1313,10 +1332,10 @@ async def sample_deploy_flow(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1367,10 +1386,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1421,10 +1440,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1475,10 +1494,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1529,10 +1548,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1588,14 +1607,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("EnvironmentsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/environments/client.py b/google/cloud/dialogflowcx_v3beta1/services/environments/client.py index 509904d5..31b74111 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/environments/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/environments/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -63,7 +75,7 @@ class EnvironmentsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[EnvironmentsTransport]: """Returns an appropriate transport class. @@ -492,8 +504,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, EnvironmentsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, EnvironmentsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the environments client. @@ -507,7 +519,7 @@ def __init__( transport (Union[str, EnvironmentsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -537,6 +549,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -589,11 +602,11 @@ def __init__( def list_environments( self, - request: Union[environment.ListEnvironmentsRequest, dict] = None, + request: Optional[Union[environment.ListEnvironmentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEnvironmentsPager: r"""Returns the list of all environments in the specified @@ -707,11 +720,11 @@ def sample_list_environments(): def get_environment( self, - request: Union[environment.GetEnvironmentRequest, dict] = None, + request: Optional[Union[environment.GetEnvironmentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> environment.Environment: r"""Retrieves the specified @@ -825,12 +838,14 @@ def sample_get_environment(): def create_environment( self, - request: Union[gcdc_environment.CreateEnvironmentRequest, dict] = None, + request: Optional[ + Union[gcdc_environment.CreateEnvironmentRequest, dict] + ] = None, *, - parent: str = None, - environment: gcdc_environment.Environment = None, + parent: Optional[str] = None, + environment: Optional[gcdc_environment.Environment] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates an @@ -979,12 +994,14 @@ def sample_create_environment(): def update_environment( self, - request: Union[gcdc_environment.UpdateEnvironmentRequest, dict] = None, + request: Optional[ + Union[gcdc_environment.UpdateEnvironmentRequest, dict] + ] = None, *, - environment: gcdc_environment.Environment = None, - update_mask: field_mask_pb2.FieldMask = None, + environment: Optional[gcdc_environment.Environment] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Updates the specified @@ -1129,11 +1146,11 @@ def sample_update_environment(): def delete_environment( self, - request: Union[environment.DeleteEnvironmentRequest, dict] = None, + request: Optional[Union[environment.DeleteEnvironmentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -1222,11 +1239,13 @@ def sample_delete_environment(): def lookup_environment_history( self, - request: Union[environment.LookupEnvironmentHistoryRequest, dict] = None, + request: Optional[ + Union[environment.LookupEnvironmentHistoryRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.LookupEnvironmentHistoryPager: r"""Looks up the history of the specified @@ -1341,10 +1360,10 @@ def sample_lookup_environment_history(): def run_continuous_test( self, - request: Union[environment.RunContinuousTestRequest, dict] = None, + request: Optional[Union[environment.RunContinuousTestRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Kicks off a continuous test under the specified @@ -1451,11 +1470,13 @@ def sample_run_continuous_test(): def list_continuous_test_results( self, - request: Union[environment.ListContinuousTestResultsRequest, dict] = None, + request: Optional[ + Union[environment.ListContinuousTestResultsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListContinuousTestResultsPager: r"""Fetches a list of continuous test results for a given @@ -1569,10 +1590,10 @@ def sample_list_continuous_test_results(): def deploy_flow( self, - request: Union[environment.DeployFlowRequest, dict] = None, + request: Optional[Union[environment.DeployFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Deploys a flow to the specified @@ -1693,10 +1714,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1747,10 +1768,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1801,10 +1822,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1855,10 +1876,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1909,10 +1930,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1962,14 +1983,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("EnvironmentsClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/environments/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/environments/transports/base.py index 10143017..3cc8002f 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/environments/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/environments/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class EnvironmentsTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/environments/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/environments/transports/grpc.py index a65b79ed..50f993f0 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/environments/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/environments/transports/grpc.py @@ -54,14 +54,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -189,8 +189,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/environments/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/environments/transports/grpc_asyncio.py index eff34c4b..280c1759 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/environments/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/environments/transports/grpc_asyncio.py @@ -56,7 +56,7 @@ class EnvironmentsGrpcAsyncIOTransport(EnvironmentsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -99,15 +99,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/experiments/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/experiments/async_client.py index cbd434ae..92933918 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/experiments/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/experiments/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -164,9 +175,9 @@ def transport(self) -> ExperimentsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, ExperimentsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the experiments client. @@ -210,11 +221,11 @@ def __init__( async def list_experiments( self, - request: Union[experiment.ListExperimentsRequest, dict] = None, + request: Optional[Union[experiment.ListExperimentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListExperimentsAsyncPager: r"""Returns the list of all experiments in the specified @@ -248,7 +259,7 @@ async def sample_list_experiments(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListExperimentsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListExperimentsRequest, dict]]): The request object. The request message for [Experiments.ListExperiments][google.cloud.dialogflow.cx.v3beta1.Experiments.ListExperiments]. parent (:class:`str`): @@ -328,11 +339,11 @@ async def sample_list_experiments(): async def get_experiment( self, - request: Union[experiment.GetExperimentRequest, dict] = None, + request: Optional[Union[experiment.GetExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> experiment.Experiment: r"""Retrieves the specified @@ -365,7 +376,7 @@ async def sample_get_experiment(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetExperimentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetExperimentRequest, dict]]): The request object. The request message for [Experiments.GetExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.GetExperiment]. name (:class:`str`): @@ -433,12 +444,12 @@ async def sample_get_experiment(): async def create_experiment( self, - request: Union[gcdc_experiment.CreateExperimentRequest, dict] = None, + request: Optional[Union[gcdc_experiment.CreateExperimentRequest, dict]] = None, *, - parent: str = None, - experiment: gcdc_experiment.Experiment = None, + parent: Optional[str] = None, + experiment: Optional[gcdc_experiment.Experiment] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_experiment.Experiment: r"""Creates an @@ -477,7 +488,7 @@ async def sample_create_experiment(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CreateExperimentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CreateExperimentRequest, dict]]): The request object. The request message for [Experiments.CreateExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.CreateExperiment]. parent (:class:`str`): @@ -554,12 +565,12 @@ async def sample_create_experiment(): async def update_experiment( self, - request: Union[gcdc_experiment.UpdateExperimentRequest, dict] = None, + request: Optional[Union[gcdc_experiment.UpdateExperimentRequest, dict]] = None, *, - experiment: gcdc_experiment.Experiment = None, - update_mask: field_mask_pb2.FieldMask = None, + experiment: Optional[gcdc_experiment.Experiment] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_experiment.Experiment: r"""Updates the specified @@ -595,7 +606,7 @@ async def sample_update_experiment(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.UpdateExperimentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.UpdateExperimentRequest, dict]]): The request object. The request message for [Experiments.UpdateExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.UpdateExperiment]. experiment (:class:`google.cloud.dialogflowcx_v3beta1.types.Experiment`): @@ -670,11 +681,11 @@ async def sample_update_experiment(): async def delete_experiment( self, - request: Union[experiment.DeleteExperimentRequest, dict] = None, + request: Optional[Union[experiment.DeleteExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -704,7 +715,7 @@ async def sample_delete_experiment(): await client.delete_experiment(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.DeleteExperimentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.DeleteExperimentRequest, dict]]): The request object. The request message for [Experiments.DeleteExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.DeleteExperiment]. name (:class:`str`): @@ -763,11 +774,11 @@ async def sample_delete_experiment(): async def start_experiment( self, - request: Union[experiment.StartExperimentRequest, dict] = None, + request: Optional[Union[experiment.StartExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> experiment.Experiment: r"""Starts the specified @@ -802,7 +813,7 @@ async def sample_start_experiment(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.StartExperimentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.StartExperimentRequest, dict]]): The request object. The request message for [Experiments.StartExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.StartExperiment]. name (:class:`str`): @@ -869,11 +880,11 @@ async def sample_start_experiment(): async def stop_experiment( self, - request: Union[experiment.StopExperimentRequest, dict] = None, + request: Optional[Union[experiment.StopExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> experiment.Experiment: r"""Stops the specified @@ -908,7 +919,7 @@ async def sample_stop_experiment(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.StopExperimentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.StopExperimentRequest, dict]]): The request object. The request message for [Experiments.StopExperiment][google.cloud.dialogflow.cx.v3beta1.Experiments.StopExperiment]. name (:class:`str`): @@ -975,10 +986,10 @@ async def sample_stop_experiment(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1029,10 +1040,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1083,10 +1094,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1137,10 +1148,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1191,10 +1202,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1250,14 +1261,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ExperimentsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/experiments/client.py b/google/cloud/dialogflowcx_v3beta1/services/experiments/client.py index 3d12d22a..bcdf4800 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/experiments/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/experiments/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -61,7 +73,7 @@ class ExperimentsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[ExperimentsTransport]: """Returns an appropriate transport class. @@ -368,8 +380,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, ExperimentsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, ExperimentsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the experiments client. @@ -383,7 +395,7 @@ def __init__( transport (Union[str, ExperimentsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -413,6 +425,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -465,11 +478,11 @@ def __init__( def list_experiments( self, - request: Union[experiment.ListExperimentsRequest, dict] = None, + request: Optional[Union[experiment.ListExperimentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListExperimentsPager: r"""Returns the list of all experiments in the specified @@ -583,11 +596,11 @@ def sample_list_experiments(): def get_experiment( self, - request: Union[experiment.GetExperimentRequest, dict] = None, + request: Optional[Union[experiment.GetExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> experiment.Experiment: r"""Retrieves the specified @@ -688,12 +701,12 @@ def sample_get_experiment(): def create_experiment( self, - request: Union[gcdc_experiment.CreateExperimentRequest, dict] = None, + request: Optional[Union[gcdc_experiment.CreateExperimentRequest, dict]] = None, *, - parent: str = None, - experiment: gcdc_experiment.Experiment = None, + parent: Optional[str] = None, + experiment: Optional[gcdc_experiment.Experiment] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_experiment.Experiment: r"""Creates an @@ -809,12 +822,12 @@ def sample_create_experiment(): def update_experiment( self, - request: Union[gcdc_experiment.UpdateExperimentRequest, dict] = None, + request: Optional[Union[gcdc_experiment.UpdateExperimentRequest, dict]] = None, *, - experiment: gcdc_experiment.Experiment = None, - update_mask: field_mask_pb2.FieldMask = None, + experiment: Optional[gcdc_experiment.Experiment] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_experiment.Experiment: r"""Updates the specified @@ -925,11 +938,11 @@ def sample_update_experiment(): def delete_experiment( self, - request: Union[experiment.DeleteExperimentRequest, dict] = None, + request: Optional[Union[experiment.DeleteExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -1018,11 +1031,11 @@ def sample_delete_experiment(): def start_experiment( self, - request: Union[experiment.StartExperimentRequest, dict] = None, + request: Optional[Union[experiment.StartExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> experiment.Experiment: r"""Starts the specified @@ -1124,11 +1137,11 @@ def sample_start_experiment(): def stop_experiment( self, - request: Union[experiment.StopExperimentRequest, dict] = None, + request: Optional[Union[experiment.StopExperimentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> experiment.Experiment: r"""Stops the specified @@ -1243,10 +1256,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1297,10 +1310,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1351,10 +1364,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1405,10 +1418,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1459,10 +1472,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1512,14 +1525,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("ExperimentsClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/base.py index 9b01950e..a61109e8 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -31,14 +32,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class ExperimentsTransport(abc.ABC): @@ -55,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/grpc.py index 8fea66b9..38631e46 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/grpc.py @@ -52,14 +52,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -186,8 +186,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/grpc_asyncio.py index 475b4f67..4437e0e4 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/experiments/transports/grpc_asyncio.py @@ -54,7 +54,7 @@ class ExperimentsGrpcAsyncIOTransport(ExperimentsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -97,15 +97,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/flows/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/flows/async_client.py index c87fc65e..9207b0fc 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/flows/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/flows/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -175,9 +186,9 @@ def transport(self) -> FlowsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, FlowsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the flows client. @@ -221,12 +232,12 @@ def __init__( async def create_flow( self, - request: Union[gcdc_flow.CreateFlowRequest, dict] = None, + request: Optional[Union[gcdc_flow.CreateFlowRequest, dict]] = None, *, - parent: str = None, - flow: gcdc_flow.Flow = None, + parent: Optional[str] = None, + flow: Optional[gcdc_flow.Flow] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_flow.Flow: r"""Creates a flow in the specified agent. @@ -266,7 +277,7 @@ async def sample_create_flow(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CreateFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CreateFlowRequest, dict]]): The request object. The request message for [Flows.CreateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.CreateFlow]. parent (:class:`str`): @@ -360,11 +371,11 @@ async def sample_create_flow(): async def delete_flow( self, - request: Union[flow.DeleteFlowRequest, dict] = None, + request: Optional[Union[flow.DeleteFlowRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a specified flow. @@ -393,7 +404,7 @@ async def sample_delete_flow(): await client.delete_flow(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.DeleteFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.DeleteFlowRequest, dict]]): The request object. The request message for [Flows.DeleteFlow][google.cloud.dialogflow.cx.v3beta1.Flows.DeleteFlow]. name (:class:`str`): @@ -450,11 +461,11 @@ async def sample_delete_flow(): async def list_flows( self, - request: Union[flow.ListFlowsRequest, dict] = None, + request: Optional[Union[flow.ListFlowsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFlowsAsyncPager: r"""Returns the list of all flows in the specified agent. @@ -487,7 +498,7 @@ async def sample_list_flows(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListFlowsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListFlowsRequest, dict]]): The request object. The request message for [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows]. parent (:class:`str`): @@ -565,11 +576,11 @@ async def sample_list_flows(): async def get_flow( self, - request: Union[flow.GetFlowRequest, dict] = None, + request: Optional[Union[flow.GetFlowRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> flow.Flow: r"""Retrieves the specified flow. @@ -601,7 +612,7 @@ async def sample_get_flow(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetFlowRequest, dict]]): The request object. The response message for [Flows.GetFlow][google.cloud.dialogflow.cx.v3beta1.Flows.GetFlow]. name (:class:`str`): @@ -688,12 +699,12 @@ async def sample_get_flow(): async def update_flow( self, - request: Union[gcdc_flow.UpdateFlowRequest, dict] = None, + request: Optional[Union[gcdc_flow.UpdateFlowRequest, dict]] = None, *, - flow: gcdc_flow.Flow = None, - update_mask: field_mask_pb2.FieldMask = None, + flow: Optional[gcdc_flow.Flow] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_flow.Flow: r"""Updates the specified flow. @@ -732,7 +743,7 @@ async def sample_update_flow(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.UpdateFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.UpdateFlowRequest, dict]]): The request object. The request message for [Flows.UpdateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.UpdateFlow]. flow (:class:`google.cloud.dialogflowcx_v3beta1.types.Flow`): @@ -829,11 +840,11 @@ async def sample_update_flow(): async def train_flow( self, - request: Union[flow.TrainFlowRequest, dict] = None, + request: Optional[Union[flow.TrainFlowRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Trains the specified flow. Note that only the flow in 'draft' @@ -878,13 +889,13 @@ async def sample_train_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.TrainFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.TrainFlowRequest, dict]]): The request object. The request message for [Flows.TrainFlow][google.cloud.dialogflow.cx.v3beta1.Flows.TrainFlow]. name (:class:`str`): @@ -968,10 +979,10 @@ async def sample_train_flow(): async def validate_flow( self, - request: Union[flow.ValidateFlowRequest, dict] = None, + request: Optional[Union[flow.ValidateFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> flow.FlowValidationResult: r"""Validates the specified flow and creates or updates @@ -1006,7 +1017,7 @@ async def sample_validate_flow(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ValidateFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ValidateFlowRequest, dict]]): The request object. The request message for [Flows.ValidateFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ValidateFlow]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1051,11 +1062,11 @@ async def sample_validate_flow(): async def get_flow_validation_result( self, - request: Union[flow.GetFlowValidationResultRequest, dict] = None, + request: Optional[Union[flow.GetFlowValidationResultRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> flow.FlowValidationResult: r"""Gets the latest flow validation result. Flow @@ -1088,7 +1099,7 @@ async def sample_get_flow_validation_result(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetFlowValidationResultRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetFlowValidationResultRequest, dict]]): The request object. The request message for [Flows.GetFlowValidationResult][google.cloud.dialogflow.cx.v3beta1.Flows.GetFlowValidationResult]. name (:class:`str`): @@ -1154,10 +1165,10 @@ async def sample_get_flow_validation_result(): async def import_flow( self, - request: Union[flow.ImportFlowRequest, dict] = None, + request: Optional[Union[flow.ImportFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Imports the specified flow to the specified agent from a binary @@ -1203,13 +1214,13 @@ async def sample_import_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ImportFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ImportFlowRequest, dict]]): The request object. The request message for [Flows.ImportFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ImportFlow]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1266,10 +1277,10 @@ async def sample_import_flow(): async def export_flow( self, - request: Union[flow.ExportFlowRequest, dict] = None, + request: Optional[Union[flow.ExportFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Exports the specified flow to a binary file. @@ -1312,13 +1323,13 @@ async def sample_export_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ExportFlowRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ExportFlowRequest, dict]]): The request object. The request message for [Flows.ExportFlow][google.cloud.dialogflow.cx.v3beta1.Flows.ExportFlow]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1375,10 +1386,10 @@ async def sample_export_flow(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1429,10 +1440,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1483,10 +1494,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1537,10 +1548,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1591,10 +1602,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1650,14 +1661,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("FlowsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/flows/client.py b/google/cloud/dialogflowcx_v3beta1/services/flows/client.py index 3e3856f2..a7ee94a0 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/flows/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/flows/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -66,7 +78,7 @@ class FlowsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[FlowsTransport]: """Returns an appropriate transport class. @@ -469,8 +481,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, FlowsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, FlowsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the flows client. @@ -484,7 +496,7 @@ def __init__( transport (Union[str, FlowsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -514,6 +526,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -566,12 +579,12 @@ def __init__( def create_flow( self, - request: Union[gcdc_flow.CreateFlowRequest, dict] = None, + request: Optional[Union[gcdc_flow.CreateFlowRequest, dict]] = None, *, - parent: str = None, - flow: gcdc_flow.Flow = None, + parent: Optional[str] = None, + flow: Optional[gcdc_flow.Flow] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_flow.Flow: r"""Creates a flow in the specified agent. @@ -705,11 +718,11 @@ def sample_create_flow(): def delete_flow( self, - request: Union[flow.DeleteFlowRequest, dict] = None, + request: Optional[Union[flow.DeleteFlowRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a specified flow. @@ -795,11 +808,11 @@ def sample_delete_flow(): def list_flows( self, - request: Union[flow.ListFlowsRequest, dict] = None, + request: Optional[Union[flow.ListFlowsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFlowsPager: r"""Returns the list of all flows in the specified agent. @@ -910,11 +923,11 @@ def sample_list_flows(): def get_flow( self, - request: Union[flow.GetFlowRequest, dict] = None, + request: Optional[Union[flow.GetFlowRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> flow.Flow: r"""Retrieves the specified flow. @@ -1033,12 +1046,12 @@ def sample_get_flow(): def update_flow( self, - request: Union[gcdc_flow.UpdateFlowRequest, dict] = None, + request: Optional[Union[gcdc_flow.UpdateFlowRequest, dict]] = None, *, - flow: gcdc_flow.Flow = None, - update_mask: field_mask_pb2.FieldMask = None, + flow: Optional[gcdc_flow.Flow] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_flow.Flow: r"""Updates the specified flow. @@ -1174,11 +1187,11 @@ def sample_update_flow(): def train_flow( self, - request: Union[flow.TrainFlowRequest, dict] = None, + request: Optional[Union[flow.TrainFlowRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Trains the specified flow. Note that only the flow in 'draft' @@ -1313,10 +1326,10 @@ def sample_train_flow(): def validate_flow( self, - request: Union[flow.ValidateFlowRequest, dict] = None, + request: Optional[Union[flow.ValidateFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> flow.FlowValidationResult: r"""Validates the specified flow and creates or updates @@ -1397,11 +1410,11 @@ def sample_validate_flow(): def get_flow_validation_result( self, - request: Union[flow.GetFlowValidationResultRequest, dict] = None, + request: Optional[Union[flow.GetFlowValidationResultRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> flow.FlowValidationResult: r"""Gets the latest flow validation result. Flow @@ -1502,10 +1515,10 @@ def sample_get_flow_validation_result(): def import_flow( self, - request: Union[flow.ImportFlowRequest, dict] = None, + request: Optional[Union[flow.ImportFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Imports the specified flow to the specified agent from a binary @@ -1615,10 +1628,10 @@ def sample_import_flow(): def export_flow( self, - request: Union[flow.ExportFlowRequest, dict] = None, + request: Optional[Union[flow.ExportFlowRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Exports the specified flow to a binary file. @@ -1738,10 +1751,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1792,10 +1805,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1846,10 +1859,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1900,10 +1913,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1954,10 +1967,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -2007,14 +2020,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("FlowsClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/flows/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/flows/transports/base.py index 74813ec3..06592176 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/flows/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/flows/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class FlowsTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/flows/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/flows/transports/grpc.py index 1e1f01c5..9ffc88d0 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/flows/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/flows/transports/grpc.py @@ -54,14 +54,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -189,8 +189,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/flows/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/flows/transports/grpc_asyncio.py index d9e76614..31181496 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/flows/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/flows/transports/grpc_asyncio.py @@ -56,7 +56,7 @@ class FlowsGrpcAsyncIOTransport(FlowsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -99,15 +99,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/intents/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/intents/async_client.py index ea25a331..67ed22f0 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/intents/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/intents/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -158,9 +169,9 @@ def transport(self) -> IntentsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, IntentsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the intents client. @@ -204,11 +215,11 @@ def __init__( async def list_intents( self, - request: Union[intent.ListIntentsRequest, dict] = None, + request: Optional[Union[intent.ListIntentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListIntentsAsyncPager: r"""Returns the list of all intents in the specified @@ -242,7 +253,7 @@ async def sample_list_intents(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListIntentsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListIntentsRequest, dict]]): The request object. The request message for [Intents.ListIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ListIntents]. parent (:class:`str`): @@ -320,11 +331,11 @@ async def sample_list_intents(): async def get_intent( self, - request: Union[intent.GetIntentRequest, dict] = None, + request: Optional[Union[intent.GetIntentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> intent.Intent: r"""Retrieves the specified intent. @@ -356,7 +367,7 @@ async def sample_get_intent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetIntentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetIntentRequest, dict]]): The request object. The request message for [Intents.GetIntent][google.cloud.dialogflow.cx.v3beta1.Intents.GetIntent]. name (:class:`str`): @@ -427,12 +438,12 @@ async def sample_get_intent(): async def create_intent( self, - request: Union[gcdc_intent.CreateIntentRequest, dict] = None, + request: Optional[Union[gcdc_intent.CreateIntentRequest, dict]] = None, *, - parent: str = None, - intent: gcdc_intent.Intent = None, + parent: Optional[str] = None, + intent: Optional[gcdc_intent.Intent] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_intent.Intent: r"""Creates an intent in the specified agent. @@ -472,7 +483,7 @@ async def sample_create_intent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CreateIntentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CreateIntentRequest, dict]]): The request object. The request message for [Intents.CreateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.CreateIntent]. parent (:class:`str`): @@ -550,12 +561,12 @@ async def sample_create_intent(): async def update_intent( self, - request: Union[gcdc_intent.UpdateIntentRequest, dict] = None, + request: Optional[Union[gcdc_intent.UpdateIntentRequest, dict]] = None, *, - intent: gcdc_intent.Intent = None, - update_mask: field_mask_pb2.FieldMask = None, + intent: Optional[gcdc_intent.Intent] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_intent.Intent: r"""Updates the specified intent. @@ -594,7 +605,7 @@ async def sample_update_intent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.UpdateIntentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.UpdateIntentRequest, dict]]): The request object. The request message for [Intents.UpdateIntent][google.cloud.dialogflow.cx.v3beta1.Intents.UpdateIntent]. intent (:class:`google.cloud.dialogflowcx_v3beta1.types.Intent`): @@ -675,11 +686,11 @@ async def sample_update_intent(): async def delete_intent( self, - request: Union[intent.DeleteIntentRequest, dict] = None, + request: Optional[Union[intent.DeleteIntentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified intent. @@ -712,7 +723,7 @@ async def sample_delete_intent(): await client.delete_intent(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.DeleteIntentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.DeleteIntentRequest, dict]]): The request object. The request message for [Intents.DeleteIntent][google.cloud.dialogflow.cx.v3beta1.Intents.DeleteIntent]. name (:class:`str`): @@ -769,10 +780,10 @@ async def sample_delete_intent(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -823,10 +834,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -877,10 +888,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -931,10 +942,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -985,10 +996,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1044,14 +1055,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("IntentsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/intents/client.py b/google/cloud/dialogflowcx_v3beta1/services/intents/client.py index 962aaa31..cd838477 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/intents/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/intents/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -59,7 +71,7 @@ class IntentsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[IntentsTransport]: """Returns an appropriate transport class. @@ -362,8 +374,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, IntentsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, IntentsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the intents client. @@ -377,7 +389,7 @@ def __init__( transport (Union[str, IntentsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -407,6 +419,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -459,11 +472,11 @@ def __init__( def list_intents( self, - request: Union[intent.ListIntentsRequest, dict] = None, + request: Optional[Union[intent.ListIntentsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListIntentsPager: r"""Returns the list of all intents in the specified @@ -575,11 +588,11 @@ def sample_list_intents(): def get_intent( self, - request: Union[intent.GetIntentRequest, dict] = None, + request: Optional[Union[intent.GetIntentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> intent.Intent: r"""Retrieves the specified intent. @@ -682,12 +695,12 @@ def sample_get_intent(): def create_intent( self, - request: Union[gcdc_intent.CreateIntentRequest, dict] = None, + request: Optional[Union[gcdc_intent.CreateIntentRequest, dict]] = None, *, - parent: str = None, - intent: gcdc_intent.Intent = None, + parent: Optional[str] = None, + intent: Optional[gcdc_intent.Intent] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_intent.Intent: r"""Creates an intent in the specified agent. @@ -805,12 +818,12 @@ def sample_create_intent(): def update_intent( self, - request: Union[gcdc_intent.UpdateIntentRequest, dict] = None, + request: Optional[Union[gcdc_intent.UpdateIntentRequest, dict]] = None, *, - intent: gcdc_intent.Intent = None, - update_mask: field_mask_pb2.FieldMask = None, + intent: Optional[gcdc_intent.Intent] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_intent.Intent: r"""Updates the specified intent. @@ -930,11 +943,11 @@ def sample_update_intent(): def delete_intent( self, - request: Union[intent.DeleteIntentRequest, dict] = None, + request: Optional[Union[intent.DeleteIntentRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified intent. @@ -1037,10 +1050,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1091,10 +1104,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1145,10 +1158,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1199,10 +1212,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1253,10 +1266,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1306,14 +1319,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("IntentsClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/intents/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/intents/transports/base.py index d9922c3c..7a336909 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/intents/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/intents/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -31,14 +32,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class IntentsTransport(abc.ABC): @@ -55,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/intents/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/intents/transports/grpc.py index 5bbe4780..94b9ca5b 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/intents/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/intents/transports/grpc.py @@ -52,14 +52,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -186,8 +186,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/intents/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/intents/transports/grpc_asyncio.py index 72bd0fbe..93f93db1 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/intents/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/intents/transports/grpc_asyncio.py @@ -54,7 +54,7 @@ class IntentsGrpcAsyncIOTransport(IntentsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -97,15 +97,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/pages/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/pages/async_client.py index 52002f27..23ad7c77 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/pages/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/pages/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -167,9 +178,9 @@ def transport(self) -> PagesTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, PagesTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the pages client. @@ -213,11 +224,11 @@ def __init__( async def list_pages( self, - request: Union[page.ListPagesRequest, dict] = None, + request: Optional[Union[page.ListPagesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPagesAsyncPager: r"""Returns the list of all pages in the specified flow. @@ -250,7 +261,7 @@ async def sample_list_pages(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListPagesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListPagesRequest, dict]]): The request object. The request message for [Pages.ListPages][google.cloud.dialogflow.cx.v3beta1.Pages.ListPages]. parent (:class:`str`): @@ -328,11 +339,11 @@ async def sample_list_pages(): async def get_page( self, - request: Union[page.GetPageRequest, dict] = None, + request: Optional[Union[page.GetPageRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> page.Page: r"""Retrieves the specified page. @@ -364,7 +375,7 @@ async def sample_get_page(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetPageRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetPageRequest, dict]]): The request object. The request message for [Pages.GetPage][google.cloud.dialogflow.cx.v3beta1.Pages.GetPage]. name (:class:`str`): @@ -450,12 +461,12 @@ async def sample_get_page(): async def create_page( self, - request: Union[gcdc_page.CreatePageRequest, dict] = None, + request: Optional[Union[gcdc_page.CreatePageRequest, dict]] = None, *, - parent: str = None, - page: gcdc_page.Page = None, + parent: Optional[str] = None, + page: Optional[gcdc_page.Page] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_page.Page: r"""Creates a page in the specified flow. @@ -491,7 +502,7 @@ async def sample_create_page(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CreatePageRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CreatePageRequest, dict]]): The request object. The request message for [Pages.CreatePage][google.cloud.dialogflow.cx.v3beta1.Pages.CreatePage]. parent (:class:`str`): @@ -584,12 +595,12 @@ async def sample_create_page(): async def update_page( self, - request: Union[gcdc_page.UpdatePageRequest, dict] = None, + request: Optional[Union[gcdc_page.UpdatePageRequest, dict]] = None, *, - page: gcdc_page.Page = None, - update_mask: field_mask_pb2.FieldMask = None, + page: Optional[gcdc_page.Page] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_page.Page: r"""Updates the specified page. @@ -624,7 +635,7 @@ async def sample_update_page(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.UpdatePageRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.UpdatePageRequest, dict]]): The request object. The request message for [Pages.UpdatePage][google.cloud.dialogflow.cx.v3beta1.Pages.UpdatePage]. page (:class:`google.cloud.dialogflowcx_v3beta1.types.Page`): @@ -720,11 +731,11 @@ async def sample_update_page(): async def delete_page( self, - request: Union[page.DeletePageRequest, dict] = None, + request: Optional[Union[page.DeletePageRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified page. @@ -753,7 +764,7 @@ async def sample_delete_page(): await client.delete_page(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.DeletePageRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.DeletePageRequest, dict]]): The request object. The request message for [Pages.DeletePage][google.cloud.dialogflow.cx.v3beta1.Pages.DeletePage]. name (:class:`str`): @@ -810,10 +821,10 @@ async def sample_delete_page(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -864,10 +875,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -918,10 +929,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -972,10 +983,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1026,10 +1037,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1085,14 +1096,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("PagesAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/pages/client.py b/google/cloud/dialogflowcx_v3beta1/services/pages/client.py index 7babfdcc..4cbd2f84 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/pages/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/pages/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -60,7 +72,7 @@ class PagesClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[PagesTransport]: """Returns an appropriate transport class. @@ -463,8 +475,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, PagesTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, PagesTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the pages client. @@ -478,7 +490,7 @@ def __init__( transport (Union[str, PagesTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -508,6 +520,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -560,11 +573,11 @@ def __init__( def list_pages( self, - request: Union[page.ListPagesRequest, dict] = None, + request: Optional[Union[page.ListPagesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPagesPager: r"""Returns the list of all pages in the specified flow. @@ -675,11 +688,11 @@ def sample_list_pages(): def get_page( self, - request: Union[page.GetPageRequest, dict] = None, + request: Optional[Union[page.GetPageRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> page.Page: r"""Retrieves the specified page. @@ -797,12 +810,12 @@ def sample_get_page(): def create_page( self, - request: Union[gcdc_page.CreatePageRequest, dict] = None, + request: Optional[Union[gcdc_page.CreatePageRequest, dict]] = None, *, - parent: str = None, - page: gcdc_page.Page = None, + parent: Optional[str] = None, + page: Optional[gcdc_page.Page] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_page.Page: r"""Creates a page in the specified flow. @@ -931,12 +944,12 @@ def sample_create_page(): def update_page( self, - request: Union[gcdc_page.UpdatePageRequest, dict] = None, + request: Optional[Union[gcdc_page.UpdatePageRequest, dict]] = None, *, - page: gcdc_page.Page = None, - update_mask: field_mask_pb2.FieldMask = None, + page: Optional[gcdc_page.Page] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_page.Page: r"""Updates the specified page. @@ -1067,11 +1080,11 @@ def sample_update_page(): def delete_page( self, - request: Union[page.DeletePageRequest, dict] = None, + request: Optional[Union[page.DeletePageRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified page. @@ -1170,10 +1183,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1224,10 +1237,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1278,10 +1291,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1332,10 +1345,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1386,10 +1399,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1439,14 +1452,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("PagesClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/pages/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/pages/transports/base.py index ff8a6c1b..a26822e4 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/pages/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/pages/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -31,14 +32,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class PagesTransport(abc.ABC): @@ -55,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/pages/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/pages/transports/grpc.py index 5ea89caf..446b3b2a 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/pages/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/pages/transports/grpc.py @@ -52,14 +52,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -186,8 +186,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/pages/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/pages/transports/grpc_asyncio.py index 0390d385..af1c71e1 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/pages/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/pages/transports/grpc_asyncio.py @@ -54,7 +54,7 @@ class PagesGrpcAsyncIOTransport(PagesTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -97,15 +97,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/async_client.py index 8c1dee46..f8774ac3 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -185,9 +196,9 @@ def transport(self) -> SecuritySettingsServiceTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, SecuritySettingsServiceTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the security settings service client. @@ -231,14 +242,14 @@ def __init__( async def create_security_settings( self, - request: Union[ - gcdc_security_settings.CreateSecuritySettingsRequest, dict + request: Optional[ + Union[gcdc_security_settings.CreateSecuritySettingsRequest, dict] ] = None, *, - parent: str = None, - security_settings: gcdc_security_settings.SecuritySettings = None, + parent: Optional[str] = None, + security_settings: Optional[gcdc_security_settings.SecuritySettings] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_security_settings.SecuritySettings: r"""Create security settings in the specified location. @@ -275,7 +286,7 @@ async def sample_create_security_settings(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CreateSecuritySettingsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CreateSecuritySettingsRequest, dict]]): The request object. The request message for [SecuritySettings.CreateSecuritySettings][]. parent (:class:`str`): @@ -356,11 +367,13 @@ async def sample_create_security_settings(): async def get_security_settings( self, - request: Union[security_settings.GetSecuritySettingsRequest, dict] = None, + request: Optional[ + Union[security_settings.GetSecuritySettingsRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> security_settings.SecuritySettings: r"""Retrieves the specified @@ -394,7 +407,7 @@ async def sample_get_security_settings(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetSecuritySettingsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetSecuritySettingsRequest, dict]]): The request object. The request message for [SecuritySettingsService.GetSecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.GetSecuritySettings]. name (:class:`str`): @@ -464,14 +477,14 @@ async def sample_get_security_settings(): async def update_security_settings( self, - request: Union[ - gcdc_security_settings.UpdateSecuritySettingsRequest, dict + request: Optional[ + Union[gcdc_security_settings.UpdateSecuritySettingsRequest, dict] ] = None, *, - security_settings: gcdc_security_settings.SecuritySettings = None, - update_mask: field_mask_pb2.FieldMask = None, + security_settings: Optional[gcdc_security_settings.SecuritySettings] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_security_settings.SecuritySettings: r"""Updates the specified @@ -508,7 +521,7 @@ async def sample_update_security_settings(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.UpdateSecuritySettingsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.UpdateSecuritySettingsRequest, dict]]): The request object. The request message for [SecuritySettingsService.UpdateSecuritySettings][google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService.UpdateSecuritySettings]. security_settings (:class:`google.cloud.dialogflowcx_v3beta1.types.SecuritySettings`): @@ -590,11 +603,13 @@ async def sample_update_security_settings(): async def list_security_settings( self, - request: Union[security_settings.ListSecuritySettingsRequest, dict] = None, + request: Optional[ + Union[security_settings.ListSecuritySettingsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListSecuritySettingsAsyncPager: r"""Returns the list of all security settings in the @@ -628,7 +643,7 @@ async def sample_list_security_settings(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListSecuritySettingsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListSecuritySettingsRequest, dict]]): The request object. The request message for [SecuritySettings.ListSecuritySettings][]. parent (:class:`str`): @@ -707,11 +722,13 @@ async def sample_list_security_settings(): async def delete_security_settings( self, - request: Union[security_settings.DeleteSecuritySettingsRequest, dict] = None, + request: Optional[ + Union[security_settings.DeleteSecuritySettingsRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -741,7 +758,7 @@ async def sample_delete_security_settings(): await client.delete_security_settings(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.DeleteSecuritySettingsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.DeleteSecuritySettingsRequest, dict]]): The request object. The request message for [SecuritySettings.DeleteSecuritySettings][]. name (:class:`str`): @@ -800,10 +817,10 @@ async def sample_delete_security_settings(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -854,10 +871,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -908,10 +925,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -962,10 +979,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1016,10 +1033,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1075,14 +1092,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SecuritySettingsServiceAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/client.py b/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/client.py index c21a1f94..a5a031a0 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -63,7 +75,7 @@ class SecuritySettingsServiceClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[SecuritySettingsServiceTransport]: """Returns an appropriate transport class. @@ -382,8 +394,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, SecuritySettingsServiceTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, SecuritySettingsServiceTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the security settings service client. @@ -397,7 +409,7 @@ def __init__( transport (Union[str, SecuritySettingsServiceTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -427,6 +439,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -479,14 +492,14 @@ def __init__( def create_security_settings( self, - request: Union[ - gcdc_security_settings.CreateSecuritySettingsRequest, dict + request: Optional[ + Union[gcdc_security_settings.CreateSecuritySettingsRequest, dict] ] = None, *, - parent: str = None, - security_settings: gcdc_security_settings.SecuritySettings = None, + parent: Optional[str] = None, + security_settings: Optional[gcdc_security_settings.SecuritySettings] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_security_settings.SecuritySettings: r"""Create security settings in the specified location. @@ -606,11 +619,13 @@ def sample_create_security_settings(): def get_security_settings( self, - request: Union[security_settings.GetSecuritySettingsRequest, dict] = None, + request: Optional[ + Union[security_settings.GetSecuritySettingsRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> security_settings.SecuritySettings: r"""Retrieves the specified @@ -714,14 +729,14 @@ def sample_get_security_settings(): def update_security_settings( self, - request: Union[ - gcdc_security_settings.UpdateSecuritySettingsRequest, dict + request: Optional[ + Union[gcdc_security_settings.UpdateSecuritySettingsRequest, dict] ] = None, *, - security_settings: gcdc_security_settings.SecuritySettings = None, - update_mask: field_mask_pb2.FieldMask = None, + security_settings: Optional[gcdc_security_settings.SecuritySettings] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_security_settings.SecuritySettings: r"""Updates the specified @@ -842,11 +857,13 @@ def sample_update_security_settings(): def list_security_settings( self, - request: Union[security_settings.ListSecuritySettingsRequest, dict] = None, + request: Optional[ + Union[security_settings.ListSecuritySettingsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListSecuritySettingsPager: r"""Returns the list of all security settings in the @@ -959,11 +976,13 @@ def sample_list_security_settings(): def delete_security_settings( self, - request: Union[security_settings.DeleteSecuritySettingsRequest, dict] = None, + request: Optional[ + Union[security_settings.DeleteSecuritySettingsRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -1065,10 +1084,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1119,10 +1138,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1173,10 +1192,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1227,10 +1246,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1281,10 +1300,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1334,14 +1353,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SecuritySettingsServiceClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/base.py index 5acaff2e..d0b83f1a 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class SecuritySettingsServiceTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/grpc.py index adab1b93..6572ab8f 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/grpc.py @@ -53,14 +53,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -187,8 +187,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/grpc_asyncio.py index af372a08..20440796 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/security_settings_service/transports/grpc_asyncio.py @@ -55,7 +55,7 @@ class SecuritySettingsServiceGrpcAsyncIOTransport(SecuritySettingsServiceTranspo def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -98,15 +98,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/async_client.py index 8d6c080d..fdaa2539 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -172,9 +183,9 @@ def transport(self) -> SessionEntityTypesTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, SessionEntityTypesTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the session entity types client. @@ -218,11 +229,13 @@ def __init__( async def list_session_entity_types( self, - request: Union[session_entity_type.ListSessionEntityTypesRequest, dict] = None, + request: Optional[ + Union[session_entity_type.ListSessionEntityTypesRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListSessionEntityTypesAsyncPager: r"""Returns the list of all session entity types in the @@ -256,7 +269,7 @@ async def sample_list_session_entity_types(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListSessionEntityTypesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListSessionEntityTypesRequest, dict]]): The request object. The request message for [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypes]. parent (:class:`str`): @@ -339,11 +352,13 @@ async def sample_list_session_entity_types(): async def get_session_entity_type( self, - request: Union[session_entity_type.GetSessionEntityTypeRequest, dict] = None, + request: Optional[ + Union[session_entity_type.GetSessionEntityTypeRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session_entity_type.SessionEntityType: r"""Retrieves the specified session entity type. @@ -375,7 +390,7 @@ async def sample_get_session_entity_type(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetSessionEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetSessionEntityTypeRequest, dict]]): The request object. The request message for [SessionEntityTypes.GetSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.GetSessionEntityType]. name (:class:`str`): @@ -460,14 +475,16 @@ async def sample_get_session_entity_type(): async def create_session_entity_type( self, - request: Union[ - gcdc_session_entity_type.CreateSessionEntityTypeRequest, dict + request: Optional[ + Union[gcdc_session_entity_type.CreateSessionEntityTypeRequest, dict] ] = None, *, - parent: str = None, - session_entity_type: gcdc_session_entity_type.SessionEntityType = None, + parent: Optional[str] = None, + session_entity_type: Optional[ + gcdc_session_entity_type.SessionEntityType + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_session_entity_type.SessionEntityType: r"""Creates a session entity type. @@ -506,7 +523,7 @@ async def sample_create_session_entity_type(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CreateSessionEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CreateSessionEntityTypeRequest, dict]]): The request object. The request message for [SessionEntityTypes.CreateSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.CreateSessionEntityType]. parent (:class:`str`): @@ -601,14 +618,16 @@ async def sample_create_session_entity_type(): async def update_session_entity_type( self, - request: Union[ - gcdc_session_entity_type.UpdateSessionEntityTypeRequest, dict + request: Optional[ + Union[gcdc_session_entity_type.UpdateSessionEntityTypeRequest, dict] ] = None, *, - session_entity_type: gcdc_session_entity_type.SessionEntityType = None, - update_mask: field_mask_pb2.FieldMask = None, + session_entity_type: Optional[ + gcdc_session_entity_type.SessionEntityType + ] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_session_entity_type.SessionEntityType: r"""Updates the specified session entity type. @@ -646,7 +665,7 @@ async def sample_update_session_entity_type(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.UpdateSessionEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.UpdateSessionEntityTypeRequest, dict]]): The request object. The request message for [SessionEntityTypes.UpdateSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.UpdateSessionEntityType]. session_entity_type (:class:`google.cloud.dialogflowcx_v3beta1.types.SessionEntityType`): @@ -742,11 +761,13 @@ async def sample_update_session_entity_type(): async def delete_session_entity_type( self, - request: Union[session_entity_type.DeleteSessionEntityTypeRequest, dict] = None, + request: Optional[ + Union[session_entity_type.DeleteSessionEntityTypeRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified session entity type. @@ -775,7 +796,7 @@ async def sample_delete_session_entity_type(): await client.delete_session_entity_type(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.DeleteSessionEntityTypeRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.DeleteSessionEntityTypeRequest, dict]]): The request object. The request message for [SessionEntityTypes.DeleteSessionEntityType][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.DeleteSessionEntityType]. name (:class:`str`): @@ -837,10 +858,10 @@ async def sample_delete_session_entity_type(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -891,10 +912,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -945,10 +966,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -999,10 +1020,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1053,10 +1074,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1112,14 +1133,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SessionEntityTypesAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/client.py b/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/client.py index 8868487d..28131991 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -64,7 +76,7 @@ class SessionEntityTypesClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[SessionEntityTypesTransport]: """Returns an appropriate transport class. @@ -345,8 +357,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, SessionEntityTypesTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, SessionEntityTypesTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the session entity types client. @@ -360,7 +372,7 @@ def __init__( transport (Union[str, SessionEntityTypesTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -390,6 +402,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -442,11 +455,13 @@ def __init__( def list_session_entity_types( self, - request: Union[session_entity_type.ListSessionEntityTypesRequest, dict] = None, + request: Optional[ + Union[session_entity_type.ListSessionEntityTypesRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListSessionEntityTypesPager: r"""Returns the list of all session entity types in the @@ -565,11 +580,13 @@ def sample_list_session_entity_types(): def get_session_entity_type( self, - request: Union[session_entity_type.GetSessionEntityTypeRequest, dict] = None, + request: Optional[ + Union[session_entity_type.GetSessionEntityTypeRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session_entity_type.SessionEntityType: r"""Retrieves the specified session entity type. @@ -686,14 +703,16 @@ def sample_get_session_entity_type(): def create_session_entity_type( self, - request: Union[ - gcdc_session_entity_type.CreateSessionEntityTypeRequest, dict + request: Optional[ + Union[gcdc_session_entity_type.CreateSessionEntityTypeRequest, dict] ] = None, *, - parent: str = None, - session_entity_type: gcdc_session_entity_type.SessionEntityType = None, + parent: Optional[str] = None, + session_entity_type: Optional[ + gcdc_session_entity_type.SessionEntityType + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_session_entity_type.SessionEntityType: r"""Creates a session entity type. @@ -831,14 +850,16 @@ def sample_create_session_entity_type(): def update_session_entity_type( self, - request: Union[ - gcdc_session_entity_type.UpdateSessionEntityTypeRequest, dict + request: Optional[ + Union[gcdc_session_entity_type.UpdateSessionEntityTypeRequest, dict] ] = None, *, - session_entity_type: gcdc_session_entity_type.SessionEntityType = None, - update_mask: field_mask_pb2.FieldMask = None, + session_entity_type: Optional[ + gcdc_session_entity_type.SessionEntityType + ] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_session_entity_type.SessionEntityType: r"""Updates the specified session entity type. @@ -976,11 +997,13 @@ def sample_update_session_entity_type(): def delete_session_entity_type( self, - request: Union[session_entity_type.DeleteSessionEntityTypeRequest, dict] = None, + request: Optional[ + Union[session_entity_type.DeleteSessionEntityTypeRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified session entity type. @@ -1086,10 +1109,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1140,10 +1163,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1194,10 +1217,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1248,10 +1271,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1302,10 +1325,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1355,14 +1378,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SessionEntityTypesClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/base.py index 505483e8..736d9568 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class SessionEntityTypesTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/grpc.py index 8388d01a..a84a1887 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/grpc.py @@ -54,14 +54,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -188,8 +188,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/grpc_asyncio.py index 4b2a145c..229b02cc 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/session_entity_types/transports/grpc_asyncio.py @@ -56,7 +56,7 @@ class SessionEntityTypesGrpcAsyncIOTransport(SessionEntityTypesTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -99,15 +99,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/sessions/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/sessions/async_client.py index 99745ee5..d986c448 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/sessions/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/sessions/async_client.py @@ -19,6 +19,8 @@ from typing import ( Dict, Mapping, + MutableMapping, + MutableSequence, Optional, AsyncIterable, Awaitable, @@ -28,7 +30,8 @@ Type, Union, ) -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -190,9 +193,9 @@ def transport(self) -> SessionsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, SessionsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the sessions client. @@ -236,10 +239,10 @@ def __init__( async def detect_intent( self, - request: Union[session.DetectIntentRequest, dict] = None, + request: Optional[Union[session.DetectIntentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session.DetectIntentResponse: r"""Processes a natural language query and returns structured, @@ -283,7 +286,7 @@ async def sample_detect_intent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.DetectIntentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.DetectIntentRequest, dict]]): The request object. The request to detect user's intent. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -336,10 +339,10 @@ async def sample_detect_intent(): def streaming_detect_intent( self, - requests: AsyncIterator[session.StreamingDetectIntentRequest] = None, + requests: Optional[AsyncIterator[session.StreamingDetectIntentRequest]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> Awaitable[AsyncIterable[session.StreamingDetectIntentResponse]]: r"""Processes a natural language query in audio format in a @@ -492,10 +495,10 @@ def request_generator(): async def match_intent( self, - request: Union[session.MatchIntentRequest, dict] = None, + request: Optional[Union[session.MatchIntentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session.MatchIntentResponse: r"""Returns preliminary intent match results, doesn't @@ -533,7 +536,7 @@ async def sample_match_intent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.MatchIntentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.MatchIntentRequest, dict]]): The request object. Request of [MatchIntent][]. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -575,10 +578,10 @@ async def sample_match_intent(): async def fulfill_intent( self, - request: Union[session.FulfillIntentRequest, dict] = None, + request: Optional[Union[session.FulfillIntentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session.FulfillIntentResponse: r"""Fulfills a matched intent returned by @@ -615,7 +618,7 @@ async def sample_fulfill_intent(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.FulfillIntentRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.FulfillIntentRequest, dict]]): The request object. Request of [FulfillIntent][] retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -664,10 +667,10 @@ async def sample_fulfill_intent(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -718,10 +721,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -772,10 +775,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -826,10 +829,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -880,10 +883,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -939,14 +942,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SessionsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/sessions/client.py b/google/cloud/dialogflowcx_v3beta1/services/sessions/client.py index 65703be2..e0a29787 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/sessions/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/sessions/client.py @@ -19,6 +19,8 @@ from typing import ( Dict, Mapping, + MutableMapping, + MutableSequence, Optional, Iterable, Iterator, @@ -26,8 +28,10 @@ Tuple, Type, Union, + cast, ) -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -68,7 +72,7 @@ class SessionsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[SessionsTransport]: """Returns an appropriate transport class. @@ -549,8 +553,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, SessionsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, SessionsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the sessions client. @@ -564,7 +568,7 @@ def __init__( transport (Union[str, SessionsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -594,6 +598,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -646,10 +651,10 @@ def __init__( def detect_intent( self, - request: Union[session.DetectIntentRequest, dict] = None, + request: Optional[Union[session.DetectIntentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session.DetectIntentResponse: r"""Processes a natural language query and returns structured, @@ -738,10 +743,10 @@ def sample_detect_intent(): def streaming_detect_intent( self, - requests: Iterator[session.StreamingDetectIntentRequest] = None, + requests: Optional[Iterator[session.StreamingDetectIntentRequest]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> Iterable[session.StreamingDetectIntentResponse]: r"""Processes a natural language query in audio format in a @@ -890,10 +895,10 @@ def request_generator(): def match_intent( self, - request: Union[session.MatchIntentRequest, dict] = None, + request: Optional[Union[session.MatchIntentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session.MatchIntentResponse: r"""Returns preliminary intent match results, doesn't @@ -974,10 +979,10 @@ def sample_match_intent(): def fulfill_intent( self, - request: Union[session.FulfillIntentRequest, dict] = None, + request: Optional[Union[session.FulfillIntentRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> session.FulfillIntentResponse: r"""Fulfills a matched intent returned by @@ -1077,10 +1082,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1131,10 +1136,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1185,10 +1190,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1239,10 +1244,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1293,10 +1298,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1346,14 +1351,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SessionsClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/sessions/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/sessions/transports/base.py index f0ff6f5c..a61bf7c6 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/sessions/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/sessions/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -29,14 +30,9 @@ from google.cloud.location import locations_pb2 # type: ignore from google.longrunning import operations_pb2 -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class SessionsTransport(abc.ABC): @@ -53,7 +49,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/sessions/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/sessions/transports/grpc.py index b8d892d2..f8355688 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/sessions/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/sessions/transports/grpc.py @@ -52,14 +52,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -186,8 +186,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/sessions/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/sessions/transports/grpc_asyncio.py index d17cabb0..97fe3c59 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/sessions/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/sessions/transports/grpc_asyncio.py @@ -54,7 +54,7 @@ class SessionsGrpcAsyncIOTransport(SessionsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -97,15 +97,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/test_cases/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/test_cases/async_client.py index be959174..ce5dfad1 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/test_cases/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/test_cases/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -186,9 +197,9 @@ def transport(self) -> TestCasesTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, TestCasesTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the test cases client. @@ -232,11 +243,11 @@ def __init__( async def list_test_cases( self, - request: Union[test_case.ListTestCasesRequest, dict] = None, + request: Optional[Union[test_case.ListTestCasesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTestCasesAsyncPager: r"""Fetches a list of test cases for a given agent. @@ -269,7 +280,7 @@ async def sample_list_test_cases(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListTestCasesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListTestCasesRequest, dict]]): The request object. The request message for [TestCases.ListTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ListTestCases]. parent (:class:`str`): @@ -347,11 +358,11 @@ async def sample_list_test_cases(): async def batch_delete_test_cases( self, - request: Union[test_case.BatchDeleteTestCasesRequest, dict] = None, + request: Optional[Union[test_case.BatchDeleteTestCasesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Batch deletes test cases. @@ -381,7 +392,7 @@ async def sample_batch_delete_test_cases(): await client.batch_delete_test_cases(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.BatchDeleteTestCasesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.BatchDeleteTestCasesRequest, dict]]): The request object. The request message for [TestCases.BatchDeleteTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.BatchDeleteTestCases]. parent (:class:`str`): @@ -438,11 +449,11 @@ async def sample_batch_delete_test_cases(): async def get_test_case( self, - request: Union[test_case.GetTestCaseRequest, dict] = None, + request: Optional[Union[test_case.GetTestCaseRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> test_case.TestCase: r"""Gets a test case. @@ -474,7 +485,7 @@ async def sample_get_test_case(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetTestCaseRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetTestCaseRequest, dict]]): The request object. The request message for [TestCases.GetTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.GetTestCase]. name (:class:`str`): @@ -538,12 +549,12 @@ async def sample_get_test_case(): async def create_test_case( self, - request: Union[gcdc_test_case.CreateTestCaseRequest, dict] = None, + request: Optional[Union[gcdc_test_case.CreateTestCaseRequest, dict]] = None, *, - parent: str = None, - test_case: gcdc_test_case.TestCase = None, + parent: Optional[str] = None, + test_case: Optional[gcdc_test_case.TestCase] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_test_case.TestCase: r"""Creates a test case for the given agent. @@ -579,7 +590,7 @@ async def sample_create_test_case(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CreateTestCaseRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CreateTestCaseRequest, dict]]): The request object. The request message for [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.CreateTestCase]. parent (:class:`str`): @@ -650,12 +661,12 @@ async def sample_create_test_case(): async def update_test_case( self, - request: Union[gcdc_test_case.UpdateTestCaseRequest, dict] = None, + request: Optional[Union[gcdc_test_case.UpdateTestCaseRequest, dict]] = None, *, - test_case: gcdc_test_case.TestCase = None, - update_mask: field_mask_pb2.FieldMask = None, + test_case: Optional[gcdc_test_case.TestCase] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_test_case.TestCase: r"""Updates the specified test case. @@ -690,7 +701,7 @@ async def sample_update_test_case(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.UpdateTestCaseRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.UpdateTestCaseRequest, dict]]): The request object. The request message for [TestCases.UpdateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.UpdateTestCase]. test_case (:class:`google.cloud.dialogflowcx_v3beta1.types.TestCase`): @@ -767,10 +778,10 @@ async def sample_update_test_case(): async def run_test_case( self, - request: Union[test_case.RunTestCaseRequest, dict] = None, + request: Optional[Union[test_case.RunTestCaseRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Kicks off a test case run. @@ -810,13 +821,13 @@ async def sample_run_test_case(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.RunTestCaseRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.RunTestCaseRequest, dict]]): The request object. The request message for [TestCases.RunTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.RunTestCase]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -873,10 +884,10 @@ async def sample_run_test_case(): async def batch_run_test_cases( self, - request: Union[test_case.BatchRunTestCasesRequest, dict] = None, + request: Optional[Union[test_case.BatchRunTestCasesRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Kicks off a batch run of test cases. @@ -917,13 +928,13 @@ async def sample_batch_run_test_cases(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.BatchRunTestCasesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.BatchRunTestCasesRequest, dict]]): The request object. The request message for [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.BatchRunTestCases]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -980,10 +991,10 @@ async def sample_batch_run_test_cases(): async def calculate_coverage( self, - request: Union[test_case.CalculateCoverageRequest, dict] = None, + request: Optional[Union[test_case.CalculateCoverageRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> test_case.CalculateCoverageResponse: r"""Calculates the test coverage for an agent. @@ -1016,7 +1027,7 @@ async def sample_calculate_coverage(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CalculateCoverageRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CalculateCoverageRequest, dict]]): The request object. The request message for [TestCases.CalculateCoverage][google.cloud.dialogflow.cx.v3beta1.TestCases.CalculateCoverage]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1061,10 +1072,10 @@ async def sample_calculate_coverage(): async def import_test_cases( self, - request: Union[test_case.ImportTestCasesRequest, dict] = None, + request: Optional[Union[test_case.ImportTestCasesRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Imports the test cases from a Cloud Storage bucket or a local @@ -1108,13 +1119,13 @@ async def sample_import_test_cases(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ImportTestCasesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ImportTestCasesRequest, dict]]): The request object. The request message for [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ImportTestCases]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1171,10 +1182,10 @@ async def sample_import_test_cases(): async def export_test_cases( self, - request: Union[test_case.ExportTestCasesRequest, dict] = None, + request: Optional[Union[test_case.ExportTestCasesRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Exports the test cases under the agent to a Cloud Storage bucket @@ -1217,13 +1228,13 @@ async def sample_export_test_cases(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ExportTestCasesRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ExportTestCasesRequest, dict]]): The request object. The request message for [TestCases.ExportTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ExportTestCases]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1280,11 +1291,11 @@ async def sample_export_test_cases(): async def list_test_case_results( self, - request: Union[test_case.ListTestCaseResultsRequest, dict] = None, + request: Optional[Union[test_case.ListTestCaseResultsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTestCaseResultsAsyncPager: r"""Fetches a list of results for a given test case. @@ -1317,7 +1328,7 @@ async def sample_list_test_case_results(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListTestCaseResultsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListTestCaseResultsRequest, dict]]): The request object. The request message for [TestCases.ListTestCaseResults][google.cloud.dialogflow.cx.v3beta1.TestCases.ListTestCaseResults]. parent (:class:`str`): @@ -1397,11 +1408,11 @@ async def sample_list_test_case_results(): async def get_test_case_result( self, - request: Union[test_case.GetTestCaseResultRequest, dict] = None, + request: Optional[Union[test_case.GetTestCaseResultRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> test_case.TestCaseResult: r"""Gets a test case result. @@ -1433,7 +1444,7 @@ async def sample_get_test_case_result(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetTestCaseResultRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetTestCaseResultRequest, dict]]): The request object. The request message for [TestCases.GetTestCaseResult][google.cloud.dialogflow.cx.v3beta1.TestCases.GetTestCaseResult]. name (:class:`str`): @@ -1499,10 +1510,10 @@ async def sample_get_test_case_result(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1553,10 +1564,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1607,10 +1618,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1661,10 +1672,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1715,10 +1726,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1774,14 +1785,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("TestCasesAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/test_cases/client.py b/google/cloud/dialogflowcx_v3beta1/services/test_cases/client.py index f463b195..50d8bd1d 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/test_cases/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/test_cases/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -62,7 +74,7 @@ class TestCasesClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[TestCasesTransport]: """Returns an appropriate transport class. @@ -562,8 +574,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, TestCasesTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, TestCasesTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the test cases client. @@ -577,7 +589,7 @@ def __init__( transport (Union[str, TestCasesTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -607,6 +619,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -659,11 +672,11 @@ def __init__( def list_test_cases( self, - request: Union[test_case.ListTestCasesRequest, dict] = None, + request: Optional[Union[test_case.ListTestCasesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTestCasesPager: r"""Fetches a list of test cases for a given agent. @@ -774,11 +787,11 @@ def sample_list_test_cases(): def batch_delete_test_cases( self, - request: Union[test_case.BatchDeleteTestCasesRequest, dict] = None, + request: Optional[Union[test_case.BatchDeleteTestCasesRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Batch deletes test cases. @@ -865,11 +878,11 @@ def sample_batch_delete_test_cases(): def get_test_case( self, - request: Union[test_case.GetTestCaseRequest, dict] = None, + request: Optional[Union[test_case.GetTestCaseRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> test_case.TestCase: r"""Gets a test case. @@ -965,12 +978,12 @@ def sample_get_test_case(): def create_test_case( self, - request: Union[gcdc_test_case.CreateTestCaseRequest, dict] = None, + request: Optional[Union[gcdc_test_case.CreateTestCaseRequest, dict]] = None, *, - parent: str = None, - test_case: gcdc_test_case.TestCase = None, + parent: Optional[str] = None, + test_case: Optional[gcdc_test_case.TestCase] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_test_case.TestCase: r"""Creates a test case for the given agent. @@ -1077,12 +1090,12 @@ def sample_create_test_case(): def update_test_case( self, - request: Union[gcdc_test_case.UpdateTestCaseRequest, dict] = None, + request: Optional[Union[gcdc_test_case.UpdateTestCaseRequest, dict]] = None, *, - test_case: gcdc_test_case.TestCase = None, - update_mask: field_mask_pb2.FieldMask = None, + test_case: Optional[gcdc_test_case.TestCase] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_test_case.TestCase: r"""Updates the specified test case. @@ -1194,10 +1207,10 @@ def sample_update_test_case(): def run_test_case( self, - request: Union[test_case.RunTestCaseRequest, dict] = None, + request: Optional[Union[test_case.RunTestCaseRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Kicks off a test case run. @@ -1301,10 +1314,10 @@ def sample_run_test_case(): def batch_run_test_cases( self, - request: Union[test_case.BatchRunTestCasesRequest, dict] = None, + request: Optional[Union[test_case.BatchRunTestCasesRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Kicks off a batch run of test cases. @@ -1409,10 +1422,10 @@ def sample_batch_run_test_cases(): def calculate_coverage( self, - request: Union[test_case.CalculateCoverageRequest, dict] = None, + request: Optional[Union[test_case.CalculateCoverageRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> test_case.CalculateCoverageResponse: r"""Calculates the test coverage for an agent. @@ -1491,10 +1504,10 @@ def sample_calculate_coverage(): def import_test_cases( self, - request: Union[test_case.ImportTestCasesRequest, dict] = None, + request: Optional[Union[test_case.ImportTestCasesRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Imports the test cases from a Cloud Storage bucket or a local @@ -1602,10 +1615,10 @@ def sample_import_test_cases(): def export_test_cases( self, - request: Union[test_case.ExportTestCasesRequest, dict] = None, + request: Optional[Union[test_case.ExportTestCasesRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Exports the test cases under the agent to a Cloud Storage bucket @@ -1712,11 +1725,11 @@ def sample_export_test_cases(): def list_test_case_results( self, - request: Union[test_case.ListTestCaseResultsRequest, dict] = None, + request: Optional[Union[test_case.ListTestCaseResultsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTestCaseResultsPager: r"""Fetches a list of results for a given test case. @@ -1829,11 +1842,11 @@ def sample_list_test_case_results(): def get_test_case_result( self, - request: Union[test_case.GetTestCaseResultRequest, dict] = None, + request: Optional[Union[test_case.GetTestCaseResultRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> test_case.TestCaseResult: r"""Gets a test case result. @@ -1944,10 +1957,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1998,10 +2011,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -2052,10 +2065,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -2106,10 +2119,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -2160,10 +2173,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -2213,14 +2226,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("TestCasesClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/base.py index 0972e0e5..e9e7bf08 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class TestCasesTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/grpc.py index ac7bb978..4a6d2723 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/grpc.py @@ -55,14 +55,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -190,8 +190,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/grpc_asyncio.py index 2e031521..ab207912 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/grpc_asyncio.py @@ -57,7 +57,7 @@ class TestCasesGrpcAsyncIOTransport(TestCasesTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -100,15 +100,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/async_client.py index ad2a197b..62364e55 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -182,9 +193,9 @@ def transport(self) -> TransitionRouteGroupsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, TransitionRouteGroupsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the transition route groups client. @@ -228,13 +239,13 @@ def __init__( async def list_transition_route_groups( self, - request: Union[ - transition_route_group.ListTransitionRouteGroupsRequest, dict + request: Optional[ + Union[transition_route_group.ListTransitionRouteGroupsRequest, dict] ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTransitionRouteGroupsAsyncPager: r"""Returns the list of all transition route groups in @@ -268,7 +279,7 @@ async def sample_list_transition_route_groups(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListTransitionRouteGroupsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListTransitionRouteGroupsRequest, dict]]): The request object. The request message for [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroups]. parent (:class:`str`): @@ -347,13 +358,13 @@ async def sample_list_transition_route_groups(): async def get_transition_route_group( self, - request: Union[ - transition_route_group.GetTransitionRouteGroupRequest, dict + request: Optional[ + Union[transition_route_group.GetTransitionRouteGroupRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> transition_route_group.TransitionRouteGroup: r"""Retrieves the specified @@ -386,7 +397,7 @@ async def sample_get_transition_route_group(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetTransitionRouteGroupRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetTransitionRouteGroupRequest, dict]]): The request object. The request message for [TransitionRouteGroups.GetTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.GetTransitionRouteGroup]. name (:class:`str`): @@ -456,14 +467,16 @@ async def sample_get_transition_route_group(): async def create_transition_route_group( self, - request: Union[ - gcdc_transition_route_group.CreateTransitionRouteGroupRequest, dict + request: Optional[ + Union[gcdc_transition_route_group.CreateTransitionRouteGroupRequest, dict] ] = None, *, - parent: str = None, - transition_route_group: gcdc_transition_route_group.TransitionRouteGroup = None, + parent: Optional[str] = None, + transition_route_group: Optional[ + gcdc_transition_route_group.TransitionRouteGroup + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_transition_route_group.TransitionRouteGroup: r"""Creates an @@ -505,7 +518,7 @@ async def sample_create_transition_route_group(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CreateTransitionRouteGroupRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CreateTransitionRouteGroupRequest, dict]]): The request object. The request message for [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.CreateTransitionRouteGroup]. parent (:class:`str`): @@ -584,14 +597,16 @@ async def sample_create_transition_route_group(): async def update_transition_route_group( self, - request: Union[ - gcdc_transition_route_group.UpdateTransitionRouteGroupRequest, dict + request: Optional[ + Union[gcdc_transition_route_group.UpdateTransitionRouteGroupRequest, dict] ] = None, *, - transition_route_group: gcdc_transition_route_group.TransitionRouteGroup = None, - update_mask: field_mask_pb2.FieldMask = None, + transition_route_group: Optional[ + gcdc_transition_route_group.TransitionRouteGroup + ] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_transition_route_group.TransitionRouteGroup: r"""Updates the specified @@ -631,7 +646,7 @@ async def sample_update_transition_route_group(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.UpdateTransitionRouteGroupRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.UpdateTransitionRouteGroupRequest, dict]]): The request object. The request message for [TransitionRouteGroups.UpdateTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.UpdateTransitionRouteGroup]. transition_route_group (:class:`google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroup`): @@ -710,13 +725,13 @@ async def sample_update_transition_route_group(): async def delete_transition_route_group( self, - request: Union[ - transition_route_group.DeleteTransitionRouteGroupRequest, dict + request: Optional[ + Union[transition_route_group.DeleteTransitionRouteGroupRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -750,7 +765,7 @@ async def sample_delete_transition_route_group(): await client.delete_transition_route_group(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.DeleteTransitionRouteGroupRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.DeleteTransitionRouteGroupRequest, dict]]): The request object. The request message for [TransitionRouteGroups.DeleteTransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.DeleteTransitionRouteGroup]. name (:class:`str`): @@ -809,10 +824,10 @@ async def sample_delete_transition_route_group(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -863,10 +878,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -917,10 +932,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -971,10 +986,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1025,10 +1040,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1084,14 +1099,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("TransitionRouteGroupsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/client.py b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/client.py index 7b9c3e82..c6647fa4 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -64,7 +76,7 @@ class TransitionRouteGroupsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[TransitionRouteGroupsTransport]: """Returns an appropriate transport class. @@ -443,8 +455,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, TransitionRouteGroupsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, TransitionRouteGroupsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the transition route groups client. @@ -458,7 +470,7 @@ def __init__( transport (Union[str, TransitionRouteGroupsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -488,6 +500,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -540,13 +553,13 @@ def __init__( def list_transition_route_groups( self, - request: Union[ - transition_route_group.ListTransitionRouteGroupsRequest, dict + request: Optional[ + Union[transition_route_group.ListTransitionRouteGroupsRequest, dict] ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTransitionRouteGroupsPager: r"""Returns the list of all transition route groups in @@ -663,13 +676,13 @@ def sample_list_transition_route_groups(): def get_transition_route_group( self, - request: Union[ - transition_route_group.GetTransitionRouteGroupRequest, dict + request: Optional[ + Union[transition_route_group.GetTransitionRouteGroupRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> transition_route_group.TransitionRouteGroup: r"""Retrieves the specified @@ -776,14 +789,16 @@ def sample_get_transition_route_group(): def create_transition_route_group( self, - request: Union[ - gcdc_transition_route_group.CreateTransitionRouteGroupRequest, dict + request: Optional[ + Union[gcdc_transition_route_group.CreateTransitionRouteGroupRequest, dict] ] = None, *, - parent: str = None, - transition_route_group: gcdc_transition_route_group.TransitionRouteGroup = None, + parent: Optional[str] = None, + transition_route_group: Optional[ + gcdc_transition_route_group.TransitionRouteGroup + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_transition_route_group.TransitionRouteGroup: r"""Creates an @@ -910,14 +925,16 @@ def sample_create_transition_route_group(): def update_transition_route_group( self, - request: Union[ - gcdc_transition_route_group.UpdateTransitionRouteGroupRequest, dict + request: Optional[ + Union[gcdc_transition_route_group.UpdateTransitionRouteGroupRequest, dict] ] = None, *, - transition_route_group: gcdc_transition_route_group.TransitionRouteGroup = None, - update_mask: field_mask_pb2.FieldMask = None, + transition_route_group: Optional[ + gcdc_transition_route_group.TransitionRouteGroup + ] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_transition_route_group.TransitionRouteGroup: r"""Updates the specified @@ -1042,13 +1059,13 @@ def sample_update_transition_route_group(): def delete_transition_route_group( self, - request: Union[ - transition_route_group.DeleteTransitionRouteGroupRequest, dict + request: Optional[ + Union[transition_route_group.DeleteTransitionRouteGroupRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -1158,10 +1175,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1212,10 +1229,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1266,10 +1283,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1320,10 +1337,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1374,10 +1391,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1427,14 +1444,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("TransitionRouteGroupsClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/base.py index b68185a7..b2b9abec 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class TransitionRouteGroupsTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/grpc.py index 1c480836..2c69332a 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/grpc.py @@ -54,14 +54,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -188,8 +188,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/grpc_asyncio.py index 278e96ab..c5213e35 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/transition_route_groups/transports/grpc_asyncio.py @@ -56,7 +56,7 @@ class TransitionRouteGroupsGrpcAsyncIOTransport(TransitionRouteGroupsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -99,15 +99,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/versions/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/versions/async_client.py index 687d08bc..65da48e2 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/versions/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/versions/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -162,9 +173,9 @@ def transport(self) -> VersionsTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, VersionsTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the versions client. @@ -208,11 +219,11 @@ def __init__( async def list_versions( self, - request: Union[version.ListVersionsRequest, dict] = None, + request: Optional[Union[version.ListVersionsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListVersionsAsyncPager: r"""Returns the list of all versions in the specified @@ -246,7 +257,7 @@ async def sample_list_versions(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListVersionsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListVersionsRequest, dict]]): The request object. The request message for [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions]. parent (:class:`str`): @@ -326,11 +337,11 @@ async def sample_list_versions(): async def get_version( self, - request: Union[version.GetVersionRequest, dict] = None, + request: Optional[Union[version.GetVersionRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> version.Version: r"""Retrieves the specified @@ -363,7 +374,7 @@ async def sample_get_version(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetVersionRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetVersionRequest, dict]]): The request object. The request message for [Versions.GetVersion][google.cloud.dialogflow.cx.v3beta1.Versions.GetVersion]. name (:class:`str`): @@ -429,12 +440,12 @@ async def sample_get_version(): async def create_version( self, - request: Union[gcdc_version.CreateVersionRequest, dict] = None, + request: Optional[Union[gcdc_version.CreateVersionRequest, dict]] = None, *, - parent: str = None, - version: gcdc_version.Version = None, + parent: Optional[str] = None, + version: Optional[gcdc_version.Version] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] @@ -480,13 +491,13 @@ async def sample_create_version(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CreateVersionRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CreateVersionRequest, dict]]): The request object. The request message for [Versions.CreateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.CreateVersion]. parent (:class:`str`): @@ -574,12 +585,12 @@ async def sample_create_version(): async def update_version( self, - request: Union[gcdc_version.UpdateVersionRequest, dict] = None, + request: Optional[Union[gcdc_version.UpdateVersionRequest, dict]] = None, *, - version: gcdc_version.Version = None, - update_mask: field_mask_pb2.FieldMask = None, + version: Optional[gcdc_version.Version] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_version.Version: r"""Updates the specified @@ -615,7 +626,7 @@ async def sample_update_version(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.UpdateVersionRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.UpdateVersionRequest, dict]]): The request object. The request message for [Versions.UpdateVersion][google.cloud.dialogflow.cx.v3beta1.Versions.UpdateVersion]. version (:class:`google.cloud.dialogflowcx_v3beta1.types.Version`): @@ -689,11 +700,11 @@ async def sample_update_version(): async def delete_version( self, - request: Union[version.DeleteVersionRequest, dict] = None, + request: Optional[Union[version.DeleteVersionRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -723,7 +734,7 @@ async def sample_delete_version(): await client.delete_version(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.DeleteVersionRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.DeleteVersionRequest, dict]]): The request object. The request message for [Versions.DeleteVersion][google.cloud.dialogflow.cx.v3beta1.Versions.DeleteVersion]. name (:class:`str`): @@ -782,11 +793,11 @@ async def sample_delete_version(): async def load_version( self, - request: Union[version.LoadVersionRequest, dict] = None, + request: Optional[Union[version.LoadVersionRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Loads resources in the specified version to the draft flow. @@ -826,13 +837,13 @@ async def sample_load_version(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.LoadVersionRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.LoadVersionRequest, dict]]): The request object. The request message for [Versions.LoadVersion][google.cloud.dialogflow.cx.v3beta1.Versions.LoadVersion]. name (:class:`str`): @@ -918,11 +929,11 @@ async def sample_load_version(): async def compare_versions( self, - request: Union[version.CompareVersionsRequest, dict] = None, + request: Optional[Union[version.CompareVersionsRequest, dict]] = None, *, - base_version: str = None, + base_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> version.CompareVersionsResponse: r"""Compares the specified base version with target @@ -956,7 +967,7 @@ async def sample_compare_versions(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CompareVersionsRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CompareVersionsRequest, dict]]): The request object. The request message for [Versions.CompareVersions][google.cloud.dialogflow.cx.v3beta1.Versions.CompareVersions]. base_version (:class:`str`): @@ -1028,10 +1039,10 @@ async def sample_compare_versions(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1082,10 +1093,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1136,10 +1147,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1190,10 +1201,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1244,10 +1255,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1303,14 +1314,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("VersionsAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/versions/client.py b/google/cloud/dialogflowcx_v3beta1/services/versions/client.py index b2427001..57fd08a0 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/versions/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/versions/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -65,7 +77,7 @@ class VersionsClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[VersionsTransport]: """Returns an appropriate transport class. @@ -346,8 +358,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, VersionsTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, VersionsTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the versions client. @@ -361,7 +373,7 @@ def __init__( transport (Union[str, VersionsTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -391,6 +403,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -443,11 +456,11 @@ def __init__( def list_versions( self, - request: Union[version.ListVersionsRequest, dict] = None, + request: Optional[Union[version.ListVersionsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListVersionsPager: r"""Returns the list of all versions in the specified @@ -561,11 +574,11 @@ def sample_list_versions(): def get_version( self, - request: Union[version.GetVersionRequest, dict] = None, + request: Optional[Union[version.GetVersionRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> version.Version: r"""Retrieves the specified @@ -664,12 +677,12 @@ def sample_get_version(): def create_version( self, - request: Union[gcdc_version.CreateVersionRequest, dict] = None, + request: Optional[Union[gcdc_version.CreateVersionRequest, dict]] = None, *, - parent: str = None, - version: gcdc_version.Version = None, + parent: Optional[str] = None, + version: Optional[gcdc_version.Version] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] @@ -809,12 +822,12 @@ def sample_create_version(): def update_version( self, - request: Union[gcdc_version.UpdateVersionRequest, dict] = None, + request: Optional[Union[gcdc_version.UpdateVersionRequest, dict]] = None, *, - version: gcdc_version.Version = None, - update_mask: field_mask_pb2.FieldMask = None, + version: Optional[gcdc_version.Version] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_version.Version: r"""Updates the specified @@ -924,11 +937,11 @@ def sample_update_version(): def delete_version( self, - request: Union[version.DeleteVersionRequest, dict] = None, + request: Optional[Union[version.DeleteVersionRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified @@ -1017,11 +1030,11 @@ def sample_delete_version(): def load_version( self, - request: Union[version.LoadVersionRequest, dict] = None, + request: Optional[Union[version.LoadVersionRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Loads resources in the specified version to the draft flow. @@ -1153,11 +1166,11 @@ def sample_load_version(): def compare_versions( self, - request: Union[version.CompareVersionsRequest, dict] = None, + request: Optional[Union[version.CompareVersionsRequest, dict]] = None, *, - base_version: str = None, + base_version: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> version.CompareVersionsResponse: r"""Compares the specified base version with target @@ -1276,10 +1289,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1330,10 +1343,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1384,10 +1397,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1438,10 +1451,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1492,10 +1505,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1545,14 +1558,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("VersionsClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/versions/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/versions/transports/base.py index b6c50f4f..c94fc828 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/versions/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/versions/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -33,14 +34,9 @@ from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class VersionsTransport(abc.ABC): @@ -57,7 +53,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/versions/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/versions/transports/grpc.py index b62eae6a..82d2a45d 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/versions/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/versions/transports/grpc.py @@ -54,14 +54,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -189,8 +189,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/versions/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/versions/transports/grpc_asyncio.py index 611c39fc..7a15c812 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/versions/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/versions/transports/grpc_asyncio.py @@ -56,7 +56,7 @@ class VersionsGrpcAsyncIOTransport(VersionsTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -99,15 +99,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/webhooks/async_client.py b/google/cloud/dialogflowcx_v3beta1/services/webhooks/async_client.py index 3baecc00..540e4f64 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/webhooks/async_client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/webhooks/async_client.py @@ -16,8 +16,19 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -159,9 +170,9 @@ def transport(self) -> WebhooksTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, WebhooksTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the webhooks client. @@ -205,11 +216,11 @@ def __init__( async def list_webhooks( self, - request: Union[webhook.ListWebhooksRequest, dict] = None, + request: Optional[Union[webhook.ListWebhooksRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListWebhooksAsyncPager: r"""Returns the list of all webhooks in the specified @@ -243,7 +254,7 @@ async def sample_list_webhooks(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.ListWebhooksRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.ListWebhooksRequest, dict]]): The request object. The request message for [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks]. parent (:class:`str`): @@ -321,11 +332,11 @@ async def sample_list_webhooks(): async def get_webhook( self, - request: Union[webhook.GetWebhookRequest, dict] = None, + request: Optional[Union[webhook.GetWebhookRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> webhook.Webhook: r"""Retrieves the specified webhook. @@ -357,7 +368,7 @@ async def sample_get_webhook(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.GetWebhookRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.GetWebhookRequest, dict]]): The request object. The request message for [Webhooks.GetWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.GetWebhook]. name (:class:`str`): @@ -428,12 +439,12 @@ async def sample_get_webhook(): async def create_webhook( self, - request: Union[gcdc_webhook.CreateWebhookRequest, dict] = None, + request: Optional[Union[gcdc_webhook.CreateWebhookRequest, dict]] = None, *, - parent: str = None, - webhook: gcdc_webhook.Webhook = None, + parent: Optional[str] = None, + webhook: Optional[gcdc_webhook.Webhook] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_webhook.Webhook: r"""Creates a webhook in the specified agent. @@ -470,7 +481,7 @@ async def sample_create_webhook(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.CreateWebhookRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.CreateWebhookRequest, dict]]): The request object. The request message for [Webhooks.CreateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.CreateWebhook]. parent (:class:`str`): @@ -548,12 +559,12 @@ async def sample_create_webhook(): async def update_webhook( self, - request: Union[gcdc_webhook.UpdateWebhookRequest, dict] = None, + request: Optional[Union[gcdc_webhook.UpdateWebhookRequest, dict]] = None, *, - webhook: gcdc_webhook.Webhook = None, - update_mask: field_mask_pb2.FieldMask = None, + webhook: Optional[gcdc_webhook.Webhook] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_webhook.Webhook: r"""Updates the specified webhook. @@ -589,7 +600,7 @@ async def sample_update_webhook(): print(response) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.UpdateWebhookRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.UpdateWebhookRequest, dict]]): The request object. The request message for [Webhooks.UpdateWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.UpdateWebhook]. webhook (:class:`google.cloud.dialogflowcx_v3beta1.types.Webhook`): @@ -670,11 +681,11 @@ async def sample_update_webhook(): async def delete_webhook( self, - request: Union[webhook.DeleteWebhookRequest, dict] = None, + request: Optional[Union[webhook.DeleteWebhookRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified webhook. @@ -703,7 +714,7 @@ async def sample_delete_webhook(): await client.delete_webhook(request=request) Args: - request (Union[google.cloud.dialogflowcx_v3beta1.types.DeleteWebhookRequest, dict]): + request (Optional[Union[google.cloud.dialogflowcx_v3beta1.types.DeleteWebhookRequest, dict]]): The request object. The request message for [Webhooks.DeleteWebhook][google.cloud.dialogflow.cx.v3beta1.Webhooks.DeleteWebhook]. name (:class:`str`): @@ -760,10 +771,10 @@ async def sample_delete_webhook(): async def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -814,10 +825,10 @@ async def list_operations( async def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -868,10 +879,10 @@ async def get_operation( async def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -922,10 +933,10 @@ async def cancel_operation( async def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -976,10 +987,10 @@ async def get_location( async def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1035,14 +1046,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("WebhooksAsyncClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/webhooks/client.py b/google/cloud/dialogflowcx_v3beta1/services/webhooks/client.py index 3fefb801..a53d7883 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/webhooks/client.py +++ b/google/cloud/dialogflowcx_v3beta1/services/webhooks/client.py @@ -16,8 +16,20 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -60,7 +72,7 @@ class WebhooksClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[WebhooksTransport]: """Returns an appropriate transport class. @@ -363,8 +375,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, WebhooksTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, WebhooksTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the webhooks client. @@ -378,7 +390,7 @@ def __init__( transport (Union[str, WebhooksTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -408,6 +420,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -460,11 +473,11 @@ def __init__( def list_webhooks( self, - request: Union[webhook.ListWebhooksRequest, dict] = None, + request: Optional[Union[webhook.ListWebhooksRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListWebhooksPager: r"""Returns the list of all webhooks in the specified @@ -576,11 +589,11 @@ def sample_list_webhooks(): def get_webhook( self, - request: Union[webhook.GetWebhookRequest, dict] = None, + request: Optional[Union[webhook.GetWebhookRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> webhook.Webhook: r"""Retrieves the specified webhook. @@ -683,12 +696,12 @@ def sample_get_webhook(): def create_webhook( self, - request: Union[gcdc_webhook.CreateWebhookRequest, dict] = None, + request: Optional[Union[gcdc_webhook.CreateWebhookRequest, dict]] = None, *, - parent: str = None, - webhook: gcdc_webhook.Webhook = None, + parent: Optional[str] = None, + webhook: Optional[gcdc_webhook.Webhook] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_webhook.Webhook: r"""Creates a webhook in the specified agent. @@ -803,12 +816,12 @@ def sample_create_webhook(): def update_webhook( self, - request: Union[gcdc_webhook.UpdateWebhookRequest, dict] = None, + request: Optional[Union[gcdc_webhook.UpdateWebhookRequest, dict]] = None, *, - webhook: gcdc_webhook.Webhook = None, - update_mask: field_mask_pb2.FieldMask = None, + webhook: Optional[gcdc_webhook.Webhook] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcdc_webhook.Webhook: r"""Updates the specified webhook. @@ -925,11 +938,11 @@ def sample_update_webhook(): def delete_webhook( self, - request: Union[webhook.DeleteWebhookRequest, dict] = None, + request: Optional[Union[webhook.DeleteWebhookRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes the specified webhook. @@ -1028,10 +1041,10 @@ def __exit__(self, type, value, traceback): def list_operations( self, - request: operations_pb2.ListOperationsRequest = None, + request: Optional[operations_pb2.ListOperationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.ListOperationsResponse: r"""Lists operations that match the specified filter in the request. @@ -1082,10 +1095,10 @@ def list_operations( def get_operation( self, - request: operations_pb2.GetOperationRequest = None, + request: Optional[operations_pb2.GetOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: r"""Gets the latest state of a long-running operation. @@ -1136,10 +1149,10 @@ def get_operation( def cancel_operation( self, - request: operations_pb2.CancelOperationRequest = None, + request: Optional[operations_pb2.CancelOperationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Starts asynchronous cancellation on a long-running operation. @@ -1190,10 +1203,10 @@ def cancel_operation( def get_location( self, - request: locations_pb2.GetLocationRequest = None, + request: Optional[locations_pb2.GetLocationRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.Location: r"""Gets information about a location. @@ -1244,10 +1257,10 @@ def get_location( def list_locations( self, - request: locations_pb2.ListLocationsRequest = None, + request: Optional[locations_pb2.ListLocationsRequest] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> locations_pb2.ListLocationsResponse: r"""Lists information about the supported locations for this service. @@ -1297,14 +1310,9 @@ def list_locations( return response -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("WebhooksClient",) diff --git a/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/base.py b/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/base.py index 3d1e47bd..a32860af 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/base.py +++ b/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/base.py @@ -15,7 +15,8 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources + +from google.cloud.dialogflowcx_v3beta1 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -31,14 +32,9 @@ from google.longrunning import operations_pb2 from google.protobuf import empty_pb2 # type: ignore -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-dialogflowcx", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class WebhooksTransport(abc.ABC): @@ -55,7 +51,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/grpc.py b/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/grpc.py index f43049e0..688274d4 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/grpc.py +++ b/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/grpc.py @@ -52,14 +52,14 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -186,8 +186,8 @@ def __init__( def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/grpc_asyncio.py b/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/grpc_asyncio.py index e2fa5c01..42a94ba6 100644 --- a/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/grpc_asyncio.py +++ b/google/cloud/dialogflowcx_v3beta1/services/webhooks/transports/grpc_asyncio.py @@ -54,7 +54,7 @@ class WebhooksGrpcAsyncIOTransport(WebhooksTransport): def create_channel( cls, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -97,15 +97,15 @@ def __init__( self, *, host: str = "dialogflow.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/dialogflowcx_v3beta1/types/advanced_settings.py b/google/cloud/dialogflowcx_v3beta1/types/advanced_settings.py index de762af7..03921ec2 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/advanced_settings.py +++ b/google/cloud/dialogflowcx_v3beta1/types/advanced_settings.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore @@ -59,16 +61,16 @@ class LoggingSettings(proto.Message): enabled. """ - enable_stackdriver_logging = proto.Field( + enable_stackdriver_logging: bool = proto.Field( proto.BOOL, number=2, ) - enable_interaction_logging = proto.Field( + enable_interaction_logging: bool = proto.Field( proto.BOOL, number=3, ) - logging_settings = proto.Field( + logging_settings: LoggingSettings = proto.Field( proto.MESSAGE, number=6, message=LoggingSettings, diff --git a/google/cloud/dialogflowcx_v3beta1/types/agent.py b/google/cloud/dialogflowcx_v3beta1/types/agent.py index 2d284221..583874d4 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/agent.py +++ b/google/cloud/dialogflowcx_v3beta1/types/agent.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3beta1.types import ( @@ -52,7 +54,7 @@ class SpeechToTextSettings(proto.Message): recognition. """ - enable_speech_adaptation = proto.Field( + enable_speech_adaptation: bool = proto.Field( proto.BOOL, number=1, ) @@ -91,7 +93,7 @@ class Agent(proto.Message): field cannot be set by the [Agents.UpdateAgent][google.cloud.dialogflow.cx.v3beta1.Agents.UpdateAgent] method. - supported_language_codes (Sequence[str]): + supported_language_codes (MutableSequence[str]): The list of all languages supported by the agent (except for the ``default_language_code``). time_zone (str): @@ -139,60 +141,60 @@ class Agent(proto.Message): level. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - default_language_code = proto.Field( + default_language_code: str = proto.Field( proto.STRING, number=3, ) - supported_language_codes = proto.RepeatedField( + supported_language_codes: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=4, ) - time_zone = proto.Field( + time_zone: str = proto.Field( proto.STRING, number=5, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=6, ) - avatar_uri = proto.Field( + avatar_uri: str = proto.Field( proto.STRING, number=7, ) - speech_to_text_settings = proto.Field( + speech_to_text_settings: "SpeechToTextSettings" = proto.Field( proto.MESSAGE, number=13, message="SpeechToTextSettings", ) - start_flow = proto.Field( + start_flow: str = proto.Field( proto.STRING, number=16, ) - security_settings = proto.Field( + security_settings: str = proto.Field( proto.STRING, number=17, ) - enable_stackdriver_logging = proto.Field( + enable_stackdriver_logging: bool = proto.Field( proto.BOOL, number=18, ) - enable_spell_correction = proto.Field( + enable_spell_correction: bool = proto.Field( proto.BOOL, number=20, ) - locked = proto.Field( + locked: bool = proto.Field( proto.BOOL, number=27, ) - advanced_settings = proto.Field( + advanced_settings: gcdc_advanced_settings.AdvancedSettings = proto.Field( proto.MESSAGE, number=22, message=gcdc_advanced_settings.AdvancedSettings, @@ -215,15 +217,15 @@ class ListAgentsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -234,7 +236,7 @@ class ListAgentsResponse(proto.Message): [Agents.ListAgents][google.cloud.dialogflow.cx.v3beta1.Agents.ListAgents]. Attributes: - agents (Sequence[google.cloud.dialogflowcx_v3beta1.types.Agent]): + agents (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Agent]): The list of agents. There will be a maximum number of items returned based on the page_size field in the request. next_page_token (str): @@ -247,12 +249,12 @@ class ListAgentsResponse(proto.Message): def raw_page(self): return self - agents = proto.RepeatedField( + agents: MutableSequence["Agent"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Agent", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -268,7 +270,7 @@ class GetAgentRequest(proto.Message): ``projects//locations//agents/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -286,11 +288,11 @@ class CreateAgentRequest(proto.Message): Required. The agent to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - agent = proto.Field( + agent: "Agent" = proto.Field( proto.MESSAGE, number=2, message="Agent", @@ -310,12 +312,12 @@ class UpdateAgentRequest(proto.Message): updated. """ - agent = proto.Field( + agent: "Agent" = proto.Field( proto.MESSAGE, number=1, message="Agent", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -332,7 +334,7 @@ class DeleteAgentRequest(proto.Message): ``projects//locations//agents/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -372,20 +374,20 @@ class DataFormat(proto.Enum): DATA_FORMAT_UNSPECIFIED = 0 BLOB = 1 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - agent_uri = proto.Field( + agent_uri: str = proto.Field( proto.STRING, number=2, ) - data_format = proto.Field( + data_format: DataFormat = proto.Field( proto.ENUM, number=3, enum=DataFormat, ) - environment = proto.Field( + environment: str = proto.Field( proto.STRING, number=5, ) @@ -415,12 +417,12 @@ class ExportAgentResponse(proto.Message): This field is a member of `oneof`_ ``agent``. """ - agent_uri = proto.Field( + agent_uri: str = proto.Field( proto.STRING, number=1, oneof="agent", ) - agent_content = proto.Field( + agent_content: bytes = proto.Field( proto.BYTES, number=2, oneof="agent", @@ -469,21 +471,21 @@ class RestoreOption(proto.Enum): KEEP = 1 FALLBACK = 2 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - agent_uri = proto.Field( + agent_uri: str = proto.Field( proto.STRING, number=2, oneof="agent", ) - agent_content = proto.Field( + agent_content: bytes = proto.Field( proto.BYTES, number=3, oneof="agent", ) - restore_option = proto.Field( + restore_option: RestoreOption = proto.Field( proto.ENUM, number=5, enum=RestoreOption, @@ -503,11 +505,11 @@ class ValidateAgentRequest(proto.Message): language is used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -526,11 +528,11 @@ class GetAgentValidationResultRequest(proto.Message): language is used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -545,15 +547,17 @@ class AgentValidationResult(proto.Message): The unique identifier of the agent validation result. Format: ``projects//locations//agents//validationResult``. - flow_validation_results (Sequence[google.cloud.dialogflowcx_v3beta1.types.FlowValidationResult]): + flow_validation_results (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.FlowValidationResult]): Contains all flow validation results. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - flow_validation_results = proto.RepeatedField( + flow_validation_results: MutableSequence[ + flow.FlowValidationResult + ] = proto.RepeatedField( proto.MESSAGE, number=2, message=flow.FlowValidationResult, diff --git a/google/cloud/dialogflowcx_v3beta1/types/audio_config.py b/google/cloud/dialogflowcx_v3beta1/types/audio_config.py index 577764f4..448fe96e 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/audio_config.py +++ b/google/cloud/dialogflowcx_v3beta1/types/audio_config.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import duration_pb2 # type: ignore @@ -117,21 +119,21 @@ class SpeechWordInfo(proto.Message): also not rely on it to always be provided. """ - word = proto.Field( + word: str = proto.Field( proto.STRING, number=3, ) - start_offset = proto.Field( + start_offset: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=1, message=duration_pb2.Duration, ) - end_offset = proto.Field( + end_offset: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=2, message=duration_pb2.Duration, ) - confidence = proto.Field( + confidence: float = proto.Field( proto.FLOAT, number=4, ) @@ -158,7 +160,7 @@ class InputAudioConfig(proto.Message): with information about the recognized speech words, e.g. start and end time offsets. If false or unspecified, Speech doesn't return any word-level information. - phrase_hints (Sequence[str]): + phrase_hints (MutableSequence[str]): Optional. A list of strings containing words and phrases that the speech recognizer should recognize with higher likelihood. @@ -193,33 +195,33 @@ class InputAudioConfig(proto.Message): is relevant only for streaming methods. """ - audio_encoding = proto.Field( + audio_encoding: "AudioEncoding" = proto.Field( proto.ENUM, number=1, enum="AudioEncoding", ) - sample_rate_hertz = proto.Field( + sample_rate_hertz: int = proto.Field( proto.INT32, number=2, ) - enable_word_info = proto.Field( + enable_word_info: bool = proto.Field( proto.BOOL, number=13, ) - phrase_hints = proto.RepeatedField( + phrase_hints: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=4, ) - model = proto.Field( + model: str = proto.Field( proto.STRING, number=7, ) - model_variant = proto.Field( + model_variant: "SpeechModelVariant" = proto.Field( proto.ENUM, number=10, enum="SpeechModelVariant", ) - single_utterance = proto.Field( + single_utterance: bool = proto.Field( proto.BOOL, number=8, ) @@ -249,11 +251,11 @@ class VoiceSelectionParams(proto.Message): gender rather than failing the request. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - ssml_gender = proto.Field( + ssml_gender: "SsmlVoiceGender" = proto.Field( proto.ENUM, number=2, enum="SsmlVoiceGender", @@ -285,7 +287,7 @@ class SynthesizeSpeechConfig(proto.Message): We strongly recommend not to exceed +10 (dB) as there's usually no effective increase in loudness for any value greater than that. - effects_profile_id (Sequence[str]): + effects_profile_id (MutableSequence[str]): Optional. An identifier which selects 'audio effects' profiles that are applied on (post synthesized) text to speech. Effects are applied @@ -296,23 +298,23 @@ class SynthesizeSpeechConfig(proto.Message): synthesized audio. """ - speaking_rate = proto.Field( + speaking_rate: float = proto.Field( proto.DOUBLE, number=1, ) - pitch = proto.Field( + pitch: float = proto.Field( proto.DOUBLE, number=2, ) - volume_gain_db = proto.Field( + volume_gain_db: float = proto.Field( proto.DOUBLE, number=3, ) - effects_profile_id = proto.RepeatedField( + effects_profile_id: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=5, ) - voice = proto.Field( + voice: "VoiceSelectionParams" = proto.Field( proto.MESSAGE, number=4, message="VoiceSelectionParams", @@ -341,16 +343,16 @@ class OutputAudioConfig(proto.Message): be synthesized. """ - audio_encoding = proto.Field( + audio_encoding: "OutputAudioEncoding" = proto.Field( proto.ENUM, number=1, enum="OutputAudioEncoding", ) - sample_rate_hertz = proto.Field( + sample_rate_hertz: int = proto.Field( proto.INT32, number=2, ) - synthesize_speech_config = proto.Field( + synthesize_speech_config: "SynthesizeSpeechConfig" = proto.Field( proto.MESSAGE, number=3, message="SynthesizeSpeechConfig", diff --git a/google/cloud/dialogflowcx_v3beta1/types/changelog.py b/google/cloud/dialogflowcx_v3beta1/types/changelog.py index ce68f75c..a5f861b2 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/changelog.py +++ b/google/cloud/dialogflowcx_v3beta1/types/changelog.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -63,19 +65,19 @@ class ListChangelogsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=3, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=4, ) @@ -86,7 +88,7 @@ class ListChangelogsResponse(proto.Message): [Changelogs.ListChangelogs][google.cloud.dialogflow.cx.v3beta1.Changelogs.ListChangelogs]. Attributes: - changelogs (Sequence[google.cloud.dialogflowcx_v3beta1.types.Changelog]): + changelogs (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Changelog]): The list of changelogs. There will be a maximum number of items returned based on the page_size field in the request. The changelogs will be ordered by timestamp. @@ -100,12 +102,12 @@ class ListChangelogsResponse(proto.Message): def raw_page(self): return self - changelogs = proto.RepeatedField( + changelogs: MutableSequence["Changelog"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Changelog", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -121,7 +123,7 @@ class GetChangelogRequest(proto.Message): ``projects//locations//agents//changelogs/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -149,31 +151,31 @@ class Changelog(proto.Message): The timestamp of the change. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - user_email = proto.Field( + user_email: str = proto.Field( proto.STRING, number=2, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=7, ) - action = proto.Field( + action: str = proto.Field( proto.STRING, number=11, ) - type_ = proto.Field( + type_: str = proto.Field( proto.STRING, number=8, ) - resource = proto.Field( + resource: str = proto.Field( proto.STRING, number=3, ) - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, diff --git a/google/cloud/dialogflowcx_v3beta1/types/deployment.py b/google/cloud/dialogflowcx_v3beta1/types/deployment.py index 9b4af77d..f24740db 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/deployment.py +++ b/google/cloud/dialogflowcx_v3beta1/types/deployment.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -69,7 +71,7 @@ class Result(proto.Message): r"""Result of the deployment. Attributes: - deployment_test_results (Sequence[str]): + deployment_test_results (MutableSequence[str]): Results of test cases running before the deployment. Format: ``projects//locations//agents//testCases//results/``. experiment (str): @@ -80,39 +82,39 @@ class Result(proto.Message): ID>/experiments/. """ - deployment_test_results = proto.RepeatedField( + deployment_test_results: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - experiment = proto.Field( + experiment: str = proto.Field( proto.STRING, number=2, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - flow_version = proto.Field( + flow_version: str = proto.Field( proto.STRING, number=2, ) - state = proto.Field( + state: State = proto.Field( proto.ENUM, number=3, enum=State, ) - result = proto.Field( + result: Result = proto.Field( proto.MESSAGE, number=4, message=Result, ) - start_time = proto.Field( + start_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, ) - end_time = proto.Field( + end_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp, @@ -137,15 +139,15 @@ class ListDeploymentsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -156,7 +158,7 @@ class ListDeploymentsResponse(proto.Message): [Deployments.ListDeployments][google.cloud.dialogflow.cx.v3beta1.Deployments.ListDeployments]. Attributes: - deployments (Sequence[google.cloud.dialogflowcx_v3beta1.types.Deployment]): + deployments (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Deployment]): The list of deployments. There will be a maximum number of items returned based on the page_size field in the request. The list may in some cases be empty or contain fewer entries @@ -171,12 +173,12 @@ class ListDeploymentsResponse(proto.Message): def raw_page(self): return self - deployments = proto.RepeatedField( + deployments: MutableSequence["Deployment"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Deployment", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -194,7 +196,7 @@ class GetDeploymentRequest(proto.Message): ``projects//locations//agents//environments//deployments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/google/cloud/dialogflowcx_v3beta1/types/entity_type.py b/google/cloud/dialogflowcx_v3beta1/types/entity_type.py index df43ee3f..9e386b89 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/entity_type.py +++ b/google/cloud/dialogflowcx_v3beta1/types/entity_type.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -79,10 +81,10 @@ class EntityType(proto.Message): auto_expansion_mode (google.cloud.dialogflowcx_v3beta1.types.EntityType.AutoExpansionMode): Indicates whether the entity type can be automatically expanded. - entities (Sequence[google.cloud.dialogflowcx_v3beta1.types.EntityType.Entity]): + entities (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.EntityType.Entity]): The collection of entity entries associated with the entity type. - excluded_phrases (Sequence[google.cloud.dialogflowcx_v3beta1.types.EntityType.ExcludedPhrase]): + excluded_phrases (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.EntityType.ExcludedPhrase]): Collection of exceptional words and phrases that shouldn't be matched. For example, if you have a size entity type with entry ``giant``\ (an adjective), you might consider adding @@ -133,7 +135,7 @@ class Entity(proto.Message): - A string that can contain references to other entity types (with or without aliases). - synonyms (Sequence[str]): + synonyms (MutableSequence[str]): Required. A collection of value synonyms. For example, if the entity type is *vegetable*, and ``value`` is *scallions*, a synonym could be *green onions*. @@ -144,11 +146,11 @@ class Entity(proto.Message): ``value``. """ - value = proto.Field( + value: str = proto.Field( proto.STRING, number=1, ) - synonyms = proto.RepeatedField( + synonyms: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=2, ) @@ -161,44 +163,44 @@ class ExcludedPhrase(proto.Message): Required. The word or phrase to be excluded. """ - value = proto.Field( + value: str = proto.Field( proto.STRING, number=1, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - kind = proto.Field( + kind: Kind = proto.Field( proto.ENUM, number=3, enum=Kind, ) - auto_expansion_mode = proto.Field( + auto_expansion_mode: AutoExpansionMode = proto.Field( proto.ENUM, number=4, enum=AutoExpansionMode, ) - entities = proto.RepeatedField( + entities: MutableSequence[Entity] = proto.RepeatedField( proto.MESSAGE, number=5, message=Entity, ) - excluded_phrases = proto.RepeatedField( + excluded_phrases: MutableSequence[ExcludedPhrase] = proto.RepeatedField( proto.MESSAGE, number=6, message=ExcludedPhrase, ) - enable_fuzzy_extraction = proto.Field( + enable_fuzzy_extraction: bool = proto.Field( proto.BOOL, number=7, ) - redact = proto.Field( + redact: bool = proto.Field( proto.BOOL, number=9, ) @@ -233,19 +235,19 @@ class ListEntityTypesRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=3, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=4, ) @@ -256,7 +258,7 @@ class ListEntityTypesResponse(proto.Message): [EntityTypes.ListEntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityTypes.ListEntityTypes]. Attributes: - entity_types (Sequence[google.cloud.dialogflowcx_v3beta1.types.EntityType]): + entity_types (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.EntityType]): The list of entity types. There will be a maximum number of items returned based on the page_size field in the request. next_page_token (str): @@ -269,12 +271,12 @@ class ListEntityTypesResponse(proto.Message): def raw_page(self): return self - entity_types = proto.RepeatedField( + entity_types: MutableSequence["EntityType"] = proto.RepeatedField( proto.MESSAGE, number=1, message="EntityType", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -303,11 +305,11 @@ class GetEntityTypeRequest(proto.Message): before they can be used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -337,16 +339,16 @@ class CreateEntityTypeRequest(proto.Message): before they can be used. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - entity_type = proto.Field( + entity_type: "EntityType" = proto.Field( proto.MESSAGE, number=2, message="EntityType", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -375,16 +377,16 @@ class UpdateEntityTypeRequest(proto.Message): The mask to control which fields get updated. """ - entity_type = proto.Field( + entity_type: "EntityType" = proto.Field( proto.MESSAGE, number=1, message="EntityType", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask, @@ -415,11 +417,11 @@ class DeleteEntityTypeRequest(proto.Message): of the entity type will be removed). """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) diff --git a/google/cloud/dialogflowcx_v3beta1/types/environment.py b/google/cloud/dialogflowcx_v3beta1/types/environment.py index 65d52a27..158cd055 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/environment.py +++ b/google/cloud/dialogflowcx_v3beta1/types/environment.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3beta1.types import test_case @@ -70,7 +72,7 @@ class Environment(proto.Message): environment. The maximum length is 500 characters. If exceeded, the request is rejected. - version_configs (Sequence[google.cloud.dialogflowcx_v3beta1.types.Environment.VersionConfig]): + version_configs (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Environment.VersionConfig]): Required. A list of configurations for flow versions. You should include version configs for all flows that are reachable from [``Start Flow``][Agent.start_flow] in the @@ -95,7 +97,7 @@ class VersionConfig(proto.Message): ID>/flows//versions/. """ - version = proto.Field( + version: str = proto.Field( proto.STRING, number=1, ) @@ -104,7 +106,7 @@ class TestCasesConfig(proto.Message): r"""The configuration for continuous tests. Attributes: - test_cases (Sequence[str]): + test_cases (MutableSequence[str]): A list of test case names to run. They should be under the same agent. Format of each test case name: ``projects//locations/ /agents//testCases/`` @@ -119,15 +121,15 @@ class TestCasesConfig(proto.Message): false. """ - test_cases = proto.RepeatedField( + test_cases: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - enable_continuous_run = proto.Field( + enable_continuous_run: bool = proto.Field( proto.BOOL, number=2, ) - enable_predeployment_run = proto.Field( + enable_predeployment_run: bool = proto.Field( proto.BOOL, number=3, ) @@ -136,7 +138,7 @@ class WebhookConfig(proto.Message): r"""Configuration for webhooks. Attributes: - webhook_overrides (Sequence[google.cloud.dialogflowcx_v3beta1.types.Webhook]): + webhook_overrides (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Webhook]): The list of webhooks to override for the agent environment. The webhook must exist in the agent. You can override fields in @@ -145,40 +147,40 @@ class WebhookConfig(proto.Message): [``service_directory``][google.cloud.dialogflow.cx.v3beta1.Webhook.service_directory]. """ - webhook_overrides = proto.RepeatedField( + webhook_overrides: MutableSequence[webhook.Webhook] = proto.RepeatedField( proto.MESSAGE, number=1, message=webhook.Webhook, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - version_configs = proto.RepeatedField( + version_configs: MutableSequence[VersionConfig] = proto.RepeatedField( proto.MESSAGE, number=6, message=VersionConfig, ) - update_time = proto.Field( + update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, ) - test_cases_config = proto.Field( + test_cases_config: TestCasesConfig = proto.Field( proto.MESSAGE, number=7, message=TestCasesConfig, ) - webhook_config = proto.Field( + webhook_config: WebhookConfig = proto.Field( proto.MESSAGE, number=10, message=WebhookConfig, @@ -203,15 +205,15 @@ class ListEnvironmentsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -222,7 +224,7 @@ class ListEnvironmentsResponse(proto.Message): [Environments.ListEnvironments][google.cloud.dialogflow.cx.v3beta1.Environments.ListEnvironments]. Attributes: - environments (Sequence[google.cloud.dialogflowcx_v3beta1.types.Environment]): + environments (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Environment]): The list of environments. There will be a maximum number of items returned based on the page_size field in the request. The list may in some cases be empty or contain fewer entries @@ -237,12 +239,12 @@ class ListEnvironmentsResponse(proto.Message): def raw_page(self): return self - environments = proto.RepeatedField( + environments: MutableSequence["Environment"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Environment", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -260,7 +262,7 @@ class GetEnvironmentRequest(proto.Message): ``projects//locations//agents//environments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -282,11 +284,11 @@ class CreateEnvironmentRequest(proto.Message): Required. The environment to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - environment = proto.Field( + environment: "Environment" = proto.Field( proto.MESSAGE, number=2, message="Environment", @@ -305,12 +307,12 @@ class UpdateEnvironmentRequest(proto.Message): get updated. """ - environment = proto.Field( + environment: "Environment" = proto.Field( proto.MESSAGE, number=1, message="Environment", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -329,7 +331,7 @@ class DeleteEnvironmentRequest(proto.Message): ``projects//locations//agents//environments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -352,15 +354,15 @@ class LookupEnvironmentHistoryRequest(proto.Message): request. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -371,7 +373,7 @@ class LookupEnvironmentHistoryResponse(proto.Message): [Environments.LookupEnvironmentHistory][google.cloud.dialogflow.cx.v3beta1.Environments.LookupEnvironmentHistory]. Attributes: - environments (Sequence[google.cloud.dialogflowcx_v3beta1.types.Environment]): + environments (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Environment]): Represents a list of snapshots for an environment. Time of the snapshots is stored in [``update_time``][google.cloud.dialogflow.cx.v3beta1.Environment.update_time]. @@ -385,12 +387,12 @@ class LookupEnvironmentHistoryResponse(proto.Message): def raw_page(self): return self - environments = proto.RepeatedField( + environments: MutableSequence["Environment"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Environment", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -408,7 +410,7 @@ class ContinuousTestResult(proto.Message): The result of this continuous test run, i.e. whether all the tests in this continuous test run pass or not. - test_case_results (Sequence[str]): + test_case_results (MutableSequence[str]): A list of individual test case results names in this continuous test run. run_time (google.protobuf.timestamp_pb2.Timestamp): @@ -423,20 +425,20 @@ class AggregatedTestResult(proto.Enum): PASSED = 1 FAILED = 2 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - result = proto.Field( + result: AggregatedTestResult = proto.Field( proto.ENUM, number=2, enum=AggregatedTestResult, ) - test_case_results = proto.RepeatedField( + test_case_results: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) - run_time = proto.Field( + run_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, @@ -453,7 +455,7 @@ class RunContinuousTestRequest(proto.Message): ``projects//locations//agents//environments/``. """ - environment = proto.Field( + environment: str = proto.Field( proto.STRING, number=1, ) @@ -468,7 +470,7 @@ class RunContinuousTestResponse(proto.Message): The result for a continuous test run. """ - continuous_test_result = proto.Field( + continuous_test_result: "ContinuousTestResult" = proto.Field( proto.MESSAGE, number=1, message="ContinuousTestResult", @@ -481,11 +483,11 @@ class RunContinuousTestMetadata(proto.Message): long running operation. Attributes: - errors (Sequence[google.cloud.dialogflowcx_v3beta1.types.TestError]): + errors (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TestError]): The test errors. """ - errors = proto.RepeatedField( + errors: MutableSequence[test_case.TestError] = proto.RepeatedField( proto.MESSAGE, number=1, message=test_case.TestError, @@ -508,15 +510,15 @@ class ListContinuousTestResultsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -526,7 +528,7 @@ class ListContinuousTestResultsResponse(proto.Message): r"""The response message for [Environments.ListTestCaseResults][]. Attributes: - continuous_test_results (Sequence[google.cloud.dialogflowcx_v3beta1.types.ContinuousTestResult]): + continuous_test_results (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.ContinuousTestResult]): The list of continuous test results. next_page_token (str): Token to retrieve the next page of results, @@ -538,12 +540,14 @@ class ListContinuousTestResultsResponse(proto.Message): def raw_page(self): return self - continuous_test_results = proto.RepeatedField( + continuous_test_results: MutableSequence[ + "ContinuousTestResult" + ] = proto.RepeatedField( proto.MESSAGE, number=1, message="ContinuousTestResult", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -562,11 +566,11 @@ class DeployFlowRequest(proto.Message): ``projects//locations//agents// flows//versions/``. """ - environment = proto.Field( + environment: str = proto.Field( proto.STRING, number=1, ) - flow_version = proto.Field( + flow_version: str = proto.Field( proto.STRING, number=2, ) @@ -585,12 +589,12 @@ class DeployFlowResponse(proto.Message): ``projects//locations//agents// environments//deployments/``. """ - environment = proto.Field( + environment: "Environment" = proto.Field( proto.MESSAGE, number=1, message="Environment", ) - deployment = proto.Field( + deployment: str = proto.Field( proto.STRING, number=2, ) @@ -602,11 +606,11 @@ class DeployFlowMetadata(proto.Message): long running operation. Attributes: - test_errors (Sequence[google.cloud.dialogflowcx_v3beta1.types.TestError]): + test_errors (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TestError]): Errors of running deployment tests. """ - test_errors = proto.RepeatedField( + test_errors: MutableSequence[test_case.TestError] = proto.RepeatedField( proto.MESSAGE, number=1, message=test_case.TestError, diff --git a/google/cloud/dialogflowcx_v3beta1/types/experiment.py b/google/cloud/dialogflowcx_v3beta1/types/experiment.py index 7ed8b351..daf44b24 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/experiment.py +++ b/google/cloud/dialogflowcx_v3beta1/types/experiment.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import duration_pb2 # type: ignore @@ -96,7 +98,7 @@ class Experiment(proto.Message): and maximum will be 30 days. If auto-rollout is enabled, default value and maximum will be 6 days. - variants_history (Sequence[google.cloud.dialogflowcx_v3beta1.types.VariantsHistory]): + variants_history (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.VariantsHistory]): The history of updates to the experiment variants. """ @@ -128,11 +130,11 @@ class Definition(proto.Message): This field is a member of `oneof`_ ``variants``. """ - condition = proto.Field( + condition: str = proto.Field( proto.STRING, number=1, ) - version_variants = proto.Field( + version_variants: "VersionVariants" = proto.Field( proto.MESSAGE, number=2, oneof="variants", @@ -144,7 +146,7 @@ class Result(proto.Message): optimize and the confidence interval. Attributes: - version_metrics (Sequence[google.cloud.dialogflowcx_v3beta1.types.Experiment.Result.VersionMetrics]): + version_metrics (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Experiment.Result.VersionMetrics]): Version variants and metrics. last_update_time (google.protobuf.timestamp_pb2.Timestamp): The last time the experiment's stats data was @@ -186,19 +188,19 @@ class ConfidenceInterval(proto.Message): Upper bound of the interval. """ - confidence_level = proto.Field( + confidence_level: float = proto.Field( proto.DOUBLE, number=1, ) - ratio = proto.Field( + ratio: float = proto.Field( proto.DOUBLE, number=2, ) - lower_bound = proto.Field( + lower_bound: float = proto.Field( proto.DOUBLE, number=3, ) - upper_bound = proto.Field( + upper_bound: float = proto.Field( proto.DOUBLE, number=4, ) @@ -233,27 +235,27 @@ class Metric(proto.Message): than all other treatments in the experiment """ - type_ = proto.Field( + type_: "Experiment.Result.MetricType" = proto.Field( proto.ENUM, number=1, enum="Experiment.Result.MetricType", ) - count_type = proto.Field( + count_type: "Experiment.Result.CountType" = proto.Field( proto.ENUM, number=5, enum="Experiment.Result.CountType", ) - ratio = proto.Field( + ratio: float = proto.Field( proto.DOUBLE, number=2, oneof="value", ) - count = proto.Field( + count: float = proto.Field( proto.DOUBLE, number=4, oneof="value", ) - confidence_interval = proto.Field( + confidence_interval: "Experiment.Result.ConfidenceInterval" = proto.Field( proto.MESSAGE, number=3, message="Experiment.Result.ConfidenceInterval", @@ -268,7 +270,7 @@ class VersionMetrics(proto.Message): [Version][google.cloud.dialogflow.cx.v3beta1.Version]. Format: ``projects//locations//agents//flows//versions/``. - metrics (Sequence[google.cloud.dialogflowcx_v3beta1.types.Experiment.Result.Metric]): + metrics (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Experiment.Result.Metric]): The metrics and corresponding confidence intervals in the inference result. session_count (int): @@ -276,98 +278,100 @@ class VersionMetrics(proto.Message): this version. """ - version = proto.Field( + version: str = proto.Field( proto.STRING, number=1, ) - metrics = proto.RepeatedField( + metrics: MutableSequence["Experiment.Result.Metric"] = proto.RepeatedField( proto.MESSAGE, number=2, message="Experiment.Result.Metric", ) - session_count = proto.Field( + session_count: int = proto.Field( proto.INT32, number=3, ) - version_metrics = proto.RepeatedField( + version_metrics: MutableSequence[ + "Experiment.Result.VersionMetrics" + ] = proto.RepeatedField( proto.MESSAGE, number=1, message="Experiment.Result.VersionMetrics", ) - last_update_time = proto.Field( + last_update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - state = proto.Field( + state: State = proto.Field( proto.ENUM, number=4, enum=State, ) - definition = proto.Field( + definition: Definition = proto.Field( proto.MESSAGE, number=5, message=Definition, ) - rollout_config = proto.Field( + rollout_config: "RolloutConfig" = proto.Field( proto.MESSAGE, number=14, message="RolloutConfig", ) - rollout_state = proto.Field( + rollout_state: "RolloutState" = proto.Field( proto.MESSAGE, number=15, message="RolloutState", ) - rollout_failure_reason = proto.Field( + rollout_failure_reason: str = proto.Field( proto.STRING, number=16, ) - result = proto.Field( + result: Result = proto.Field( proto.MESSAGE, number=6, message=Result, ) - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp, ) - start_time = proto.Field( + start_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=8, message=timestamp_pb2.Timestamp, ) - end_time = proto.Field( + end_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=9, message=timestamp_pb2.Timestamp, ) - last_update_time = proto.Field( + last_update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=10, message=timestamp_pb2.Timestamp, ) - experiment_length = proto.Field( + experiment_length: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=11, message=duration_pb2.Duration, ) - variants_history = proto.RepeatedField( + variants_history: MutableSequence["VariantsHistory"] = proto.RepeatedField( proto.MESSAGE, number=12, message="VariantsHistory", @@ -378,7 +382,7 @@ class VersionVariants(proto.Message): r"""A list of flow version variants. Attributes: - variants (Sequence[google.cloud.dialogflowcx_v3beta1.types.VersionVariants.Variant]): + variants (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.VersionVariants.Variant]): A list of flow version variants. """ @@ -397,20 +401,20 @@ class Variant(proto.Message): Whether the variant is for the control group. """ - version = proto.Field( + version: str = proto.Field( proto.STRING, number=1, ) - traffic_allocation = proto.Field( + traffic_allocation: float = proto.Field( proto.FLOAT, number=2, ) - is_control_group = proto.Field( + is_control_group: bool = proto.Field( proto.BOOL, number=3, ) - variants = proto.RepeatedField( + variants: MutableSequence[Variant] = proto.RepeatedField( proto.MESSAGE, number=1, message=Variant, @@ -421,7 +425,7 @@ class RolloutConfig(proto.Message): r"""The configuration for auto rollout. Attributes: - rollout_steps (Sequence[google.cloud.dialogflowcx_v3beta1.types.RolloutConfig.RolloutStep]): + rollout_steps (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.RolloutConfig.RolloutStep]): Steps to roll out a flow version. Steps should be sorted by percentage in ascending order. @@ -456,30 +460,30 @@ class RolloutStep(proto.Message): hour. """ - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - traffic_percent = proto.Field( + traffic_percent: int = proto.Field( proto.INT32, number=2, ) - min_duration = proto.Field( + min_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=3, message=duration_pb2.Duration, ) - rollout_steps = proto.RepeatedField( + rollout_steps: MutableSequence[RolloutStep] = proto.RepeatedField( proto.MESSAGE, number=1, message=RolloutStep, ) - rollout_condition = proto.Field( + rollout_condition: str = proto.Field( proto.STRING, number=2, ) - failure_condition = proto.Field( + failure_condition: str = proto.Field( proto.STRING, number=3, ) @@ -499,15 +503,15 @@ class RolloutState(proto.Message): Start time of the current step. """ - step = proto.Field( + step: str = proto.Field( proto.STRING, number=1, ) - step_index = proto.Field( + step_index: int = proto.Field( proto.INT32, number=3, ) - start_time = proto.Field( + start_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, @@ -528,13 +532,13 @@ class VariantsHistory(proto.Message): Update time of the variants. """ - version_variants = proto.Field( + version_variants: "VersionVariants" = proto.Field( proto.MESSAGE, number=1, oneof="variants", message="VersionVariants", ) - update_time = proto.Field( + update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, @@ -559,15 +563,15 @@ class ListExperimentsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -578,7 +582,7 @@ class ListExperimentsResponse(proto.Message): [Experiments.ListExperiments][google.cloud.dialogflow.cx.v3beta1.Experiments.ListExperiments]. Attributes: - experiments (Sequence[google.cloud.dialogflowcx_v3beta1.types.Experiment]): + experiments (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Experiment]): The list of experiments. There will be a maximum number of items returned based on the page_size field in the request. The list may in some cases be empty or contain fewer entries @@ -593,12 +597,12 @@ class ListExperimentsResponse(proto.Message): def raw_page(self): return self - experiments = proto.RepeatedField( + experiments: MutableSequence["Experiment"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Experiment", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -616,7 +620,7 @@ class GetExperimentRequest(proto.Message): ``projects//locations//agents//environments//experiments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -638,11 +642,11 @@ class CreateExperimentRequest(proto.Message): Required. The experiment to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - experiment = proto.Field( + experiment: "Experiment" = proto.Field( proto.MESSAGE, number=2, message="Experiment", @@ -661,12 +665,12 @@ class UpdateExperimentRequest(proto.Message): get updated. """ - experiment = proto.Field( + experiment: "Experiment" = proto.Field( proto.MESSAGE, number=1, message="Experiment", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -685,7 +689,7 @@ class DeleteExperimentRequest(proto.Message): ``projects//locations//agents//environments//experiments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -701,7 +705,7 @@ class StartExperimentRequest(proto.Message): ``projects//locations//agents//environments//experiments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -717,7 +721,7 @@ class StopExperimentRequest(proto.Message): ``projects//locations//agents//environments//experiments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/google/cloud/dialogflowcx_v3beta1/types/flow.py b/google/cloud/dialogflowcx_v3beta1/types/flow.py index 086736c2..6f665a0a 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/flow.py +++ b/google/cloud/dialogflowcx_v3beta1/types/flow.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3beta1.types import page @@ -76,16 +78,16 @@ class ModelTrainingMode(proto.Enum): MODEL_TRAINING_MODE_AUTOMATIC = 1 MODEL_TRAINING_MODE_MANUAL = 2 - model_type = proto.Field( + model_type: ModelType = proto.Field( proto.ENUM, number=1, enum=ModelType, ) - classification_threshold = proto.Field( + classification_threshold: float = proto.Field( proto.FLOAT, number=3, ) - model_training_mode = proto.Field( + model_training_mode: ModelTrainingMode = proto.Field( proto.ENUM, number=4, enum=ModelTrainingMode, @@ -121,7 +123,7 @@ class Flow(proto.Message): The description of the flow. The maximum length is 500 characters. If exceeded, the request is rejected. - transition_routes (Sequence[google.cloud.dialogflowcx_v3beta1.types.TransitionRoute]): + transition_routes (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TransitionRoute]): A flow's transition routes serve two purposes: - They are responsible for matching the user's first @@ -140,7 +142,7 @@ class Flow(proto.Message): TransitionRoutes with intent specified are inherited by pages in the flow. - event_handlers (Sequence[google.cloud.dialogflowcx_v3beta1.types.EventHandler]): + event_handlers (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.EventHandler]): A flow's event handlers serve two purposes: - They are responsible for handling events (e.g. no match, @@ -156,7 +158,7 @@ class Flow(proto.Message): these handlers are evaluated on a first-match basis. The first one that matches the event get executed, with the rest being ignored. - transition_route_groups (Sequence[str]): + transition_route_groups (MutableSequence[str]): A flow's transition route group serve two purposes: - They are responsible for matching the user's first @@ -171,33 +173,33 @@ class Flow(proto.Message): NLU related settings of the flow. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - transition_routes = proto.RepeatedField( + transition_routes: MutableSequence[page.TransitionRoute] = proto.RepeatedField( proto.MESSAGE, number=4, message=page.TransitionRoute, ) - event_handlers = proto.RepeatedField( + event_handlers: MutableSequence[page.EventHandler] = proto.RepeatedField( proto.MESSAGE, number=10, message=page.EventHandler, ) - transition_route_groups = proto.RepeatedField( + transition_route_groups: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=15, ) - nlu_settings = proto.Field( + nlu_settings: "NluSettings" = proto.Field( proto.MESSAGE, number=11, message="NluSettings", @@ -229,16 +231,16 @@ class CreateFlowRequest(proto.Message): before they can be used. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - flow = proto.Field( + flow: "Flow" = proto.Field( proto.MESSAGE, number=2, message="Flow", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -266,11 +268,11 @@ class DeleteFlowRequest(proto.Message): cleared). """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) @@ -306,19 +308,19 @@ class ListFlowsRequest(proto.Message): before they can be used. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=4, ) @@ -329,7 +331,7 @@ class ListFlowsResponse(proto.Message): [Flows.ListFlows][google.cloud.dialogflow.cx.v3beta1.Flows.ListFlows]. Attributes: - flows (Sequence[google.cloud.dialogflowcx_v3beta1.types.Flow]): + flows (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Flow]): The list of flows. There will be a maximum number of items returned based on the page_size field in the request. next_page_token (str): @@ -342,12 +344,12 @@ class ListFlowsResponse(proto.Message): def raw_page(self): return self - flows = proto.RepeatedField( + flows: MutableSequence["Flow"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Flow", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -377,11 +379,11 @@ class GetFlowRequest(proto.Message): before they can be used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -413,17 +415,17 @@ class UpdateFlowRequest(proto.Message): before they can be used. """ - flow = proto.Field( + flow: "Flow" = proto.Field( proto.MESSAGE, number=1, message="Flow", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -439,7 +441,7 @@ class TrainFlowRequest(proto.Message): ``projects//locations//agents//flows/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -458,11 +460,11 @@ class ValidateFlowRequest(proto.Message): language is used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -481,11 +483,11 @@ class GetFlowValidationResultRequest(proto.Message): language is used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -499,22 +501,24 @@ class FlowValidationResult(proto.Message): name (str): The unique identifier of the flow validation result. Format: ``projects//locations//agents//flows//validationResult``. - validation_messages (Sequence[google.cloud.dialogflowcx_v3beta1.types.ValidationMessage]): + validation_messages (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.ValidationMessage]): Contains all validation messages. update_time (google.protobuf.timestamp_pb2.Timestamp): Last time the flow was validated. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - validation_messages = proto.RepeatedField( + validation_messages: MutableSequence[ + validation_message.ValidationMessage + ] = proto.RepeatedField( proto.MESSAGE, number=2, message=validation_message.ValidationMessage, ) - update_time = proto.Field( + update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, @@ -563,21 +567,21 @@ class ImportOption(proto.Enum): KEEP = 1 FALLBACK = 2 - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - flow_uri = proto.Field( + flow_uri: str = proto.Field( proto.STRING, number=2, oneof="flow", ) - flow_content = proto.Field( + flow_content: bytes = proto.Field( proto.BYTES, number=3, oneof="flow", ) - import_option = proto.Field( + import_option: ImportOption = proto.Field( proto.ENUM, number=4, enum=ImportOption, @@ -594,7 +598,7 @@ class ImportFlowResponse(proto.Message): ``projects//locations//agents//flows/``. """ - flow = proto.Field( + flow: str = proto.Field( proto.STRING, number=1, ) @@ -625,15 +629,15 @@ class ExportFlowRequest(proto.Message): by the specified flow. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - flow_uri = proto.Field( + flow_uri: str = proto.Field( proto.STRING, number=2, ) - include_referenced_flows = proto.Field( + include_referenced_flows: bool = proto.Field( proto.BOOL, number=4, ) @@ -663,12 +667,12 @@ class ExportFlowResponse(proto.Message): This field is a member of `oneof`_ ``flow``. """ - flow_uri = proto.Field( + flow_uri: str = proto.Field( proto.STRING, number=1, oneof="flow", ) - flow_content = proto.Field( + flow_content: bytes = proto.Field( proto.BYTES, number=2, oneof="flow", diff --git a/google/cloud/dialogflowcx_v3beta1/types/fulfillment.py b/google/cloud/dialogflowcx_v3beta1/types/fulfillment.py index 59537b74..a893cada 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/fulfillment.py +++ b/google/cloud/dialogflowcx_v3beta1/types/fulfillment.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3beta1.types import response_message @@ -49,7 +51,7 @@ class Fulfillment(proto.Message): or both. Attributes: - messages (Sequence[google.cloud.dialogflowcx_v3beta1.types.ResponseMessage]): + messages (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.ResponseMessage]): The list of rich message responses to present to the user. webhook (str): @@ -76,10 +78,10 @@ class Fulfillment(proto.Message): the webhook service to identify which fulfillment is being called, but it could be used for other purposes. This field is required if ``webhook`` is specified. - set_parameter_actions (Sequence[google.cloud.dialogflowcx_v3beta1.types.Fulfillment.SetParameterAction]): + set_parameter_actions (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Fulfillment.SetParameterAction]): Set parameter values before executing the webhook. - conditional_cases (Sequence[google.cloud.dialogflowcx_v3beta1.types.Fulfillment.ConditionalCases]): + conditional_cases (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Fulfillment.ConditionalCases]): Conditional cases for this fulfillment. """ @@ -94,11 +96,11 @@ class SetParameterAction(proto.Message): clears the parameter. """ - parameter = proto.Field( + parameter: str = proto.Field( proto.STRING, number=1, ) - value = proto.Field( + value: struct_pb2.Value = proto.Field( proto.MESSAGE, number=2, message=struct_pb2.Value, @@ -110,7 +112,7 @@ class ConditionalCases(proto.Message): all the rest ignored. Attributes: - cases (Sequence[google.cloud.dialogflowcx_v3beta1.types.Fulfillment.ConditionalCases.Case]): + cases (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Fulfillment.ConditionalCases.Case]): A list of cascading if-else conditions. """ @@ -128,7 +130,7 @@ class Case(proto.Message): See the `conditions reference `__. - case_content (Sequence[google.cloud.dialogflowcx_v3beta1.types.Fulfillment.ConditionalCases.Case.CaseContent]): + case_content (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Fulfillment.ConditionalCases.Case.CaseContent]): A list of case content. """ @@ -154,58 +156,62 @@ class CaseContent(proto.Message): This field is a member of `oneof`_ ``cases_or_message``. """ - message = proto.Field( + message: response_message.ResponseMessage = proto.Field( proto.MESSAGE, number=1, oneof="cases_or_message", message=response_message.ResponseMessage, ) - additional_cases = proto.Field( + additional_cases: "Fulfillment.ConditionalCases" = proto.Field( proto.MESSAGE, number=2, oneof="cases_or_message", message="Fulfillment.ConditionalCases", ) - condition = proto.Field( + condition: str = proto.Field( proto.STRING, number=1, ) - case_content = proto.RepeatedField( + case_content: MutableSequence[ + "Fulfillment.ConditionalCases.Case.CaseContent" + ] = proto.RepeatedField( proto.MESSAGE, number=2, message="Fulfillment.ConditionalCases.Case.CaseContent", ) - cases = proto.RepeatedField( + cases: MutableSequence[ + "Fulfillment.ConditionalCases.Case" + ] = proto.RepeatedField( proto.MESSAGE, number=1, message="Fulfillment.ConditionalCases.Case", ) - messages = proto.RepeatedField( + messages: MutableSequence[response_message.ResponseMessage] = proto.RepeatedField( proto.MESSAGE, number=1, message=response_message.ResponseMessage, ) - webhook = proto.Field( + webhook: str = proto.Field( proto.STRING, number=2, ) - return_partial_responses = proto.Field( + return_partial_responses: bool = proto.Field( proto.BOOL, number=8, ) - tag = proto.Field( + tag: str = proto.Field( proto.STRING, number=3, ) - set_parameter_actions = proto.RepeatedField( + set_parameter_actions: MutableSequence[SetParameterAction] = proto.RepeatedField( proto.MESSAGE, number=4, message=SetParameterAction, ) - conditional_cases = proto.RepeatedField( + conditional_cases: MutableSequence[ConditionalCases] = proto.RepeatedField( proto.MESSAGE, number=5, message=ConditionalCases, diff --git a/google/cloud/dialogflowcx_v3beta1/types/intent.py b/google/cloud/dialogflowcx_v3beta1/types/intent.py index b0da47fe..f8400e64 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/intent.py +++ b/google/cloud/dialogflowcx_v3beta1/types/intent.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -62,10 +64,10 @@ class Intent(proto.Message): display_name (str): Required. The human-readable name of the intent, unique within the agent. - training_phrases (Sequence[google.cloud.dialogflowcx_v3beta1.types.Intent.TrainingPhrase]): + training_phrases (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Intent.TrainingPhrase]): The collection of training phrases the agent is trained on to identify the intent. - parameters (Sequence[google.cloud.dialogflowcx_v3beta1.types.Intent.Parameter]): + parameters (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Intent.Parameter]): The collection of parameters associated with the intent. priority (int): @@ -87,7 +89,7 @@ class Intent(proto.Message): mistakenly matched, since training phrases assigned to fallback intents act as negative examples that triggers no-match event. - labels (Mapping[str, str]): + labels (MutableMapping[str, str]): The key/value metadata to label an intent. Labels can contain lowercase letters, digits and the symbols '-' and '_'. International characters are allowed, including letters @@ -117,7 +119,7 @@ class TrainingPhrase(proto.Message): id (str): Output only. The unique identifier of the training phrase. - parts (Sequence[google.cloud.dialogflowcx_v3beta1.types.Intent.TrainingPhrase.Part]): + parts (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Intent.TrainingPhrase.Part]): Required. The ordered list of training phrase parts. The parts are concatenated in order to form the training phrase. @@ -160,25 +162,25 @@ class Part(proto.Message): phrase. """ - text = proto.Field( + text: str = proto.Field( proto.STRING, number=1, ) - parameter_id = proto.Field( + parameter_id: str = proto.Field( proto.STRING, number=2, ) - id = proto.Field( + id: str = proto.Field( proto.STRING, number=1, ) - parts = proto.RepeatedField( + parts: MutableSequence["Intent.TrainingPhrase.Part"] = proto.RepeatedField( proto.MESSAGE, number=2, message="Intent.TrainingPhrase.Part", ) - repeat_count = proto.Field( + repeat_count: int = proto.Field( proto.INT32, number=3, ) @@ -214,55 +216,55 @@ class Parameter(proto.Message): is enabled. """ - id = proto.Field( + id: str = proto.Field( proto.STRING, number=1, ) - entity_type = proto.Field( + entity_type: str = proto.Field( proto.STRING, number=2, ) - is_list = proto.Field( + is_list: bool = proto.Field( proto.BOOL, number=3, ) - redact = proto.Field( + redact: bool = proto.Field( proto.BOOL, number=4, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - training_phrases = proto.RepeatedField( + training_phrases: MutableSequence[TrainingPhrase] = proto.RepeatedField( proto.MESSAGE, number=3, message=TrainingPhrase, ) - parameters = proto.RepeatedField( + parameters: MutableSequence[Parameter] = proto.RepeatedField( proto.MESSAGE, number=4, message=Parameter, ) - priority = proto.Field( + priority: int = proto.Field( proto.INT32, number=5, ) - is_fallback = proto.Field( + is_fallback: bool = proto.Field( proto.BOOL, number=6, ) - labels = proto.MapField( + labels: MutableMapping[str, str] = proto.MapField( proto.STRING, proto.STRING, number=7, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=8, ) @@ -298,24 +300,24 @@ class ListIntentsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) - intent_view = proto.Field( + intent_view: "IntentView" = proto.Field( proto.ENUM, number=5, enum="IntentView", ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=3, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=4, ) @@ -326,7 +328,7 @@ class ListIntentsResponse(proto.Message): [Intents.ListIntents][google.cloud.dialogflow.cx.v3beta1.Intents.ListIntents]. Attributes: - intents (Sequence[google.cloud.dialogflowcx_v3beta1.types.Intent]): + intents (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Intent]): The list of intents. There will be a maximum number of items returned based on the page_size field in the request. next_page_token (str): @@ -339,12 +341,12 @@ class ListIntentsResponse(proto.Message): def raw_page(self): return self - intents = proto.RepeatedField( + intents: MutableSequence["Intent"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Intent", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -371,11 +373,11 @@ class GetIntentRequest(proto.Message): before they can be used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -403,16 +405,16 @@ class CreateIntentRequest(proto.Message): before they can be used. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - intent = proto.Field( + intent: "Intent" = proto.Field( proto.MESSAGE, number=2, message="Intent", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -441,16 +443,16 @@ class UpdateIntentRequest(proto.Message): updated. """ - intent = proto.Field( + intent: "Intent" = proto.Field( proto.MESSAGE, number=1, message="Intent", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask, @@ -467,7 +469,7 @@ class DeleteIntentRequest(proto.Message): ``projects//locations//agents//intents/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/google/cloud/dialogflowcx_v3beta1/types/page.py b/google/cloud/dialogflowcx_v3beta1/types/page.py index 88cbc310..46959cd7 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/page.py +++ b/google/cloud/dialogflowcx_v3beta1/types/page.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3beta1.types import fulfillment @@ -75,7 +77,7 @@ class Page(proto.Message): form (google.cloud.dialogflowcx_v3beta1.types.Form): The form associated with the page, used for collecting parameters relevant to the page. - transition_route_groups (Sequence[str]): + transition_route_groups (MutableSequence[str]): Ordered list of [``TransitionRouteGroups``][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] associated with the page. Transition route groups must be @@ -91,7 +93,7 @@ class Page(proto.Message): takes precedence. Format:\ ``projects//locations//agents//flows//transitionRouteGroups/``. - transition_routes (Sequence[google.cloud.dialogflowcx_v3beta1.types.TransitionRoute]): + transition_routes (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TransitionRoute]): A list of transitions for the transition rules of this page. They route the conversation to another page in the same flow, or another flow. @@ -113,40 +115,40 @@ class Page(proto.Message): - TransitionRoutes defined in the [transition route groups][google.cloud.dialogflow.cx.v3beta1.Page.transition_route_groups] with only condition specified. - event_handlers (Sequence[google.cloud.dialogflowcx_v3beta1.types.EventHandler]): + event_handlers (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.EventHandler]): Handlers associated with the page to handle events such as webhook errors, no match or no input. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - entry_fulfillment = proto.Field( + entry_fulfillment: fulfillment.Fulfillment = proto.Field( proto.MESSAGE, number=7, message=fulfillment.Fulfillment, ) - form = proto.Field( + form: "Form" = proto.Field( proto.MESSAGE, number=4, message="Form", ) - transition_route_groups = proto.RepeatedField( + transition_route_groups: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=11, ) - transition_routes = proto.RepeatedField( + transition_routes: MutableSequence["TransitionRoute"] = proto.RepeatedField( proto.MESSAGE, number=9, message="TransitionRoute", ) - event_handlers = proto.RepeatedField( + event_handlers: MutableSequence["EventHandler"] = proto.RepeatedField( proto.MESSAGE, number=10, message="EventHandler", @@ -163,7 +165,7 @@ class Form(proto.Message): [session][google.cloud.dialogflow.cx.v3beta1.SessionInfo.parameters]. Attributes: - parameters (Sequence[google.cloud.dialogflowcx_v3beta1.types.Form.Parameter]): + parameters (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Form.Parameter]): Parameters to collect from the user. """ @@ -217,7 +219,7 @@ class FillBehavior(proto.Message): Required. The fulfillment to provide the initial prompt that the agent can present to the user in order to fill the parameter. - reprompt_event_handlers (Sequence[google.cloud.dialogflowcx_v3beta1.types.EventHandler]): + reprompt_event_handlers (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.EventHandler]): The handlers for parameter-level events, used to provide reprompt for the parameter or transition to a different page/flow. The supported events are: @@ -257,49 +259,51 @@ class FillBehavior(proto.Message): be re-prompted. """ - initial_prompt_fulfillment = proto.Field( + initial_prompt_fulfillment: fulfillment.Fulfillment = proto.Field( proto.MESSAGE, number=3, message=fulfillment.Fulfillment, ) - reprompt_event_handlers = proto.RepeatedField( + reprompt_event_handlers: MutableSequence[ + "EventHandler" + ] = proto.RepeatedField( proto.MESSAGE, number=5, message="EventHandler", ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - required = proto.Field( + required: bool = proto.Field( proto.BOOL, number=2, ) - entity_type = proto.Field( + entity_type: str = proto.Field( proto.STRING, number=3, ) - is_list = proto.Field( + is_list: bool = proto.Field( proto.BOOL, number=4, ) - fill_behavior = proto.Field( + fill_behavior: "Form.Parameter.FillBehavior" = proto.Field( proto.MESSAGE, number=7, message="Form.Parameter.FillBehavior", ) - default_value = proto.Field( + default_value: struct_pb2.Value = proto.Field( proto.MESSAGE, number=9, message=struct_pb2.Value, ) - redact = proto.Field( + redact: bool = proto.Field( proto.BOOL, number=11, ) - parameters = proto.RepeatedField( + parameters: MutableSequence[Parameter] = proto.RepeatedField( proto.MESSAGE, number=1, message=Parameter, @@ -355,25 +359,25 @@ class EventHandler(proto.Message): This field is a member of `oneof`_ ``target``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=6, ) - event = proto.Field( + event: str = proto.Field( proto.STRING, number=4, ) - trigger_fulfillment = proto.Field( + trigger_fulfillment: fulfillment.Fulfillment = proto.Field( proto.MESSAGE, number=5, message=fulfillment.Fulfillment, ) - target_page = proto.Field( + target_page: str = proto.Field( proto.STRING, number=2, oneof="target", ) - target_flow = proto.Field( + target_flow: str = proto.Field( proto.STRING, number=3, oneof="target", @@ -448,29 +452,29 @@ class TransitionRoute(proto.Message): This field is a member of `oneof`_ ``target``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=6, ) - intent = proto.Field( + intent: str = proto.Field( proto.STRING, number=1, ) - condition = proto.Field( + condition: str = proto.Field( proto.STRING, number=2, ) - trigger_fulfillment = proto.Field( + trigger_fulfillment: fulfillment.Fulfillment = proto.Field( proto.MESSAGE, number=3, message=fulfillment.Fulfillment, ) - target_page = proto.Field( + target_page: str = proto.Field( proto.STRING, number=4, oneof="target", ) - target_flow = proto.Field( + target_flow: str = proto.Field( proto.STRING, number=5, oneof="target", @@ -519,19 +523,19 @@ class ListPagesRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=3, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=4, ) @@ -542,7 +546,7 @@ class ListPagesResponse(proto.Message): [Pages.ListPages][google.cloud.dialogflow.cx.v3beta1.Pages.ListPages]. Attributes: - pages (Sequence[google.cloud.dialogflowcx_v3beta1.types.Page]): + pages (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Page]): The list of pages. There will be a maximum number of items returned based on the page_size field in the request. next_page_token (str): @@ -555,12 +559,12 @@ class ListPagesResponse(proto.Message): def raw_page(self): return self - pages = proto.RepeatedField( + pages: MutableSequence["Page"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Page", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -602,11 +606,11 @@ class GetPageRequest(proto.Message): before they can be used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -649,16 +653,16 @@ class CreatePageRequest(proto.Message): before they can be used. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page = proto.Field( + page: "Page" = proto.Field( proto.MESSAGE, number=2, message="Page", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -702,16 +706,16 @@ class UpdatePageRequest(proto.Message): updated. """ - page = proto.Field( + page: "Page" = proto.Field( proto.MESSAGE, number=1, message="Page", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask, @@ -740,11 +744,11 @@ class DeletePageRequest(proto.Message): cleared). """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) diff --git a/google/cloud/dialogflowcx_v3beta1/types/response_message.py b/google/cloud/dialogflowcx_v3beta1/types/response_message.py index b252fcdf..ba9a6485 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/response_message.py +++ b/google/cloud/dialogflowcx_v3beta1/types/response_message.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import struct_pb2 # type: ignore @@ -120,7 +122,7 @@ class Text(proto.Message): r"""The text response message. Attributes: - text (Sequence[str]): + text (MutableSequence[str]): Required. A collection of text responses. allow_playback_interruption (bool): Output only. Whether the playback of this @@ -129,11 +131,11 @@ class Text(proto.Message): Dialogflow request. """ - text = proto.RepeatedField( + text: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - allow_playback_interruption = proto.Field( + allow_playback_interruption: bool = proto.Field( proto.BOOL, number=2, ) @@ -162,7 +164,7 @@ class LiveAgentHandoff(proto.Message): Dialogflow doesn't impose any structure on this. """ - metadata = proto.Field( + metadata: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=1, message=struct_pb2.Struct, @@ -194,7 +196,7 @@ class ConversationSuccess(proto.Message): any structure on this. """ - metadata = proto.Field( + metadata: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=1, message=struct_pb2.Struct, @@ -229,17 +231,17 @@ class OutputAudioText(proto.Message): Dialogflow request. """ - text = proto.Field( + text: str = proto.Field( proto.STRING, number=1, oneof="source", ) - ssml = proto.Field( + ssml: str = proto.Field( proto.STRING, number=2, oneof="source", ) - allow_playback_interruption = proto.Field( + allow_playback_interruption: bool = proto.Field( proto.BOOL, number=3, ) @@ -267,11 +269,11 @@ class PlayAudio(proto.Message): Dialogflow request. """ - audio_uri = proto.Field( + audio_uri: str = proto.Field( proto.STRING, number=1, ) - allow_playback_interruption = proto.Field( + allow_playback_interruption: bool = proto.Field( proto.BOOL, number=2, ) @@ -286,7 +288,7 @@ class MixedAudio(proto.Message): defined by the user. Attributes: - segments (Sequence[google.cloud.dialogflowcx_v3beta1.types.ResponseMessage.MixedAudio.Segment]): + segments (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.ResponseMessage.MixedAudio.Segment]): Segments this audio response is composed of. """ @@ -320,22 +322,24 @@ class Segment(proto.Message): Dialogflow request. """ - audio = proto.Field( + audio: bytes = proto.Field( proto.BYTES, number=1, oneof="content", ) - uri = proto.Field( + uri: str = proto.Field( proto.STRING, number=2, oneof="content", ) - allow_playback_interruption = proto.Field( + allow_playback_interruption: bool = proto.Field( proto.BOOL, number=3, ) - segments = proto.RepeatedField( + segments: MutableSequence[ + "ResponseMessage.MixedAudio.Segment" + ] = proto.RepeatedField( proto.MESSAGE, number=1, message="ResponseMessage.MixedAudio.Segment", @@ -356,61 +360,61 @@ class TelephonyTransferCall(proto.Message): This field is a member of `oneof`_ ``endpoint``. """ - phone_number = proto.Field( + phone_number: str = proto.Field( proto.STRING, number=1, oneof="endpoint", ) - text = proto.Field( + text: Text = proto.Field( proto.MESSAGE, number=1, oneof="message", message=Text, ) - payload = proto.Field( + payload: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=2, oneof="message", message=struct_pb2.Struct, ) - conversation_success = proto.Field( + conversation_success: ConversationSuccess = proto.Field( proto.MESSAGE, number=9, oneof="message", message=ConversationSuccess, ) - output_audio_text = proto.Field( + output_audio_text: OutputAudioText = proto.Field( proto.MESSAGE, number=8, oneof="message", message=OutputAudioText, ) - live_agent_handoff = proto.Field( + live_agent_handoff: LiveAgentHandoff = proto.Field( proto.MESSAGE, number=10, oneof="message", message=LiveAgentHandoff, ) - end_interaction = proto.Field( + end_interaction: EndInteraction = proto.Field( proto.MESSAGE, number=11, oneof="message", message=EndInteraction, ) - play_audio = proto.Field( + play_audio: PlayAudio = proto.Field( proto.MESSAGE, number=12, oneof="message", message=PlayAudio, ) - mixed_audio = proto.Field( + mixed_audio: MixedAudio = proto.Field( proto.MESSAGE, number=13, oneof="message", message=MixedAudio, ) - telephony_transfer_call = proto.Field( + telephony_transfer_call: TelephonyTransferCall = proto.Field( proto.MESSAGE, number=18, oneof="message", diff --git a/google/cloud/dialogflowcx_v3beta1/types/security_settings.py b/google/cloud/dialogflowcx_v3beta1/types/security_settings.py index adee962f..8a1e2090 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/security_settings.py +++ b/google/cloud/dialogflowcx_v3beta1/types/security_settings.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -42,7 +44,7 @@ class GetSecuritySettingsRequest(proto.Message): ``projects//locations//securitySettings/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -62,12 +64,12 @@ class UpdateSecuritySettingsRequest(proto.Message): fields will be updated. """ - security_settings = proto.Field( + security_settings: "SecuritySettings" = proto.Field( proto.MESSAGE, number=1, message="SecuritySettings", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -89,15 +91,15 @@ class ListSecuritySettingsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -107,7 +109,7 @@ class ListSecuritySettingsResponse(proto.Message): r"""The response message for [SecuritySettings.ListSecuritySettings][]. Attributes: - security_settings (Sequence[google.cloud.dialogflowcx_v3beta1.types.SecuritySettings]): + security_settings (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.SecuritySettings]): The list of security settings. next_page_token (str): Token to retrieve the next page of results, @@ -119,12 +121,12 @@ class ListSecuritySettingsResponse(proto.Message): def raw_page(self): return self - security_settings = proto.RepeatedField( + security_settings: MutableSequence["SecuritySettings"] = proto.RepeatedField( proto.MESSAGE, number=1, message="SecuritySettings", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -143,11 +145,11 @@ class CreateSecuritySettingsRequest(proto.Message): Required. The security settings to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - security_settings = proto.Field( + security_settings: "SecuritySettings" = proto.Field( proto.MESSAGE, number=2, message="SecuritySettings", @@ -165,7 +167,7 @@ class DeleteSecuritySettingsRequest(proto.Message): ``projects//locations//securitySettings/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -243,16 +245,14 @@ class SecuritySettings(proto.Message): Cloud logging, which is owned by the user - not Dialogflow. User must set a value lower than Dialogflow's - default 365d TTL. Setting a value higher than - that has no effect. - A missing value or setting to 0 also means we - use Dialogflow's default TTL. - Note: Interaction logging is a limited access - feature. Talk to your Google representative to - check availability for you. + default 365d TTL (30 days for Agent Assist + traffic), higher value will be ignored and use + default. Setting a value higher than that has no + effect. A missing value or setting to 0 also + means we use default TTL. This field is a member of `oneof`_ ``data_retention``. - purge_data_types (Sequence[google.cloud.dialogflowcx_v3beta1.types.SecuritySettings.PurgeDataType]): + purge_data_types (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.SecuritySettings.PurgeDataType]): List of types of data to remove when retention settings triggers purge. audio_export_settings (google.cloud.dialogflowcx_v3beta1.types.SecuritySettings.AudioExportSettings): @@ -333,19 +333,19 @@ class AudioFormat(proto.Enum): MP3 = 2 OGG = 3 - gcs_bucket = proto.Field( + gcs_bucket: str = proto.Field( proto.STRING, number=1, ) - audio_export_pattern = proto.Field( + audio_export_pattern: str = proto.Field( proto.STRING, number=2, ) - enable_audio_redaction = proto.Field( + enable_audio_redaction: bool = proto.Field( proto.BOOL, number=3, ) - audio_format = proto.Field( + audio_format: "SecuritySettings.AudioExportSettings.AudioFormat" = proto.Field( proto.ENUM, number=4, enum="SecuritySettings.AudioExportSettings.AudioFormat", @@ -362,53 +362,53 @@ class InsightsExportSettings(proto.Message): analyzers. """ - enable_insights_export = proto.Field( + enable_insights_export: bool = proto.Field( proto.BOOL, number=1, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - redaction_strategy = proto.Field( + redaction_strategy: RedactionStrategy = proto.Field( proto.ENUM, number=3, enum=RedactionStrategy, ) - redaction_scope = proto.Field( + redaction_scope: RedactionScope = proto.Field( proto.ENUM, number=4, enum=RedactionScope, ) - inspect_template = proto.Field( + inspect_template: str = proto.Field( proto.STRING, number=9, ) - deidentify_template = proto.Field( + deidentify_template: str = proto.Field( proto.STRING, number=17, ) - retention_window_days = proto.Field( + retention_window_days: int = proto.Field( proto.INT32, number=6, oneof="data_retention", ) - purge_data_types = proto.RepeatedField( + purge_data_types: MutableSequence[PurgeDataType] = proto.RepeatedField( proto.ENUM, number=8, enum=PurgeDataType, ) - audio_export_settings = proto.Field( + audio_export_settings: AudioExportSettings = proto.Field( proto.MESSAGE, number=12, message=AudioExportSettings, ) - insights_export_settings = proto.Field( + insights_export_settings: InsightsExportSettings = proto.Field( proto.MESSAGE, number=13, message=InsightsExportSettings, diff --git a/google/cloud/dialogflowcx_v3beta1/types/session.py b/google/cloud/dialogflowcx_v3beta1/types/session.py index 199ae9ac..76688fbd 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/session.py +++ b/google/cloud/dialogflowcx_v3beta1/types/session.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3beta1.types import audio_config @@ -83,21 +85,21 @@ class DetectIntentRequest(proto.Message): generate the output audio. """ - session = proto.Field( + session: str = proto.Field( proto.STRING, number=1, ) - query_params = proto.Field( + query_params: "QueryParameters" = proto.Field( proto.MESSAGE, number=2, message="QueryParameters", ) - query_input = proto.Field( + query_input: "QueryInput" = proto.Field( proto.MESSAGE, number=3, message="QueryInput", ) - output_audio_config = proto.Field( + output_audio_config: audio_config.OutputAudioConfig = proto.Field( proto.MESSAGE, number=4, message=audio_config.OutputAudioConfig, @@ -146,30 +148,30 @@ class ResponseType(proto.Enum): PARTIAL = 1 FINAL = 2 - response_id = proto.Field( + response_id: str = proto.Field( proto.STRING, number=1, ) - query_result = proto.Field( + query_result: "QueryResult" = proto.Field( proto.MESSAGE, number=2, message="QueryResult", ) - output_audio = proto.Field( + output_audio: bytes = proto.Field( proto.BYTES, number=4, ) - output_audio_config = proto.Field( + output_audio_config: audio_config.OutputAudioConfig = proto.Field( proto.MESSAGE, number=5, message=audio_config.OutputAudioConfig, ) - response_type = proto.Field( + response_type: ResponseType = proto.Field( proto.ENUM, number=6, enum=ResponseType, ) - allow_cancellation = proto.Field( + allow_cancellation: bool = proto.Field( proto.BOOL, number=7, ) @@ -245,26 +247,26 @@ class StreamingDetectIntentRequest(proto.Message): the agent have been configured to return partial responses. """ - session = proto.Field( + session: str = proto.Field( proto.STRING, number=1, ) - query_params = proto.Field( + query_params: "QueryParameters" = proto.Field( proto.MESSAGE, number=2, message="QueryParameters", ) - query_input = proto.Field( + query_input: "QueryInput" = proto.Field( proto.MESSAGE, number=3, message="QueryInput", ) - output_audio_config = proto.Field( + output_audio_config: audio_config.OutputAudioConfig = proto.Field( proto.MESSAGE, number=4, message=audio_config.OutputAudioConfig, ) - enable_partial_response = proto.Field( + enable_partial_response: bool = proto.Field( proto.BOOL, number=5, ) @@ -318,13 +320,13 @@ class StreamingDetectIntentResponse(proto.Message): This field is a member of `oneof`_ ``response``. """ - recognition_result = proto.Field( + recognition_result: "StreamingRecognitionResult" = proto.Field( proto.MESSAGE, number=1, oneof="response", message="StreamingRecognitionResult", ) - detect_intent_response = proto.Field( + detect_intent_response: "DetectIntentResponse" = proto.Field( proto.MESSAGE, number=2, oneof="response", @@ -407,7 +409,7 @@ class StreamingRecognitionResult(proto.Message): ``is_final = false``. - Otherwise, the value is in (0.0, 1.0] where 0.0 means completely unstable and 1.0 means completely stable. - speech_word_info (Sequence[google.cloud.dialogflowcx_v3beta1.types.SpeechWordInfo]): + speech_word_info (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.SpeechWordInfo]): Word-specific information for the words recognized by Speech in [transcript][google.cloud.dialogflow.cx.v3beta1.StreamingRecognitionResult.transcript]. @@ -427,38 +429,40 @@ class MessageType(proto.Enum): TRANSCRIPT = 1 END_OF_SINGLE_UTTERANCE = 2 - message_type = proto.Field( + message_type: MessageType = proto.Field( proto.ENUM, number=1, enum=MessageType, ) - transcript = proto.Field( + transcript: str = proto.Field( proto.STRING, number=2, ) - is_final = proto.Field( + is_final: bool = proto.Field( proto.BOOL, number=3, ) - confidence = proto.Field( + confidence: float = proto.Field( proto.FLOAT, number=4, ) - stability = proto.Field( + stability: float = proto.Field( proto.FLOAT, number=6, ) - speech_word_info = proto.RepeatedField( + speech_word_info: MutableSequence[ + audio_config.SpeechWordInfo + ] = proto.RepeatedField( proto.MESSAGE, number=7, message=audio_config.SpeechWordInfo, ) - speech_end_offset = proto.Field( + speech_end_offset: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=8, message=duration_pb2.Duration, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=10, ) @@ -476,7 +480,7 @@ class QueryParameters(proto.Message): geo_location (google.type.latlng_pb2.LatLng): The geo location of this conversational query. - session_entity_types (Sequence[google.cloud.dialogflowcx_v3beta1.types.SessionEntityType]): + session_entity_types (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.SessionEntityType]): Additional session entity types to replace or extend developer entity types with. The entity synonyms apply to all languages and persist for @@ -542,7 +546,7 @@ class QueryParameters(proto.Message): Configures whether sentiment analysis should be performed. If not provided, sentiment analysis is not performed. - webhook_headers (Mapping[str, str]): + webhook_headers (MutableMapping[str, str]): This field can be used to pass HTTP headers for a webhook call. These headers will be sent to webhook along with the headers that have been @@ -556,7 +560,7 @@ class QueryParameters(proto.Message): "User-Agent", "Accept-Encoding", "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc. - flow_versions (Sequence[str]): + flow_versions (MutableSequence[str]): A list of flow versions to override for the request. Format: ``projects//locations//agents//flows//versions/``. @@ -566,48 +570,50 @@ class QueryParameters(proto.Message): at most one version specified in this list. """ - time_zone = proto.Field( + time_zone: str = proto.Field( proto.STRING, number=1, ) - geo_location = proto.Field( + geo_location: latlng_pb2.LatLng = proto.Field( proto.MESSAGE, number=2, message=latlng_pb2.LatLng, ) - session_entity_types = proto.RepeatedField( + session_entity_types: MutableSequence[ + session_entity_type.SessionEntityType + ] = proto.RepeatedField( proto.MESSAGE, number=3, message=session_entity_type.SessionEntityType, ) - payload = proto.Field( + payload: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=4, message=struct_pb2.Struct, ) - parameters = proto.Field( + parameters: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=5, message=struct_pb2.Struct, ) - current_page = proto.Field( + current_page: str = proto.Field( proto.STRING, number=6, ) - disable_webhook = proto.Field( + disable_webhook: bool = proto.Field( proto.BOOL, number=7, ) - analyze_query_text_sentiment = proto.Field( + analyze_query_text_sentiment: bool = proto.Field( proto.BOOL, number=8, ) - webhook_headers = proto.MapField( + webhook_headers: MutableMapping[str, str] = proto.MapField( proto.STRING, proto.STRING, number=10, ) - flow_versions = proto.RepeatedField( + flow_versions: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=14, ) @@ -659,37 +665,37 @@ class QueryInput(proto.Message): specify the same language. """ - text = proto.Field( + text: "TextInput" = proto.Field( proto.MESSAGE, number=2, oneof="input", message="TextInput", ) - intent = proto.Field( + intent: "IntentInput" = proto.Field( proto.MESSAGE, number=3, oneof="input", message="IntentInput", ) - audio = proto.Field( + audio: "AudioInput" = proto.Field( proto.MESSAGE, number=5, oneof="input", message="AudioInput", ) - event = proto.Field( + event: "EventInput" = proto.Field( proto.MESSAGE, number=6, oneof="input", message="EventInput", ) - dtmf = proto.Field( + dtmf: "DtmfInput" = proto.Field( proto.MESSAGE, number=7, oneof="input", message="DtmfInput", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=4, ) @@ -762,15 +768,15 @@ class QueryResult(proto.Message): - MapValue value: If parameter's entity type is a composite entity then use map from composite entity property names to property values, otherwise, use parameter value. - response_messages (Sequence[google.cloud.dialogflowcx_v3beta1.types.ResponseMessage]): + response_messages (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.ResponseMessage]): The list of rich messages returned to the client. Responses vary from simple text messages to more sophisticated, structured payloads used to drive complex logic. - webhook_statuses (Sequence[google.rpc.status_pb2.Status]): + webhook_statuses (MutableSequence[google.rpc.status_pb2.Status]): The list of webhook call status in the order of call sequence. - webhook_payloads (Sequence[google.protobuf.struct_pb2.Struct]): + webhook_payloads (MutableSequence[google.protobuf.struct_pb2.Struct]): The list of webhook payload in [WebhookResponse.payload][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.payload], in the order of call sequence. If some webhook call fails or @@ -830,81 +836,83 @@ class QueryResult(proto.Message): specified in the request. """ - text = proto.Field( + text: str = proto.Field( proto.STRING, number=1, oneof="query", ) - trigger_intent = proto.Field( + trigger_intent: str = proto.Field( proto.STRING, number=11, oneof="query", ) - transcript = proto.Field( + transcript: str = proto.Field( proto.STRING, number=12, oneof="query", ) - trigger_event = proto.Field( + trigger_event: str = proto.Field( proto.STRING, number=14, oneof="query", ) - dtmf = proto.Field( + dtmf: "DtmfInput" = proto.Field( proto.MESSAGE, number=23, oneof="query", message="DtmfInput", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) - parameters = proto.Field( + parameters: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=3, message=struct_pb2.Struct, ) - response_messages = proto.RepeatedField( + response_messages: MutableSequence[ + response_message.ResponseMessage + ] = proto.RepeatedField( proto.MESSAGE, number=4, message=response_message.ResponseMessage, ) - webhook_statuses = proto.RepeatedField( + webhook_statuses: MutableSequence[status_pb2.Status] = proto.RepeatedField( proto.MESSAGE, number=13, message=status_pb2.Status, ) - webhook_payloads = proto.RepeatedField( + webhook_payloads: MutableSequence[struct_pb2.Struct] = proto.RepeatedField( proto.MESSAGE, number=6, message=struct_pb2.Struct, ) - current_page = proto.Field( + current_page: page.Page = proto.Field( proto.MESSAGE, number=7, message=page.Page, ) - intent = proto.Field( + intent: gcdc_intent.Intent = proto.Field( proto.MESSAGE, number=8, message=gcdc_intent.Intent, ) - intent_detection_confidence = proto.Field( + intent_detection_confidence: float = proto.Field( proto.FLOAT, number=9, ) - match = proto.Field( + match: "Match" = proto.Field( proto.MESSAGE, number=15, message="Match", ) - diagnostic_info = proto.Field( + diagnostic_info: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=10, message=struct_pb2.Struct, ) - sentiment_analysis_result = proto.Field( + sentiment_analysis_result: "SentimentAnalysisResult" = proto.Field( proto.MESSAGE, number=17, message="SentimentAnalysisResult", @@ -921,7 +929,7 @@ class TextInput(proto.Message): exceed 256 characters. """ - text = proto.Field( + text: str = proto.Field( proto.STRING, number=1, ) @@ -937,7 +945,7 @@ class IntentInput(proto.Message): ``projects//locations//agents//intents/``. """ - intent = proto.Field( + intent: str = proto.Field( proto.STRING, number=1, ) @@ -963,12 +971,12 @@ class AudioInput(proto.Message): ``audio`` must be provided in all following requests. """ - config = proto.Field( + config: audio_config.InputAudioConfig = proto.Field( proto.MESSAGE, number=1, message=audio_config.InputAudioConfig, ) - audio = proto.Field( + audio: bytes = proto.Field( proto.BYTES, number=2, ) @@ -982,7 +990,7 @@ class EventInput(proto.Message): Name of the event. """ - event = proto.Field( + event: str = proto.Field( proto.STRING, number=1, ) @@ -998,11 +1006,11 @@ class DtmfInput(proto.Message): The finish digit (if any). """ - digits = proto.Field( + digits: str = proto.Field( proto.STRING, number=1, ) - finish_digit = proto.Field( + finish_digit: str = proto.Field( proto.STRING, number=2, ) @@ -1073,30 +1081,30 @@ class MatchType(proto.Enum): NO_INPUT = 5 EVENT = 6 - intent = proto.Field( + intent: gcdc_intent.Intent = proto.Field( proto.MESSAGE, number=1, message=gcdc_intent.Intent, ) - event = proto.Field( + event: str = proto.Field( proto.STRING, number=6, ) - parameters = proto.Field( + parameters: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=2, message=struct_pb2.Struct, ) - resolved_input = proto.Field( + resolved_input: str = proto.Field( proto.STRING, number=3, ) - match_type = proto.Field( + match_type: MatchType = proto.Field( proto.ENUM, number=4, enum=MatchType, ) - confidence = proto.Field( + confidence: float = proto.Field( proto.FLOAT, number=5, ) @@ -1126,16 +1134,16 @@ class MatchIntentRequest(proto.Message): Required. The input specification. """ - session = proto.Field( + session: str = proto.Field( proto.STRING, number=1, ) - query_params = proto.Field( + query_params: "QueryParameters" = proto.Field( proto.MESSAGE, number=2, message="QueryParameters", ) - query_input = proto.Field( + query_input: "QueryInput" = proto.Field( proto.MESSAGE, number=3, message="QueryInput", @@ -1181,7 +1189,7 @@ class MatchIntentResponse(proto.Message): event name. This field is a member of `oneof`_ ``query``. - matches (Sequence[google.cloud.dialogflowcx_v3beta1.types.Match]): + matches (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Match]): Match results, if more than one, ordered descendingly by the confidence we have that the particular intent matches the query. @@ -1191,32 +1199,32 @@ class MatchIntentResponse(proto.Message): but not limited to ``name`` and ``display_name``. """ - text = proto.Field( + text: str = proto.Field( proto.STRING, number=1, oneof="query", ) - trigger_intent = proto.Field( + trigger_intent: str = proto.Field( proto.STRING, number=2, oneof="query", ) - transcript = proto.Field( + transcript: str = proto.Field( proto.STRING, number=3, oneof="query", ) - trigger_event = proto.Field( + trigger_event: str = proto.Field( proto.STRING, number=6, oneof="query", ) - matches = proto.RepeatedField( + matches: MutableSequence["Match"] = proto.RepeatedField( proto.MESSAGE, number=4, message="Match", ) - current_page = proto.Field( + current_page: page.Page = proto.Field( proto.MESSAGE, number=5, message=page.Page, @@ -1237,17 +1245,17 @@ class FulfillIntentRequest(proto.Message): generate output audio. """ - match_intent_request = proto.Field( + match_intent_request: "MatchIntentRequest" = proto.Field( proto.MESSAGE, number=1, message="MatchIntentRequest", ) - match = proto.Field( + match: "Match" = proto.Field( proto.MESSAGE, number=2, message="Match", ) - output_audio_config = proto.Field( + output_audio_config: audio_config.OutputAudioConfig = proto.Field( proto.MESSAGE, number=3, message=audio_config.OutputAudioConfig, @@ -1283,20 +1291,20 @@ class FulfillIntentResponse(proto.Message): generate the output audio. """ - response_id = proto.Field( + response_id: str = proto.Field( proto.STRING, number=1, ) - query_result = proto.Field( + query_result: "QueryResult" = proto.Field( proto.MESSAGE, number=2, message="QueryResult", ) - output_audio = proto.Field( + output_audio: bytes = proto.Field( proto.BYTES, number=3, ) - output_audio_config = proto.Field( + output_audio_config: audio_config.OutputAudioConfig = proto.Field( proto.MESSAGE, number=4, message=audio_config.OutputAudioConfig, @@ -1319,11 +1327,11 @@ class SentimentAnalysisResult(proto.Message): of score (positive or negative). """ - score = proto.Field( + score: float = proto.Field( proto.FLOAT, number=1, ) - magnitude = proto.Field( + magnitude: float = proto.Field( proto.FLOAT, number=2, ) diff --git a/google/cloud/dialogflowcx_v3beta1/types/session_entity_type.py b/google/cloud/dialogflowcx_v3beta1/types/session_entity_type.py index e502c9d6..c2fc63a2 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/session_entity_type.py +++ b/google/cloud/dialogflowcx_v3beta1/types/session_entity_type.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3beta1.types import entity_type @@ -63,7 +65,7 @@ class SessionEntityType(proto.Message): Required. Indicates whether the additional data should override or supplement the custom entity type definition. - entities (Sequence[google.cloud.dialogflowcx_v3beta1.types.EntityType.Entity]): + entities (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.EntityType.Entity]): Required. The collection of entities to override or supplement the custom entity type. """ @@ -74,16 +76,16 @@ class EntityOverrideMode(proto.Enum): ENTITY_OVERRIDE_MODE_OVERRIDE = 1 ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - entity_override_mode = proto.Field( + entity_override_mode: EntityOverrideMode = proto.Field( proto.ENUM, number=3, enum=EntityOverrideMode, ) - entities = proto.RepeatedField( + entities: MutableSequence[entity_type.EntityType.Entity] = proto.RepeatedField( proto.MESSAGE, number=4, message=entity_type.EntityType.Entity, @@ -111,15 +113,15 @@ class ListSessionEntityTypesRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -130,7 +132,7 @@ class ListSessionEntityTypesResponse(proto.Message): [SessionEntityTypes.ListSessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes.ListSessionEntityTypes]. Attributes: - session_entity_types (Sequence[google.cloud.dialogflowcx_v3beta1.types.SessionEntityType]): + session_entity_types (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.SessionEntityType]): The list of session entity types. There will be a maximum number of items returned based on the page_size field in the request. @@ -144,12 +146,12 @@ class ListSessionEntityTypesResponse(proto.Message): def raw_page(self): return self - session_entity_types = proto.RepeatedField( + session_entity_types: MutableSequence["SessionEntityType"] = proto.RepeatedField( proto.MESSAGE, number=1, message="SessionEntityType", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -169,7 +171,7 @@ class GetSessionEntityTypeRequest(proto.Message): 'draft' environment. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -192,11 +194,11 @@ class CreateSessionEntityTypeRequest(proto.Message): Required. The session entity type to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - session_entity_type = proto.Field( + session_entity_type: "SessionEntityType" = proto.Field( proto.MESSAGE, number=2, message="SessionEntityType", @@ -219,12 +221,12 @@ class UpdateSessionEntityTypeRequest(proto.Message): The mask to control which fields get updated. """ - session_entity_type = proto.Field( + session_entity_type: "SessionEntityType" = proto.Field( proto.MESSAGE, number=1, message="SessionEntityType", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -246,7 +248,7 @@ class DeleteSessionEntityTypeRequest(proto.Message): 'draft' environment. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/google/cloud/dialogflowcx_v3beta1/types/test_case.py b/google/cloud/dialogflowcx_v3beta1/types/test_case.py index a3472e7b..549ed3a8 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/test_case.py +++ b/google/cloud/dialogflowcx_v3beta1/types/test_case.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3beta1.types import flow as gcdc_flow @@ -84,7 +86,7 @@ class TestCase(proto.Message): [TestCases.CreateTestCase][google.cloud.dialogflow.cx.v3beta1.TestCases.CreateTestCase] will populate the name automatically. Otherwise use format: ``projects//locations//agents/ /testCases/``. - tags (Sequence[str]): + tags (MutableSequence[str]): Tags are short descriptions that users may apply to test cases for organizational and filtering purposes. Each tag should start with @@ -98,7 +100,7 @@ class TestCase(proto.Message): case. Limit of 400 characters. test_config (google.cloud.dialogflowcx_v3beta1.types.TestConfig): Config for the test case. - test_case_conversation_turns (Sequence[google.cloud.dialogflowcx_v3beta1.types.ConversationTurn]): + test_case_conversation_turns (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.ConversationTurn]): The conversation turns uttered when the test case was created, in chronological order. These include the canonical set of agent utterances @@ -110,38 +112,40 @@ class TestCase(proto.Message): The latest test result. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - tags = proto.RepeatedField( + tags: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=2, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=3, ) - notes = proto.Field( + notes: str = proto.Field( proto.STRING, number=4, ) - test_config = proto.Field( + test_config: "TestConfig" = proto.Field( proto.MESSAGE, number=13, message="TestConfig", ) - test_case_conversation_turns = proto.RepeatedField( + test_case_conversation_turns: MutableSequence[ + "ConversationTurn" + ] = proto.RepeatedField( proto.MESSAGE, number=5, message="ConversationTurn", ) - creation_time = proto.Field( + creation_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=10, message=timestamp_pb2.Timestamp, ) - last_test_result = proto.Field( + last_test_result: "TestCaseResult" = proto.Field( proto.MESSAGE, number=12, message="TestCaseResult", @@ -159,7 +163,7 @@ class TestCaseResult(proto.Message): environment (str): Environment where the test was run. If not set, it indicates the draft environment. - conversation_turns (Sequence[google.cloud.dialogflowcx_v3beta1.types.ConversationTurn]): + conversation_turns (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.ConversationTurn]): The conversation turns uttered during the test case replay in chronological order. test_result (google.cloud.dialogflowcx_v3beta1.types.TestResult): @@ -169,25 +173,25 @@ class TestCaseResult(proto.Message): The time that the test was run. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - environment = proto.Field( + environment: str = proto.Field( proto.STRING, number=2, ) - conversation_turns = proto.RepeatedField( + conversation_turns: MutableSequence["ConversationTurn"] = proto.RepeatedField( proto.MESSAGE, number=3, message="ConversationTurn", ) - test_result = proto.Field( + test_result: "TestResult" = proto.Field( proto.ENUM, number=4, enum="TestResult", ) - test_time = proto.Field( + test_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, @@ -198,7 +202,7 @@ class TestConfig(proto.Message): r"""Represents configurations for a test case. Attributes: - tracking_parameters (Sequence[str]): + tracking_parameters (MutableSequence[str]): Session parameters to be compared when calculating differences. flow (str): @@ -222,15 +226,15 @@ class TestConfig(proto.Message): start flow. """ - tracking_parameters = proto.RepeatedField( + tracking_parameters: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - flow = proto.Field( + flow: str = proto.Field( proto.STRING, number=2, ) - page = proto.Field( + page: str = proto.Field( proto.STRING, number=3, ) @@ -271,21 +275,21 @@ class UserInput(proto.Message): Whether sentiment analysis is enabled. """ - input = proto.Field( + input: session.QueryInput = proto.Field( proto.MESSAGE, number=5, message=session.QueryInput, ) - injected_parameters = proto.Field( + injected_parameters: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=2, message=struct_pb2.Struct, ) - is_webhook_enabled = proto.Field( + is_webhook_enabled: bool = proto.Field( proto.BOOL, number=3, ) - enable_sentiment_analysis = proto.Field( + enable_sentiment_analysis: bool = proto.Field( proto.BOOL, number=7, ) @@ -297,7 +301,7 @@ class VirtualAgentOutput(proto.Message): session_parameters (google.protobuf.struct_pb2.Struct): The session parameters available to the bot at this point. - differences (Sequence[google.cloud.dialogflowcx_v3beta1.types.TestRunDifference]): + differences (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TestRunDifference]): Output only. If this is part of a [result conversation turn][TestCaseResult.conversation_turns], the list of differences between the original run and the replay for this @@ -315,7 +319,7 @@ class VirtualAgentOutput(proto.Message): The [Page][google.cloud.dialogflow.cx.v3beta1.Page] on which the utterance was spoken. Only name and displayName will be set. - text_responses (Sequence[google.cloud.dialogflowcx_v3beta1.types.ResponseMessage.Text]): + text_responses (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.ResponseMessage.Text]): The [text][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Text] responses from the agent for the turn. @@ -324,48 +328,50 @@ class VirtualAgentOutput(proto.Message): result. If set, other output is empty. """ - session_parameters = proto.Field( + session_parameters: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=4, message=struct_pb2.Struct, ) - differences = proto.RepeatedField( + differences: MutableSequence["TestRunDifference"] = proto.RepeatedField( proto.MESSAGE, number=5, message="TestRunDifference", ) - diagnostic_info = proto.Field( + diagnostic_info: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=6, message=struct_pb2.Struct, ) - triggered_intent = proto.Field( + triggered_intent: gcdc_intent.Intent = proto.Field( proto.MESSAGE, number=7, message=gcdc_intent.Intent, ) - current_page = proto.Field( + current_page: gcdc_page.Page = proto.Field( proto.MESSAGE, number=8, message=gcdc_page.Page, ) - text_responses = proto.RepeatedField( + text_responses: MutableSequence[ + response_message.ResponseMessage.Text + ] = proto.RepeatedField( proto.MESSAGE, number=9, message=response_message.ResponseMessage.Text, ) - status = proto.Field( + status: status_pb2.Status = proto.Field( proto.MESSAGE, number=10, message=status_pb2.Status, ) - user_input = proto.Field( + user_input: UserInput = proto.Field( proto.MESSAGE, number=1, message=UserInput, ) - virtual_agent_output = proto.Field( + virtual_agent_output: VirtualAgentOutput = proto.Field( proto.MESSAGE, number=2, message=VirtualAgentOutput, @@ -392,12 +398,12 @@ class DiffType(proto.Enum): PARAMETERS = 3 UTTERANCE = 4 - type_ = proto.Field( + type_: DiffType = proto.Field( proto.ENUM, number=1, enum=DiffType, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=2, ) @@ -410,7 +416,7 @@ class TransitionCoverage(proto.Message): of a parent's test cases. Attributes: - transitions (Sequence[google.cloud.dialogflowcx_v3beta1.types.TransitionCoverage.Transition]): + transitions (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TransitionCoverage.Transition]): The list of Transitions present in the agent. coverage_score (float): The percent of transitions in the agent that @@ -442,13 +448,13 @@ class TransitionNode(proto.Message): This field is a member of `oneof`_ ``kind``. """ - page = proto.Field( + page: gcdc_page.Page = proto.Field( proto.MESSAGE, number=1, oneof="kind", message=gcdc_page.Page, ) - flow = proto.Field( + flow: gcdc_flow.Flow = proto.Field( proto.MESSAGE, number=2, oneof="kind", @@ -486,43 +492,43 @@ class Transition(proto.Message): This field is a member of `oneof`_ ``detail``. """ - source = proto.Field( + source: "TransitionCoverage.TransitionNode" = proto.Field( proto.MESSAGE, number=1, message="TransitionCoverage.TransitionNode", ) - index = proto.Field( + index: int = proto.Field( proto.INT32, number=4, ) - target = proto.Field( + target: "TransitionCoverage.TransitionNode" = proto.Field( proto.MESSAGE, number=2, message="TransitionCoverage.TransitionNode", ) - covered = proto.Field( + covered: bool = proto.Field( proto.BOOL, number=3, ) - transition_route = proto.Field( + transition_route: gcdc_page.TransitionRoute = proto.Field( proto.MESSAGE, number=5, oneof="detail", message=gcdc_page.TransitionRoute, ) - event_handler = proto.Field( + event_handler: gcdc_page.EventHandler = proto.Field( proto.MESSAGE, number=6, oneof="detail", message=gcdc_page.EventHandler, ) - transitions = proto.RepeatedField( + transitions: MutableSequence[Transition] = proto.RepeatedField( proto.MESSAGE, number=1, message=Transition, ) - coverage_score = proto.Field( + coverage_score: float = proto.Field( proto.FLOAT, number=2, ) @@ -535,7 +541,7 @@ class TransitionRouteGroupCoverage(proto.Message): group. Attributes: - coverages (Sequence[google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroupCoverage.Coverage]): + coverages (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroupCoverage.Coverage]): Transition route group coverages. coverage_score (float): The percent of transition routes in all the @@ -549,7 +555,7 @@ class Coverage(proto.Message): route_group (google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroup): Transition route group metadata. Only name and displayName will be set. - transitions (Sequence[google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroupCoverage.Coverage.Transition]): + transitions (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroupCoverage.Coverage.Transition]): The list of transition routes and coverage in the transition route group. coverage_score (float): @@ -569,37 +575,39 @@ class Transition(proto.Message): cases. """ - transition_route = proto.Field( + transition_route: gcdc_page.TransitionRoute = proto.Field( proto.MESSAGE, number=1, message=gcdc_page.TransitionRoute, ) - covered = proto.Field( + covered: bool = proto.Field( proto.BOOL, number=2, ) - route_group = proto.Field( + route_group: transition_route_group.TransitionRouteGroup = proto.Field( proto.MESSAGE, number=1, message=transition_route_group.TransitionRouteGroup, ) - transitions = proto.RepeatedField( + transitions: MutableSequence[ + "TransitionRouteGroupCoverage.Coverage.Transition" + ] = proto.RepeatedField( proto.MESSAGE, number=2, message="TransitionRouteGroupCoverage.Coverage.Transition", ) - coverage_score = proto.Field( + coverage_score: float = proto.Field( proto.FLOAT, number=3, ) - coverages = proto.RepeatedField( + coverages: MutableSequence[Coverage] = proto.RepeatedField( proto.MESSAGE, number=1, message=Coverage, ) - coverage_score = proto.Field( + coverage_score: float = proto.Field( proto.FLOAT, number=2, ) @@ -611,7 +619,7 @@ class IntentCoverage(proto.Message): test cases. Attributes: - intents (Sequence[google.cloud.dialogflowcx_v3beta1.types.IntentCoverage.Intent]): + intents (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.IntentCoverage.Intent]): The list of Intents present in the agent coverage_score (float): The percent of intents in the agent that are @@ -629,21 +637,21 @@ class Intent(proto.Message): least one of the agent's test cases. """ - intent = proto.Field( + intent: str = proto.Field( proto.STRING, number=1, ) - covered = proto.Field( + covered: bool = proto.Field( proto.BOOL, number=2, ) - intents = proto.RepeatedField( + intents: MutableSequence[Intent] = proto.RepeatedField( proto.MESSAGE, number=1, message=Intent, ) - coverage_score = proto.Field( + coverage_score: float = proto.Field( proto.FLOAT, number=2, ) @@ -668,11 +676,11 @@ class CoverageType(proto.Enum): PAGE_TRANSITION = 2 TRANSITION_ROUTE_GROUP = 3 - agent = proto.Field( + agent: str = proto.Field( proto.STRING, number=3, ) - type_ = proto.Field( + type_: CoverageType = proto.Field( proto.ENUM, number=2, enum=CoverageType, @@ -709,23 +717,23 @@ class CalculateCoverageResponse(proto.Message): This field is a member of `oneof`_ ``coverage_type``. """ - agent = proto.Field( + agent: str = proto.Field( proto.STRING, number=5, ) - intent_coverage = proto.Field( + intent_coverage: "IntentCoverage" = proto.Field( proto.MESSAGE, number=2, oneof="coverage_type", message="IntentCoverage", ) - transition_coverage = proto.Field( + transition_coverage: "TransitionCoverage" = proto.Field( proto.MESSAGE, number=4, oneof="coverage_type", message="TransitionCoverage", ) - route_group_coverage = proto.Field( + route_group_coverage: "TransitionRouteGroupCoverage" = proto.Field( proto.MESSAGE, number=6, oneof="coverage_type", @@ -763,19 +771,19 @@ class TestCaseView(proto.Enum): BASIC = 1 FULL = 2 - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) - view = proto.Field( + view: TestCaseView = proto.Field( proto.ENUM, number=4, enum=TestCaseView, @@ -787,7 +795,7 @@ class ListTestCasesResponse(proto.Message): [TestCases.ListTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ListTestCases]. Attributes: - test_cases (Sequence[google.cloud.dialogflowcx_v3beta1.types.TestCase]): + test_cases (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TestCase]): The list of test cases. There will be a maximum number of items returned based on the page_size field in the request. next_page_token (str): @@ -800,12 +808,12 @@ class ListTestCasesResponse(proto.Message): def raw_page(self): return self - test_cases = proto.RepeatedField( + test_cases: MutableSequence["TestCase"] = proto.RepeatedField( proto.MESSAGE, number=1, message="TestCase", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -819,16 +827,16 @@ class BatchDeleteTestCasesRequest(proto.Message): parent (str): Required. The agent to delete test cases from. Format: ``projects//locations//agents/``. - names (Sequence[str]): + names (MutableSequence[str]): Required. Format of test case names: ``projects//locations/ /agents//testCases/``. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - names = proto.RepeatedField( + names: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) @@ -846,11 +854,11 @@ class CreateTestCaseRequest(proto.Message): Required. The test case to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - test_case = proto.Field( + test_case: "TestCase" = proto.Field( proto.MESSAGE, number=2, message="TestCase", @@ -873,12 +881,12 @@ class UpdateTestCaseRequest(proto.Message): cannot be updated. """ - test_case = proto.Field( + test_case: "TestCase" = proto.Field( proto.MESSAGE, number=1, message="TestCase", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -895,7 +903,7 @@ class GetTestCaseRequest(proto.Message): ``projects//locations//agents//testCases/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -915,11 +923,11 @@ class RunTestCaseRequest(proto.Message): ``projects//locations//agents//environments/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - environment = proto.Field( + environment: str = proto.Field( proto.STRING, number=2, ) @@ -934,7 +942,7 @@ class RunTestCaseResponse(proto.Message): The result. """ - result = proto.Field( + result: "TestCaseResult" = proto.Field( proto.MESSAGE, number=2, message="TestCaseResult", @@ -960,20 +968,20 @@ class BatchRunTestCasesRequest(proto.Message): environment (str): Optional. If not set, draft environment is assumed. Format: ``projects//locations//agents//environments/``. - test_cases (Sequence[str]): + test_cases (MutableSequence[str]): Required. Format: ``projects//locations//agents//testCases/``. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - environment = proto.Field( + environment: str = proto.Field( proto.STRING, number=2, ) - test_cases = proto.RepeatedField( + test_cases: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) @@ -984,13 +992,13 @@ class BatchRunTestCasesResponse(proto.Message): [TestCases.BatchRunTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.BatchRunTestCases]. Attributes: - results (Sequence[google.cloud.dialogflowcx_v3beta1.types.TestCaseResult]): + results (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TestCaseResult]): The test case results. The detailed [conversation turns][google.cloud.dialogflow.cx.v3beta1.TestCaseResult.conversation_turns] are empty in this response. """ - results = proto.RepeatedField( + results: MutableSequence["TestCaseResult"] = proto.RepeatedField( proto.MESSAGE, number=1, message="TestCaseResult", @@ -1003,11 +1011,11 @@ class BatchRunTestCasesMetadata(proto.Message): long running operation. Attributes: - errors (Sequence[google.cloud.dialogflowcx_v3beta1.types.TestError]): + errors (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TestError]): The test errors. """ - errors = proto.RepeatedField( + errors: MutableSequence["TestError"] = proto.RepeatedField( proto.MESSAGE, number=1, message="TestError", @@ -1026,16 +1034,16 @@ class TestError(proto.Message): The timestamp when the test was completed. """ - test_case = proto.Field( + test_case: str = proto.Field( proto.STRING, number=1, ) - status = proto.Field( + status: status_pb2.Status = proto.Field( proto.MESSAGE, number=2, message=status_pb2.Status, ) - test_time = proto.Field( + test_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, @@ -1076,16 +1084,16 @@ class ImportTestCasesRequest(proto.Message): This field is a member of `oneof`_ ``source``. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - gcs_uri = proto.Field( + gcs_uri: str = proto.Field( proto.STRING, number=2, oneof="source", ) - content = proto.Field( + content: bytes = proto.Field( proto.BYTES, number=3, oneof="source", @@ -1097,12 +1105,12 @@ class ImportTestCasesResponse(proto.Message): [TestCases.ImportTestCases][google.cloud.dialogflow.cx.v3beta1.TestCases.ImportTestCases]. Attributes: - names (Sequence[str]): + names (MutableSequence[str]): The unique identifiers of the new test cases. Format: ``projects//locations//agents//testCases/``. """ - names = proto.RepeatedField( + names: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) @@ -1114,11 +1122,11 @@ class ImportTestCasesMetadata(proto.Message): long running operation. Attributes: - errors (Sequence[google.cloud.dialogflowcx_v3beta1.types.TestCaseError]): + errors (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TestCaseError]): Errors for failed test cases. """ - errors = proto.RepeatedField( + errors: MutableSequence["TestCaseError"] = proto.RepeatedField( proto.MESSAGE, number=1, message="TestCaseError", @@ -1135,12 +1143,12 @@ class TestCaseError(proto.Message): The status associated with the test case. """ - test_case = proto.Field( + test_case: "TestCase" = proto.Field( proto.MESSAGE, number=1, message="TestCase", ) - status = proto.Field( + status: status_pb2.Status = proto.Field( proto.MESSAGE, number=2, message=status_pb2.Status, @@ -1194,21 +1202,21 @@ class DataFormat(proto.Enum): BLOB = 1 JSON = 2 - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - gcs_uri = proto.Field( + gcs_uri: str = proto.Field( proto.STRING, number=2, oneof="destination", ) - data_format = proto.Field( + data_format: DataFormat = proto.Field( proto.ENUM, number=3, enum=DataFormat, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=4, ) @@ -1238,12 +1246,12 @@ class ExportTestCasesResponse(proto.Message): This field is a member of `oneof`_ ``destination``. """ - gcs_uri = proto.Field( + gcs_uri: str = proto.Field( proto.STRING, number=1, oneof="destination", ) - content = proto.Field( + content: bytes = proto.Field( proto.BYTES, number=2, oneof="destination", @@ -1302,19 +1310,19 @@ class ListTestCaseResultsRequest(proto.Message): 1602540713. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=4, ) @@ -1325,7 +1333,7 @@ class ListTestCaseResultsResponse(proto.Message): [TestCases.ListTestCaseResults][google.cloud.dialogflow.cx.v3beta1.TestCases.ListTestCaseResults]. Attributes: - test_case_results (Sequence[google.cloud.dialogflowcx_v3beta1.types.TestCaseResult]): + test_case_results (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TestCaseResult]): The list of test case results. next_page_token (str): Token to retrieve the next page of results, @@ -1337,12 +1345,12 @@ class ListTestCaseResultsResponse(proto.Message): def raw_page(self): return self - test_case_results = proto.RepeatedField( + test_case_results: MutableSequence["TestCaseResult"] = proto.RepeatedField( proto.MESSAGE, number=1, message="TestCaseResult", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -1358,7 +1366,7 @@ class GetTestCaseResultRequest(proto.Message): ``projects//locations//agents//testCases//results/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/google/cloud/dialogflowcx_v3beta1/types/transition_route_group.py b/google/cloud/dialogflowcx_v3beta1/types/transition_route_group.py index fdbd7fcc..5c702091 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/transition_route_group.py +++ b/google/cloud/dialogflowcx_v3beta1/types/transition_route_group.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3beta1.types import page @@ -49,20 +51,20 @@ class TransitionRouteGroup(proto.Message): transition route group, unique within the flow. The display name can be no longer than 30 characters. - transition_routes (Sequence[google.cloud.dialogflowcx_v3beta1.types.TransitionRoute]): + transition_routes (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TransitionRoute]): Transition routes associated with the [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - transition_routes = proto.RepeatedField( + transition_routes: MutableSequence[page.TransitionRoute] = proto.RepeatedField( proto.MESSAGE, number=5, message=page.TransitionRoute, @@ -100,19 +102,19 @@ class ListTransitionRouteGroupsRequest(proto.Message): before they can be used. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=4, ) @@ -123,7 +125,7 @@ class ListTransitionRouteGroupsResponse(proto.Message): [TransitionRouteGroups.ListTransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups.ListTransitionRouteGroups]. Attributes: - transition_route_groups (Sequence[google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroup]): + transition_route_groups (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.TransitionRouteGroup]): The list of transition route groups. There will be a maximum number of items returned based on the page_size field in the request. The list may in some cases be empty or contain @@ -139,12 +141,14 @@ class ListTransitionRouteGroupsResponse(proto.Message): def raw_page(self): return self - transition_route_groups = proto.RepeatedField( + transition_route_groups: MutableSequence[ + "TransitionRouteGroup" + ] = proto.RepeatedField( proto.MESSAGE, number=1, message="TransitionRouteGroup", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -176,11 +180,11 @@ class GetTransitionRouteGroupRequest(proto.Message): before they can be used. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=2, ) @@ -215,16 +219,16 @@ class CreateTransitionRouteGroupRequest(proto.Message): before they can be used. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - transition_route_group = proto.Field( + transition_route_group: "TransitionRouteGroup" = proto.Field( proto.MESSAGE, number=2, message="TransitionRouteGroup", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -256,17 +260,17 @@ class UpdateTransitionRouteGroupRequest(proto.Message): before they can be used. """ - transition_route_group = proto.Field( + transition_route_group: "TransitionRouteGroup" = proto.Field( proto.MESSAGE, number=1, message="TransitionRouteGroup", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -294,11 +298,11 @@ class DeleteTransitionRouteGroupRequest(proto.Message): transition route group, as well as any reference to it. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) diff --git a/google/cloud/dialogflowcx_v3beta1/types/validation_message.py b/google/cloud/dialogflowcx_v3beta1/types/validation_message.py index 1f579ac6..57846b2e 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/validation_message.py +++ b/google/cloud/dialogflowcx_v3beta1/types/validation_message.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore @@ -32,10 +34,10 @@ class ValidationMessage(proto.Message): resource_type (google.cloud.dialogflowcx_v3beta1.types.ValidationMessage.ResourceType): The type of the resources where the message is found. - resources (Sequence[str]): + resources (MutableSequence[str]): The names of the resources where the message is found. - resource_names (Sequence[google.cloud.dialogflowcx_v3beta1.types.ResourceName]): + resource_names (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.ResourceName]): The resource names of the resources where the message is found. severity (google.cloud.dialogflowcx_v3beta1.types.ValidationMessage.Severity): @@ -68,26 +70,26 @@ class Severity(proto.Enum): WARNING = 2 ERROR = 3 - resource_type = proto.Field( + resource_type: ResourceType = proto.Field( proto.ENUM, number=1, enum=ResourceType, ) - resources = proto.RepeatedField( + resources: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=2, ) - resource_names = proto.RepeatedField( + resource_names: MutableSequence["ResourceName"] = proto.RepeatedField( proto.MESSAGE, number=6, message="ResourceName", ) - severity = proto.Field( + severity: Severity = proto.Field( proto.ENUM, number=3, enum=Severity, ) - detail = proto.Field( + detail: str = proto.Field( proto.STRING, number=4, ) @@ -103,11 +105,11 @@ class ResourceName(proto.Message): Display name. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) diff --git a/google/cloud/dialogflowcx_v3beta1/types/version.py b/google/cloud/dialogflowcx_v3beta1/types/version.py index 415b9b2b..3564a2dd 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/version.py +++ b/google/cloud/dialogflowcx_v3beta1/types/version.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3beta1.types import flow @@ -48,7 +50,7 @@ class CreateVersionOperationMetadata(proto.Message): ``projects//locations//agents//flows//versions/``. """ - version = proto.Field( + version: str = proto.Field( proto.STRING, number=1, ) @@ -89,29 +91,29 @@ class State(proto.Enum): SUCCEEDED = 2 FAILED = 3 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - nlu_settings = proto.Field( + nlu_settings: flow.NluSettings = proto.Field( proto.MESSAGE, number=4, message=flow.NluSettings, ) - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, ) - state = proto.Field( + state: State = proto.Field( proto.ENUM, number=6, enum=State, @@ -136,15 +138,15 @@ class ListVersionsRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -155,7 +157,7 @@ class ListVersionsResponse(proto.Message): [Versions.ListVersions][google.cloud.dialogflow.cx.v3beta1.Versions.ListVersions]. Attributes: - versions (Sequence[google.cloud.dialogflowcx_v3beta1.types.Version]): + versions (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Version]): A list of versions. There will be a maximum number of items returned based on the page_size field in the request. The list may in some cases be empty or contain fewer entries @@ -170,12 +172,12 @@ class ListVersionsResponse(proto.Message): def raw_page(self): return self - versions = proto.RepeatedField( + versions: MutableSequence["Version"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Version", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -193,7 +195,7 @@ class GetVersionRequest(proto.Message): ``projects//locations//agents//flows//versions/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -214,11 +216,11 @@ class CreateVersionRequest(proto.Message): Required. The version to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - version = proto.Field( + version: "Version" = proto.Field( proto.MESSAGE, number=2, message="Version", @@ -238,12 +240,12 @@ class UpdateVersionRequest(proto.Message): updated. """ - version = proto.Field( + version: "Version" = proto.Field( proto.MESSAGE, number=1, message="Version", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -262,7 +264,7 @@ class DeleteVersionRequest(proto.Message): ``projects//locations//agents//flows//versions/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -286,11 +288,11 @@ class LoadVersionRequest(proto.Message): (i.e. intents, entities, webhooks). """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - allow_override_agent_resources = proto.Field( + allow_override_agent_resources: bool = proto.Field( proto.BOOL, number=2, ) @@ -323,15 +325,15 @@ class CompareVersionsRequest(proto.Message): before they can be used. """ - base_version = proto.Field( + base_version: str = proto.Field( proto.STRING, number=1, ) - target_version = proto.Field( + target_version: str = proto.Field( proto.STRING, number=2, ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=3, ) @@ -352,15 +354,15 @@ class CompareVersionsResponse(proto.Message): The timestamp when the two version compares. """ - base_version_content_json = proto.Field( + base_version_content_json: str = proto.Field( proto.STRING, number=1, ) - target_version_content_json = proto.Field( + target_version_content_json: str = proto.Field( proto.STRING, number=2, ) - compare_time = proto.Field( + compare_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, diff --git a/google/cloud/dialogflowcx_v3beta1/types/webhook.py b/google/cloud/dialogflowcx_v3beta1/types/webhook.py index 0331cac7..f2e07c18 100644 --- a/google/cloud/dialogflowcx_v3beta1/types/webhook.py +++ b/google/cloud/dialogflowcx_v3beta1/types/webhook.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.dialogflowcx_v3beta1.types import response_message @@ -95,10 +97,10 @@ class GenericWebService(proto.Message): The user name for HTTP Basic authentication. password (str): The password for HTTP Basic authentication. - request_headers (Mapping[str, str]): + request_headers (MutableMapping[str, str]): The HTTP request headers to send together with webhook requests. - allowed_ca_certs (Sequence[bytes]): + allowed_ca_certs (MutableSequence[bytes]): Optional. Specifies a list of allowed custom CA certificates (in DER format) for HTTPS verification. This overrides the default SSL trust store. If this is empty or unspecified, @@ -115,24 +117,24 @@ class GenericWebService(proto.Message): -extfile <(printf "\nsubjectAltName='DNS:www.example.com'") """ - uri = proto.Field( + uri: str = proto.Field( proto.STRING, number=1, ) - username = proto.Field( + username: str = proto.Field( proto.STRING, number=2, ) - password = proto.Field( + password: str = proto.Field( proto.STRING, number=3, ) - request_headers = proto.MapField( + request_headers: MutableMapping[str, str] = proto.MapField( proto.STRING, proto.STRING, number=4, ) - allowed_ca_certs = proto.RepeatedField( + allowed_ca_certs: MutableSequence[bytes] = proto.RepeatedField( proto.BYTES, number=5, ) @@ -154,42 +156,42 @@ class ServiceDirectoryConfig(proto.Message): webhook. """ - service = proto.Field( + service: str = proto.Field( proto.STRING, number=1, ) - generic_web_service = proto.Field( + generic_web_service: "Webhook.GenericWebService" = proto.Field( proto.MESSAGE, number=2, message="Webhook.GenericWebService", ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - generic_web_service = proto.Field( + generic_web_service: GenericWebService = proto.Field( proto.MESSAGE, number=4, oneof="webhook", message=GenericWebService, ) - service_directory = proto.Field( + service_directory: ServiceDirectoryConfig = proto.Field( proto.MESSAGE, number=7, oneof="webhook", message=ServiceDirectoryConfig, ) - timeout = proto.Field( + timeout: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=6, message=duration_pb2.Duration, ) - disabled = proto.Field( + disabled: bool = proto.Field( proto.BOOL, number=5, ) @@ -211,15 +213,15 @@ class ListWebhooksRequest(proto.Message): request. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -230,7 +232,7 @@ class ListWebhooksResponse(proto.Message): [Webhooks.ListWebhooks][google.cloud.dialogflow.cx.v3beta1.Webhooks.ListWebhooks]. Attributes: - webhooks (Sequence[google.cloud.dialogflowcx_v3beta1.types.Webhook]): + webhooks (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.Webhook]): The list of webhooks. There will be a maximum number of items returned based on the page_size field in the request. next_page_token (str): @@ -243,12 +245,12 @@ class ListWebhooksResponse(proto.Message): def raw_page(self): return self - webhooks = proto.RepeatedField( + webhooks: MutableSequence["Webhook"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Webhook", ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -264,7 +266,7 @@ class GetWebhookRequest(proto.Message): ``projects//locations//agents//webhooks/``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -282,11 +284,11 @@ class CreateWebhookRequest(proto.Message): Required. The webhook to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - webhook = proto.Field( + webhook: "Webhook" = proto.Field( proto.MESSAGE, number=2, message="Webhook", @@ -306,12 +308,12 @@ class UpdateWebhookRequest(proto.Message): updated. """ - webhook = proto.Field( + webhook: "Webhook" = proto.Field( proto.MESSAGE, number=1, message="Webhook", ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -341,11 +343,11 @@ class DeleteWebhookRequest(proto.Message): fulfillments that point to this webhook will be removed). """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - force = proto.Field( + force: bool = proto.Field( proto.BOOL, number=2, ) @@ -410,7 +412,7 @@ class WebhookRequest(proto.Message): Information about page status. session_info (google.cloud.dialogflowcx_v3beta1.types.SessionInfo): Information about session status. - messages (Sequence[google.cloud.dialogflowcx_v3beta1.types.ResponseMessage]): + messages (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.ResponseMessage]): The list of rich message responses to present to the user. Webhook can choose to append or replace this list in [WebhookResponse.fulfillment_response][google.cloud.dialogflow.cx.v3beta1.WebhookResponse.fulfillment_response]; @@ -438,7 +440,7 @@ class FulfillmentInfo(proto.Message): called, but it could be used for other purposes. """ - tag = proto.Field( + tag: str = proto.Field( proto.STRING, number=1, ) @@ -454,7 +456,7 @@ class IntentInfo(proto.Message): display_name (str): Always present. The display name of the last matched [intent][google.cloud.dialogflow.cx.v3beta1.Intent]. - parameters (Mapping[str, google.cloud.dialogflowcx_v3beta1.types.WebhookRequest.IntentInfo.IntentParameterValue]): + parameters (MutableMapping[str, google.cloud.dialogflowcx_v3beta1.types.WebhookRequest.IntentInfo.IntentParameterValue]): Parameters identified as a result of intent matching. This is a map of the name of the identified parameter to the value of the @@ -479,31 +481,33 @@ class IntentParameterValue(proto.Message): parameter extracted from user utterance. """ - original_value = proto.Field( + original_value: str = proto.Field( proto.STRING, number=1, ) - resolved_value = proto.Field( + resolved_value: struct_pb2.Value = proto.Field( proto.MESSAGE, number=2, message=struct_pb2.Value, ) - last_matched_intent = proto.Field( + last_matched_intent: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=3, ) - parameters = proto.MapField( + parameters: MutableMapping[ + str, "WebhookRequest.IntentInfo.IntentParameterValue" + ] = proto.MapField( proto.STRING, proto.MESSAGE, number=2, message="WebhookRequest.IntentInfo.IntentParameterValue", ) - confidence = proto.Field( + confidence: float = proto.Field( proto.FLOAT, number=4, ) @@ -521,74 +525,74 @@ class SentimentAnalysisResult(proto.Message): of score (positive or negative). """ - score = proto.Field( + score: float = proto.Field( proto.FLOAT, number=1, ) - magnitude = proto.Field( + magnitude: float = proto.Field( proto.FLOAT, number=2, ) - detect_intent_response_id = proto.Field( + detect_intent_response_id: str = proto.Field( proto.STRING, number=1, ) - text = proto.Field( + text: str = proto.Field( proto.STRING, number=10, oneof="query", ) - trigger_intent = proto.Field( + trigger_intent: str = proto.Field( proto.STRING, number=11, oneof="query", ) - transcript = proto.Field( + transcript: str = proto.Field( proto.STRING, number=12, oneof="query", ) - trigger_event = proto.Field( + trigger_event: str = proto.Field( proto.STRING, number=14, oneof="query", ) - language_code = proto.Field( + language_code: str = proto.Field( proto.STRING, number=15, ) - fulfillment_info = proto.Field( + fulfillment_info: FulfillmentInfo = proto.Field( proto.MESSAGE, number=6, message=FulfillmentInfo, ) - intent_info = proto.Field( + intent_info: IntentInfo = proto.Field( proto.MESSAGE, number=3, message=IntentInfo, ) - page_info = proto.Field( + page_info: "PageInfo" = proto.Field( proto.MESSAGE, number=4, message="PageInfo", ) - session_info = proto.Field( + session_info: "SessionInfo" = proto.Field( proto.MESSAGE, number=5, message="SessionInfo", ) - messages = proto.RepeatedField( + messages: MutableSequence[response_message.ResponseMessage] = proto.RepeatedField( proto.MESSAGE, number=7, message=response_message.ResponseMessage, ) - payload = proto.Field( + payload: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=8, message=struct_pb2.Struct, ) - sentiment_analysis_result = proto.Field( + sentiment_analysis_result: SentimentAnalysisResult = proto.Field( proto.MESSAGE, number=9, message=SentimentAnalysisResult, @@ -638,7 +642,7 @@ class FulfillmentResponse(proto.Message): r"""Represents a fulfillment response to the user. Attributes: - messages (Sequence[google.cloud.dialogflowcx_v3beta1.types.ResponseMessage]): + messages (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.ResponseMessage]): The list of rich message responses to present to the user. merge_behavior (google.cloud.dialogflowcx_v3beta1.types.WebhookResponse.FulfillmentResponse.MergeBehavior): @@ -651,43 +655,47 @@ class MergeBehavior(proto.Enum): APPEND = 1 REPLACE = 2 - messages = proto.RepeatedField( + messages: MutableSequence[ + response_message.ResponseMessage + ] = proto.RepeatedField( proto.MESSAGE, number=1, message=response_message.ResponseMessage, ) - merge_behavior = proto.Field( - proto.ENUM, - number=2, - enum="WebhookResponse.FulfillmentResponse.MergeBehavior", + merge_behavior: "WebhookResponse.FulfillmentResponse.MergeBehavior" = ( + proto.Field( + proto.ENUM, + number=2, + enum="WebhookResponse.FulfillmentResponse.MergeBehavior", + ) ) - fulfillment_response = proto.Field( + fulfillment_response: FulfillmentResponse = proto.Field( proto.MESSAGE, number=1, message=FulfillmentResponse, ) - page_info = proto.Field( + page_info: "PageInfo" = proto.Field( proto.MESSAGE, number=2, message="PageInfo", ) - session_info = proto.Field( + session_info: "SessionInfo" = proto.Field( proto.MESSAGE, number=3, message="SessionInfo", ) - payload = proto.Field( + payload: struct_pb2.Struct = proto.Field( proto.MESSAGE, number=4, message=struct_pb2.Struct, ) - target_page = proto.Field( + target_page: str = proto.Field( proto.STRING, number=5, oneof="transition", ) - target_flow = proto.Field( + target_flow: str = proto.Field( proto.STRING, number=6, oneof="transition", @@ -724,7 +732,7 @@ class FormInfo(proto.Message): r"""Represents form information. Attributes: - parameter_info (Sequence[google.cloud.dialogflowcx_v3beta1.types.PageInfo.FormInfo.ParameterInfo]): + parameter_info (MutableSequence[google.cloud.dialogflowcx_v3beta1.types.PageInfo.FormInfo.ParameterInfo]): Optional for both [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest] and @@ -785,44 +793,46 @@ class ParameterState(proto.Enum): INVALID = 2 FILLED = 3 - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=1, ) - required = proto.Field( + required: bool = proto.Field( proto.BOOL, number=2, ) - state = proto.Field( + state: "PageInfo.FormInfo.ParameterInfo.ParameterState" = proto.Field( proto.ENUM, number=3, enum="PageInfo.FormInfo.ParameterInfo.ParameterState", ) - value = proto.Field( + value: struct_pb2.Value = proto.Field( proto.MESSAGE, number=4, message=struct_pb2.Value, ) - just_collected = proto.Field( + just_collected: bool = proto.Field( proto.BOOL, number=5, ) - parameter_info = proto.RepeatedField( + parameter_info: MutableSequence[ + "PageInfo.FormInfo.ParameterInfo" + ] = proto.RepeatedField( proto.MESSAGE, number=2, message="PageInfo.FormInfo.ParameterInfo", ) - current_page = proto.Field( + current_page: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=4, ) - form_info = proto.Field( + form_info: FormInfo = proto.Field( proto.MESSAGE, number=3, message=FormInfo, @@ -847,7 +857,7 @@ class SessionInfo(proto.Message): or ``projects//locations//agents//environments//sessions/`` if environment is specified. - parameters (Mapping[str, google.protobuf.struct_pb2.Value]): + parameters (MutableMapping[str, google.protobuf.struct_pb2.Value]): Optional for [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]. Optional for @@ -860,11 +870,11 @@ class SessionInfo(proto.Message): The map is keyed by parameters' display names. """ - session = proto.Field( + session: str = proto.Field( proto.STRING, number=1, ) - parameters = proto.MapField( + parameters: MutableMapping[str, struct_pb2.Value] = proto.MapField( proto.STRING, proto.MESSAGE, number=2, diff --git a/noxfile.py b/noxfile.py index 9692b40b..3d1da786 100644 --- a/noxfile.py +++ b/noxfile.py @@ -267,17 +267,21 @@ def cover(session): test runs (not system test runs), and then erases coverage data. """ session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=99") + session.run("coverage", "report", "--show-missing", "--fail-under=100") session.run("coverage", "erase") -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python="3.9") def docs(session): """Build the docs for this library.""" session.install("-e", ".") - session.install("sphinx==4.0.1", "alabaster", "recommonmark") + session.install( + "sphinx==4.0.1", + "alabaster", + "recommonmark", + ) shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( @@ -293,13 +297,16 @@ def docs(session): ) -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python="3.9") def docfx(session): """Build the docfx yaml files for this library.""" session.install("-e", ".") session.install( - "sphinx==4.0.1", "alabaster", "recommonmark", "gcp-sphinx-docfx-yaml" + "sphinx==4.0.1", + "alabaster", + "recommonmark", + "gcp-sphinx-docfx-yaml", ) shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) diff --git a/owlbot.py b/owlbot.py index 70baf06d..ab8a548a 100644 --- a/owlbot.py +++ b/owlbot.py @@ -12,6 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +import json +from pathlib import Path +import shutil + import synthtool as s import synthtool.gcp as gcp from synthtool.languages import python @@ -20,11 +24,19 @@ # Copy the generated client from the owl-bot staging directory # ---------------------------------------------------------------------------- -default_version = "v3" +clean_up_generated_samples = True + +# Load the default version defined in .repo-metadata.json. +default_version = json.load(open(".repo-metadata.json", "rt")).get( + "default_version" +) for library in s.get_staging_dirs(default_version): - s.move(library, excludes=["setup.py", "README.rst"]) + if clean_up_generated_samples: + shutil.rmtree("samples/generated_samples", ignore_errors=True) + clean_up_generated_samples = False + s.move([library], excludes=["**/gapic_version.py"]) s.remove_staging_dirs() # ---------------------------------------------------------------------------- @@ -32,11 +44,13 @@ # ---------------------------------------------------------------------------- templated_files = gcp.CommonTemplates().py_library( - cov_level=99, + cov_level=100, microgenerator=True, versions=gcp.common.detect_versions(path="./google", default_first=True), ) -s.move(templated_files, excludes=[".coveragerc"]) # the microgenerator has a good coveragerc file +s.move(templated_files, excludes=[".coveragerc", ".github/release-please.yml"]) + +python.py_samples(skip_readmes=True) # ignore docs warnings (only fail on errors) s.replace( @@ -45,12 +59,7 @@ '' ) -python.py_samples(skip_readmes=True) - -python.configure_previous_major_version_branches() - -# ---------------------------------------------------------------------------- -# Run blacken session -# ---------------------------------------------------------------------------- +# run format session for all directories which have a noxfile +for noxfile in Path(".").glob("**/noxfile.py"): + s.shell.run(["nox", "-s", "blacken"], cwd=noxfile.parent, hide_output=False) -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..185e0a9d --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,30 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "packages": { + ".": { + "release-type": "python", + "extra-files": [ + "google/cloud/dialogflowcx_v3/gapic_version.py", + "google/cloud/dialogflowcx/gapic_version.py", + "google/cloud/dialogflowcx_v3beta1/gapic_version.py", + { + "type": "json", + "path": "samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json", + "jsonpath": "$.clientLibrary.version" + }, + { + "type": "json", + "path": "samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json", + "jsonpath": "$.clientLibrary.version" + } + ] + } + }, + "release-type": "python", + "plugins": [ + { + "type": "sentence-case" + } + ], + "initial-version": "0.1.0" +} diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_create_agent_async.py b/samples/generated_samples/dialogflow_v3_generated_agents_create_agent_async.py index 750a8a81..6402f8c8 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_create_agent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_create_agent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_CreateAgent_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_create_agent_sync.py b/samples/generated_samples/dialogflow_v3_generated_agents_create_agent_sync.py index 043fc63f..d1e6cdf5 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_create_agent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_create_agent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_CreateAgent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_delete_agent_async.py b/samples/generated_samples/dialogflow_v3_generated_agents_delete_agent_async.py index 03b7d8e9..ee77aa77 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_delete_agent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_delete_agent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_DeleteAgent_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_delete_agent_sync.py b/samples/generated_samples/dialogflow_v3_generated_agents_delete_agent_sync.py index b6c02cba..45c043ef 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_delete_agent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_delete_agent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_DeleteAgent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_export_agent_async.py b/samples/generated_samples/dialogflow_v3_generated_agents_export_agent_async.py index 903b7512..79ab9c2e 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_export_agent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_export_agent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_ExportAgent_async] @@ -48,7 +48,7 @@ async def sample_export_agent(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_export_agent_sync.py b/samples/generated_samples/dialogflow_v3_generated_agents_export_agent_sync.py index bb4998ad..b0042359 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_export_agent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_export_agent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_ExportAgent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_async.py b/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_async.py index 82d2a8d3..2fdaae4e 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_GetAgent_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_sync.py b/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_sync.py index fc45230f..a78928d3 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_GetAgent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_validation_result_async.py b/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_validation_result_async.py index bc1fca14..1803f48c 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_validation_result_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_validation_result_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_GetAgentValidationResult_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_validation_result_sync.py b/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_validation_result_sync.py index fd2e7400..15f640d6 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_validation_result_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_get_agent_validation_result_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_GetAgentValidationResult_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_list_agents_async.py b/samples/generated_samples/dialogflow_v3_generated_agents_list_agents_async.py index d6f01b62..6d00b2b0 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_list_agents_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_list_agents_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_ListAgents_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_list_agents_sync.py b/samples/generated_samples/dialogflow_v3_generated_agents_list_agents_sync.py index c9cf3ae0..b69db7b5 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_list_agents_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_list_agents_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_ListAgents_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_restore_agent_async.py b/samples/generated_samples/dialogflow_v3_generated_agents_restore_agent_async.py index 17a377bf..bc316416 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_restore_agent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_restore_agent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_RestoreAgent_async] @@ -49,7 +49,7 @@ async def sample_restore_agent(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_restore_agent_sync.py b/samples/generated_samples/dialogflow_v3_generated_agents_restore_agent_sync.py index fd1bca36..cee2e9d0 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_restore_agent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_restore_agent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_RestoreAgent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_update_agent_async.py b/samples/generated_samples/dialogflow_v3_generated_agents_update_agent_async.py index 5c7f240e..719e8622 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_update_agent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_update_agent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_UpdateAgent_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_update_agent_sync.py b/samples/generated_samples/dialogflow_v3_generated_agents_update_agent_sync.py index 5364a3e8..8db321f3 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_update_agent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_update_agent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_UpdateAgent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_validate_agent_async.py b/samples/generated_samples/dialogflow_v3_generated_agents_validate_agent_async.py index 0c56fd2a..aa7df37c 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_validate_agent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_validate_agent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_ValidateAgent_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_agents_validate_agent_sync.py b/samples/generated_samples/dialogflow_v3_generated_agents_validate_agent_sync.py index c7d7a42f..7310bb6d 100644 --- a/samples/generated_samples/dialogflow_v3_generated_agents_validate_agent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_agents_validate_agent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Agents_ValidateAgent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_changelogs_get_changelog_async.py b/samples/generated_samples/dialogflow_v3_generated_changelogs_get_changelog_async.py index e948c9b5..ba9f2548 100644 --- a/samples/generated_samples/dialogflow_v3_generated_changelogs_get_changelog_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_changelogs_get_changelog_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Changelogs_GetChangelog_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_changelogs_get_changelog_sync.py b/samples/generated_samples/dialogflow_v3_generated_changelogs_get_changelog_sync.py index 1ab88658..249c9d81 100644 --- a/samples/generated_samples/dialogflow_v3_generated_changelogs_get_changelog_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_changelogs_get_changelog_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Changelogs_GetChangelog_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_changelogs_list_changelogs_async.py b/samples/generated_samples/dialogflow_v3_generated_changelogs_list_changelogs_async.py index 30e482fb..04b4ccd7 100644 --- a/samples/generated_samples/dialogflow_v3_generated_changelogs_list_changelogs_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_changelogs_list_changelogs_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Changelogs_ListChangelogs_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_changelogs_list_changelogs_sync.py b/samples/generated_samples/dialogflow_v3_generated_changelogs_list_changelogs_sync.py index 08a13f48..fd26febd 100644 --- a/samples/generated_samples/dialogflow_v3_generated_changelogs_list_changelogs_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_changelogs_list_changelogs_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Changelogs_ListChangelogs_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_deployments_get_deployment_async.py b/samples/generated_samples/dialogflow_v3_generated_deployments_get_deployment_async.py index df960974..d8c5e536 100644 --- a/samples/generated_samples/dialogflow_v3_generated_deployments_get_deployment_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_deployments_get_deployment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Deployments_GetDeployment_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_deployments_get_deployment_sync.py b/samples/generated_samples/dialogflow_v3_generated_deployments_get_deployment_sync.py index 3eb6025d..b2355967 100644 --- a/samples/generated_samples/dialogflow_v3_generated_deployments_get_deployment_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_deployments_get_deployment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Deployments_GetDeployment_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_deployments_list_deployments_async.py b/samples/generated_samples/dialogflow_v3_generated_deployments_list_deployments_async.py index 56f823a6..b349c41e 100644 --- a/samples/generated_samples/dialogflow_v3_generated_deployments_list_deployments_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_deployments_list_deployments_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Deployments_ListDeployments_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_deployments_list_deployments_sync.py b/samples/generated_samples/dialogflow_v3_generated_deployments_list_deployments_sync.py index 87b78ee6..4312e3e3 100644 --- a/samples/generated_samples/dialogflow_v3_generated_deployments_list_deployments_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_deployments_list_deployments_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Deployments_ListDeployments_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_entity_types_create_entity_type_async.py b/samples/generated_samples/dialogflow_v3_generated_entity_types_create_entity_type_async.py index 216b50c8..f9873883 100644 --- a/samples/generated_samples/dialogflow_v3_generated_entity_types_create_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_entity_types_create_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_EntityTypes_CreateEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_entity_types_create_entity_type_sync.py b/samples/generated_samples/dialogflow_v3_generated_entity_types_create_entity_type_sync.py index d156eb20..6e9dcde3 100644 --- a/samples/generated_samples/dialogflow_v3_generated_entity_types_create_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_entity_types_create_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_EntityTypes_CreateEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_entity_types_delete_entity_type_async.py b/samples/generated_samples/dialogflow_v3_generated_entity_types_delete_entity_type_async.py index 1cf4d45d..d79ff833 100644 --- a/samples/generated_samples/dialogflow_v3_generated_entity_types_delete_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_entity_types_delete_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_EntityTypes_DeleteEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_entity_types_delete_entity_type_sync.py b/samples/generated_samples/dialogflow_v3_generated_entity_types_delete_entity_type_sync.py index c529a4c1..febb0e62 100644 --- a/samples/generated_samples/dialogflow_v3_generated_entity_types_delete_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_entity_types_delete_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_EntityTypes_DeleteEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_entity_types_get_entity_type_async.py b/samples/generated_samples/dialogflow_v3_generated_entity_types_get_entity_type_async.py index 51bc53cb..d8818f9e 100644 --- a/samples/generated_samples/dialogflow_v3_generated_entity_types_get_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_entity_types_get_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_EntityTypes_GetEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_entity_types_get_entity_type_sync.py b/samples/generated_samples/dialogflow_v3_generated_entity_types_get_entity_type_sync.py index 6a926f01..a5279664 100644 --- a/samples/generated_samples/dialogflow_v3_generated_entity_types_get_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_entity_types_get_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_EntityTypes_GetEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_entity_types_list_entity_types_async.py b/samples/generated_samples/dialogflow_v3_generated_entity_types_list_entity_types_async.py index a8cc6710..53b4b91f 100644 --- a/samples/generated_samples/dialogflow_v3_generated_entity_types_list_entity_types_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_entity_types_list_entity_types_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_EntityTypes_ListEntityTypes_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_entity_types_list_entity_types_sync.py b/samples/generated_samples/dialogflow_v3_generated_entity_types_list_entity_types_sync.py index 9ae5851b..32d9b130 100644 --- a/samples/generated_samples/dialogflow_v3_generated_entity_types_list_entity_types_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_entity_types_list_entity_types_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_EntityTypes_ListEntityTypes_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_entity_types_update_entity_type_async.py b/samples/generated_samples/dialogflow_v3_generated_entity_types_update_entity_type_async.py index 729381c0..a2464cd5 100644 --- a/samples/generated_samples/dialogflow_v3_generated_entity_types_update_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_entity_types_update_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_EntityTypes_UpdateEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_entity_types_update_entity_type_sync.py b/samples/generated_samples/dialogflow_v3_generated_entity_types_update_entity_type_sync.py index 96416217..f6228f5e 100644 --- a/samples/generated_samples/dialogflow_v3_generated_entity_types_update_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_entity_types_update_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_EntityTypes_UpdateEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_create_environment_async.py b/samples/generated_samples/dialogflow_v3_generated_environments_create_environment_async.py index 36041eb0..74fb0652 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_create_environment_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_create_environment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_CreateEnvironment_async] @@ -53,7 +53,7 @@ async def sample_create_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_create_environment_sync.py b/samples/generated_samples/dialogflow_v3_generated_environments_create_environment_sync.py index 32801920..1fdd6ab1 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_create_environment_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_create_environment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_CreateEnvironment_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_delete_environment_async.py b/samples/generated_samples/dialogflow_v3_generated_environments_delete_environment_async.py index 91208275..37eb3009 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_delete_environment_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_delete_environment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_DeleteEnvironment_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_delete_environment_sync.py b/samples/generated_samples/dialogflow_v3_generated_environments_delete_environment_sync.py index 3bb16591..dde1f831 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_delete_environment_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_delete_environment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_DeleteEnvironment_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_deploy_flow_async.py b/samples/generated_samples/dialogflow_v3_generated_environments_deploy_flow_async.py index 9253a466..63800bbd 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_deploy_flow_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_deploy_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_DeployFlow_async] @@ -49,7 +49,7 @@ async def sample_deploy_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_deploy_flow_sync.py b/samples/generated_samples/dialogflow_v3_generated_environments_deploy_flow_sync.py index e852734f..26918fdc 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_deploy_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_deploy_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_DeployFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_get_environment_async.py b/samples/generated_samples/dialogflow_v3_generated_environments_get_environment_async.py index 590a8a4c..bf91bf44 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_get_environment_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_get_environment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_GetEnvironment_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_get_environment_sync.py b/samples/generated_samples/dialogflow_v3_generated_environments_get_environment_sync.py index 87a624dc..d853f470 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_get_environment_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_get_environment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_GetEnvironment_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_list_continuous_test_results_async.py b/samples/generated_samples/dialogflow_v3_generated_environments_list_continuous_test_results_async.py index c2d3930c..9fb8d6e8 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_list_continuous_test_results_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_list_continuous_test_results_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_ListContinuousTestResults_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_list_continuous_test_results_sync.py b/samples/generated_samples/dialogflow_v3_generated_environments_list_continuous_test_results_sync.py index 5184c7d6..f7e3611a 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_list_continuous_test_results_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_list_continuous_test_results_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_ListContinuousTestResults_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_list_environments_async.py b/samples/generated_samples/dialogflow_v3_generated_environments_list_environments_async.py index 606bab7b..31713ee2 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_list_environments_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_list_environments_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_ListEnvironments_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_list_environments_sync.py b/samples/generated_samples/dialogflow_v3_generated_environments_list_environments_sync.py index 5dd129b0..ab9318b1 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_list_environments_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_list_environments_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_ListEnvironments_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_lookup_environment_history_async.py b/samples/generated_samples/dialogflow_v3_generated_environments_lookup_environment_history_async.py index d447082b..ef92d801 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_lookup_environment_history_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_lookup_environment_history_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_LookupEnvironmentHistory_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_lookup_environment_history_sync.py b/samples/generated_samples/dialogflow_v3_generated_environments_lookup_environment_history_sync.py index e23b1bb9..19d3ec37 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_lookup_environment_history_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_lookup_environment_history_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_LookupEnvironmentHistory_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_run_continuous_test_async.py b/samples/generated_samples/dialogflow_v3_generated_environments_run_continuous_test_async.py index 526463cd..1ff30777 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_run_continuous_test_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_run_continuous_test_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_RunContinuousTest_async] @@ -48,7 +48,7 @@ async def sample_run_continuous_test(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_run_continuous_test_sync.py b/samples/generated_samples/dialogflow_v3_generated_environments_run_continuous_test_sync.py index eeef26e9..3fd43cdf 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_run_continuous_test_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_run_continuous_test_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_RunContinuousTest_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_update_environment_async.py b/samples/generated_samples/dialogflow_v3_generated_environments_update_environment_async.py index 219b985d..9f321f7e 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_update_environment_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_update_environment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_UpdateEnvironment_async] @@ -52,7 +52,7 @@ async def sample_update_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_environments_update_environment_sync.py b/samples/generated_samples/dialogflow_v3_generated_environments_update_environment_sync.py index cb1bc324..5ae00fb1 100644 --- a/samples/generated_samples/dialogflow_v3_generated_environments_update_environment_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_environments_update_environment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Environments_UpdateEnvironment_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_experiments_create_experiment_async.py b/samples/generated_samples/dialogflow_v3_generated_experiments_create_experiment_async.py index 35941ac7..a4caefbb 100644 --- a/samples/generated_samples/dialogflow_v3_generated_experiments_create_experiment_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_experiments_create_experiment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Experiments_CreateExperiment_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_experiments_create_experiment_sync.py b/samples/generated_samples/dialogflow_v3_generated_experiments_create_experiment_sync.py index a1c162cb..4c28a10f 100644 --- a/samples/generated_samples/dialogflow_v3_generated_experiments_create_experiment_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_experiments_create_experiment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Experiments_CreateExperiment_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_experiments_delete_experiment_async.py b/samples/generated_samples/dialogflow_v3_generated_experiments_delete_experiment_async.py index cfdb7a9b..f4f9970b 100644 --- a/samples/generated_samples/dialogflow_v3_generated_experiments_delete_experiment_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_experiments_delete_experiment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Experiments_DeleteExperiment_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_experiments_delete_experiment_sync.py b/samples/generated_samples/dialogflow_v3_generated_experiments_delete_experiment_sync.py index d5ab25a4..9da4ba6a 100644 --- a/samples/generated_samples/dialogflow_v3_generated_experiments_delete_experiment_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_experiments_delete_experiment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Experiments_DeleteExperiment_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_experiments_get_experiment_async.py b/samples/generated_samples/dialogflow_v3_generated_experiments_get_experiment_async.py index 5d97cebf..08eccd28 100644 --- a/samples/generated_samples/dialogflow_v3_generated_experiments_get_experiment_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_experiments_get_experiment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Experiments_GetExperiment_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_experiments_get_experiment_sync.py b/samples/generated_samples/dialogflow_v3_generated_experiments_get_experiment_sync.py index 50792ea0..85e36905 100644 --- a/samples/generated_samples/dialogflow_v3_generated_experiments_get_experiment_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_experiments_get_experiment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Experiments_GetExperiment_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_experiments_list_experiments_async.py b/samples/generated_samples/dialogflow_v3_generated_experiments_list_experiments_async.py index ec11f38f..eaa3f332 100644 --- a/samples/generated_samples/dialogflow_v3_generated_experiments_list_experiments_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_experiments_list_experiments_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Experiments_ListExperiments_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_experiments_list_experiments_sync.py b/samples/generated_samples/dialogflow_v3_generated_experiments_list_experiments_sync.py index 70a6c63f..c5e52555 100644 --- a/samples/generated_samples/dialogflow_v3_generated_experiments_list_experiments_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_experiments_list_experiments_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Experiments_ListExperiments_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_experiments_start_experiment_async.py b/samples/generated_samples/dialogflow_v3_generated_experiments_start_experiment_async.py index 5fac06ff..1f6d2035 100644 --- a/samples/generated_samples/dialogflow_v3_generated_experiments_start_experiment_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_experiments_start_experiment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Experiments_StartExperiment_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_experiments_start_experiment_sync.py b/samples/generated_samples/dialogflow_v3_generated_experiments_start_experiment_sync.py index 3acc14d0..4781d8f1 100644 --- a/samples/generated_samples/dialogflow_v3_generated_experiments_start_experiment_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_experiments_start_experiment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Experiments_StartExperiment_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_experiments_stop_experiment_async.py b/samples/generated_samples/dialogflow_v3_generated_experiments_stop_experiment_async.py index d7d93f12..82276191 100644 --- a/samples/generated_samples/dialogflow_v3_generated_experiments_stop_experiment_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_experiments_stop_experiment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Experiments_StopExperiment_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_experiments_stop_experiment_sync.py b/samples/generated_samples/dialogflow_v3_generated_experiments_stop_experiment_sync.py index 3b813593..de155bfd 100644 --- a/samples/generated_samples/dialogflow_v3_generated_experiments_stop_experiment_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_experiments_stop_experiment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Experiments_StopExperiment_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_experiments_update_experiment_async.py b/samples/generated_samples/dialogflow_v3_generated_experiments_update_experiment_async.py index c33d92ff..a4282b9c 100644 --- a/samples/generated_samples/dialogflow_v3_generated_experiments_update_experiment_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_experiments_update_experiment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Experiments_UpdateExperiment_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_experiments_update_experiment_sync.py b/samples/generated_samples/dialogflow_v3_generated_experiments_update_experiment_sync.py index 5d495a3f..7956d5ed 100644 --- a/samples/generated_samples/dialogflow_v3_generated_experiments_update_experiment_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_experiments_update_experiment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Experiments_UpdateExperiment_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_create_flow_async.py b/samples/generated_samples/dialogflow_v3_generated_flows_create_flow_async.py index 2d8cae25..04c6f74d 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_create_flow_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_create_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_CreateFlow_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_create_flow_sync.py b/samples/generated_samples/dialogflow_v3_generated_flows_create_flow_sync.py index b8ca1b02..e9c7cc08 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_create_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_create_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_CreateFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_delete_flow_async.py b/samples/generated_samples/dialogflow_v3_generated_flows_delete_flow_async.py index 50cb3f25..682ae4e4 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_delete_flow_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_delete_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_DeleteFlow_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_delete_flow_sync.py b/samples/generated_samples/dialogflow_v3_generated_flows_delete_flow_sync.py index 10c4447b..3d12f96b 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_delete_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_delete_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_DeleteFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_export_flow_async.py b/samples/generated_samples/dialogflow_v3_generated_flows_export_flow_async.py index a19ba1c6..4c20c13f 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_export_flow_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_export_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_ExportFlow_async] @@ -48,7 +48,7 @@ async def sample_export_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_export_flow_sync.py b/samples/generated_samples/dialogflow_v3_generated_flows_export_flow_sync.py index 0443f9db..3012d9c8 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_export_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_export_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_ExportFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_async.py b/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_async.py index a9791dea..b812638e 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_GetFlow_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_sync.py b/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_sync.py index 2a360119..7dc1102d 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_GetFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_validation_result_async.py b/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_validation_result_async.py index abb31fbb..8b997862 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_validation_result_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_validation_result_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_GetFlowValidationResult_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_validation_result_sync.py b/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_validation_result_sync.py index d0c7fec2..24c0b4ac 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_validation_result_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_get_flow_validation_result_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_GetFlowValidationResult_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_import_flow_async.py b/samples/generated_samples/dialogflow_v3_generated_flows_import_flow_async.py index 4a5fc4ad..3805dfc6 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_import_flow_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_import_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_ImportFlow_async] @@ -49,7 +49,7 @@ async def sample_import_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_import_flow_sync.py b/samples/generated_samples/dialogflow_v3_generated_flows_import_flow_sync.py index 186d45f6..ac972b74 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_import_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_import_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_ImportFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_list_flows_async.py b/samples/generated_samples/dialogflow_v3_generated_flows_list_flows_async.py index 28417703..75f49bce 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_list_flows_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_list_flows_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_ListFlows_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_list_flows_sync.py b/samples/generated_samples/dialogflow_v3_generated_flows_list_flows_sync.py index 26e73dd1..18d3a2a9 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_list_flows_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_list_flows_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_ListFlows_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_train_flow_async.py b/samples/generated_samples/dialogflow_v3_generated_flows_train_flow_async.py index f51f6c7a..aab3fed9 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_train_flow_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_train_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_TrainFlow_async] @@ -48,7 +48,7 @@ async def sample_train_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_train_flow_sync.py b/samples/generated_samples/dialogflow_v3_generated_flows_train_flow_sync.py index c17cf9bf..c9213306 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_train_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_train_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_TrainFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_update_flow_async.py b/samples/generated_samples/dialogflow_v3_generated_flows_update_flow_async.py index e8cb41e2..f1fabf42 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_update_flow_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_update_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_UpdateFlow_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_update_flow_sync.py b/samples/generated_samples/dialogflow_v3_generated_flows_update_flow_sync.py index fa28e694..cab4140b 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_update_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_update_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_UpdateFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_validate_flow_async.py b/samples/generated_samples/dialogflow_v3_generated_flows_validate_flow_async.py index 8de3f04e..7e2101c9 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_validate_flow_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_validate_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_ValidateFlow_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_flows_validate_flow_sync.py b/samples/generated_samples/dialogflow_v3_generated_flows_validate_flow_sync.py index 09835241..6354fa70 100644 --- a/samples/generated_samples/dialogflow_v3_generated_flows_validate_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_flows_validate_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Flows_ValidateFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_intents_create_intent_async.py b/samples/generated_samples/dialogflow_v3_generated_intents_create_intent_async.py index f4a15756..f8c9b851 100644 --- a/samples/generated_samples/dialogflow_v3_generated_intents_create_intent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_intents_create_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Intents_CreateIntent_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_intents_create_intent_sync.py b/samples/generated_samples/dialogflow_v3_generated_intents_create_intent_sync.py index 914e5945..54d933fd 100644 --- a/samples/generated_samples/dialogflow_v3_generated_intents_create_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_intents_create_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Intents_CreateIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_intents_delete_intent_async.py b/samples/generated_samples/dialogflow_v3_generated_intents_delete_intent_async.py index e50bb95d..bd098719 100644 --- a/samples/generated_samples/dialogflow_v3_generated_intents_delete_intent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_intents_delete_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Intents_DeleteIntent_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_intents_delete_intent_sync.py b/samples/generated_samples/dialogflow_v3_generated_intents_delete_intent_sync.py index 12686d0d..a6253a68 100644 --- a/samples/generated_samples/dialogflow_v3_generated_intents_delete_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_intents_delete_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Intents_DeleteIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_intents_get_intent_async.py b/samples/generated_samples/dialogflow_v3_generated_intents_get_intent_async.py index 5e2916b6..1afce83e 100644 --- a/samples/generated_samples/dialogflow_v3_generated_intents_get_intent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_intents_get_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Intents_GetIntent_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_intents_get_intent_sync.py b/samples/generated_samples/dialogflow_v3_generated_intents_get_intent_sync.py index c6db45e3..0b654050 100644 --- a/samples/generated_samples/dialogflow_v3_generated_intents_get_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_intents_get_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Intents_GetIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_intents_list_intents_async.py b/samples/generated_samples/dialogflow_v3_generated_intents_list_intents_async.py index c9ce7f4b..c8f628b9 100644 --- a/samples/generated_samples/dialogflow_v3_generated_intents_list_intents_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_intents_list_intents_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Intents_ListIntents_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_intents_list_intents_sync.py b/samples/generated_samples/dialogflow_v3_generated_intents_list_intents_sync.py index 1721447d..4185f702 100644 --- a/samples/generated_samples/dialogflow_v3_generated_intents_list_intents_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_intents_list_intents_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Intents_ListIntents_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_intents_update_intent_async.py b/samples/generated_samples/dialogflow_v3_generated_intents_update_intent_async.py index 93577538..b3d82903 100644 --- a/samples/generated_samples/dialogflow_v3_generated_intents_update_intent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_intents_update_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Intents_UpdateIntent_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_intents_update_intent_sync.py b/samples/generated_samples/dialogflow_v3_generated_intents_update_intent_sync.py index 98e4a138..2ff358ec 100644 --- a/samples/generated_samples/dialogflow_v3_generated_intents_update_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_intents_update_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Intents_UpdateIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_pages_create_page_async.py b/samples/generated_samples/dialogflow_v3_generated_pages_create_page_async.py index 18f4c9f8..473dbed7 100644 --- a/samples/generated_samples/dialogflow_v3_generated_pages_create_page_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_pages_create_page_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Pages_CreatePage_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_pages_create_page_sync.py b/samples/generated_samples/dialogflow_v3_generated_pages_create_page_sync.py index 420ec486..5af8d71e 100644 --- a/samples/generated_samples/dialogflow_v3_generated_pages_create_page_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_pages_create_page_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Pages_CreatePage_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_pages_delete_page_async.py b/samples/generated_samples/dialogflow_v3_generated_pages_delete_page_async.py index b0eaf579..b198eaaf 100644 --- a/samples/generated_samples/dialogflow_v3_generated_pages_delete_page_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_pages_delete_page_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Pages_DeletePage_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_pages_delete_page_sync.py b/samples/generated_samples/dialogflow_v3_generated_pages_delete_page_sync.py index 354d5874..739ce850 100644 --- a/samples/generated_samples/dialogflow_v3_generated_pages_delete_page_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_pages_delete_page_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Pages_DeletePage_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_pages_get_page_async.py b/samples/generated_samples/dialogflow_v3_generated_pages_get_page_async.py index 9041fdcb..1819f7b7 100644 --- a/samples/generated_samples/dialogflow_v3_generated_pages_get_page_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_pages_get_page_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Pages_GetPage_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_pages_get_page_sync.py b/samples/generated_samples/dialogflow_v3_generated_pages_get_page_sync.py index abd44ee1..fc5edf8f 100644 --- a/samples/generated_samples/dialogflow_v3_generated_pages_get_page_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_pages_get_page_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Pages_GetPage_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_pages_list_pages_async.py b/samples/generated_samples/dialogflow_v3_generated_pages_list_pages_async.py index ba60f3af..33d1d905 100644 --- a/samples/generated_samples/dialogflow_v3_generated_pages_list_pages_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_pages_list_pages_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Pages_ListPages_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_pages_list_pages_sync.py b/samples/generated_samples/dialogflow_v3_generated_pages_list_pages_sync.py index 85067ce6..03e0db6f 100644 --- a/samples/generated_samples/dialogflow_v3_generated_pages_list_pages_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_pages_list_pages_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Pages_ListPages_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_pages_update_page_async.py b/samples/generated_samples/dialogflow_v3_generated_pages_update_page_async.py index 6f4005f5..0b3218f5 100644 --- a/samples/generated_samples/dialogflow_v3_generated_pages_update_page_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_pages_update_page_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Pages_UpdatePage_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_pages_update_page_sync.py b/samples/generated_samples/dialogflow_v3_generated_pages_update_page_sync.py index 6745ef8a..9dc56897 100644 --- a/samples/generated_samples/dialogflow_v3_generated_pages_update_page_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_pages_update_page_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Pages_UpdatePage_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_create_security_settings_async.py b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_create_security_settings_async.py index 3aa7231d..5c2be8dc 100644 --- a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_create_security_settings_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_create_security_settings_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_create_security_settings_sync.py b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_create_security_settings_sync.py index b1888629..d95fb80d 100644 --- a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_create_security_settings_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_create_security_settings_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_delete_security_settings_async.py b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_delete_security_settings_async.py index 8d612cf9..68572a83 100644 --- a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_delete_security_settings_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_delete_security_settings_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_delete_security_settings_sync.py b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_delete_security_settings_sync.py index 2b54c820..8ea42ddd 100644 --- a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_delete_security_settings_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_delete_security_settings_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_get_security_settings_async.py b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_get_security_settings_async.py index c584e0be..a3105c3b 100644 --- a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_get_security_settings_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_get_security_settings_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_get_security_settings_sync.py b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_get_security_settings_sync.py index f97825be..d50233ed 100644 --- a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_get_security_settings_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_get_security_settings_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_list_security_settings_async.py b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_list_security_settings_async.py index e9ed185d..b9757850 100644 --- a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_list_security_settings_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_list_security_settings_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_list_security_settings_sync.py b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_list_security_settings_sync.py index 7599889a..feadfaa2 100644 --- a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_list_security_settings_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_list_security_settings_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_update_security_settings_async.py b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_update_security_settings_async.py index 5c0b2663..b9fecc36 100644 --- a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_update_security_settings_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_update_security_settings_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_update_security_settings_sync.py b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_update_security_settings_sync.py index f57fa255..95295bd0 100644 --- a/samples/generated_samples/dialogflow_v3_generated_security_settings_service_update_security_settings_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_security_settings_service_update_security_settings_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_create_session_entity_type_async.py b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_create_session_entity_type_async.py index e327112f..86f769ab 100644 --- a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_create_session_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_create_session_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SessionEntityTypes_CreateSessionEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_create_session_entity_type_sync.py b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_create_session_entity_type_sync.py index d19f37c8..1dd580e6 100644 --- a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_create_session_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_create_session_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SessionEntityTypes_CreateSessionEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_delete_session_entity_type_async.py b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_delete_session_entity_type_async.py index b930fdd1..7f038306 100644 --- a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_delete_session_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_delete_session_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SessionEntityTypes_DeleteSessionEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_delete_session_entity_type_sync.py b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_delete_session_entity_type_sync.py index a684872e..d4ccae15 100644 --- a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_delete_session_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_delete_session_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SessionEntityTypes_DeleteSessionEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_get_session_entity_type_async.py b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_get_session_entity_type_async.py index 7b99b29f..099e5e49 100644 --- a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_get_session_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_get_session_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SessionEntityTypes_GetSessionEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_get_session_entity_type_sync.py b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_get_session_entity_type_sync.py index 4fec286f..3ed2bf6c 100644 --- a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_get_session_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_get_session_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SessionEntityTypes_GetSessionEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_list_session_entity_types_async.py b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_list_session_entity_types_async.py index f3a56c0a..d99aa918 100644 --- a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_list_session_entity_types_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_list_session_entity_types_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SessionEntityTypes_ListSessionEntityTypes_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_list_session_entity_types_sync.py b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_list_session_entity_types_sync.py index 3c6ed744..96e7d6ba 100644 --- a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_list_session_entity_types_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_list_session_entity_types_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SessionEntityTypes_ListSessionEntityTypes_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_update_session_entity_type_async.py b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_update_session_entity_type_async.py index e1cfec7e..60b94198 100644 --- a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_update_session_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_update_session_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SessionEntityTypes_UpdateSessionEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_update_session_entity_type_sync.py b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_update_session_entity_type_sync.py index 68b171ec..7c3a73af 100644 --- a/samples/generated_samples/dialogflow_v3_generated_session_entity_types_update_session_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_session_entity_types_update_session_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_SessionEntityTypes_UpdateSessionEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_sessions_detect_intent_async.py b/samples/generated_samples/dialogflow_v3_generated_sessions_detect_intent_async.py index 277d8f8b..67881eed 100644 --- a/samples/generated_samples/dialogflow_v3_generated_sessions_detect_intent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_sessions_detect_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Sessions_DetectIntent_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_sessions_detect_intent_sync.py b/samples/generated_samples/dialogflow_v3_generated_sessions_detect_intent_sync.py index 18559ec3..d1fb082f 100644 --- a/samples/generated_samples/dialogflow_v3_generated_sessions_detect_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_sessions_detect_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Sessions_DetectIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_sessions_fulfill_intent_async.py b/samples/generated_samples/dialogflow_v3_generated_sessions_fulfill_intent_async.py index 26be6f68..4378b7dd 100644 --- a/samples/generated_samples/dialogflow_v3_generated_sessions_fulfill_intent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_sessions_fulfill_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Sessions_FulfillIntent_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_sessions_fulfill_intent_sync.py b/samples/generated_samples/dialogflow_v3_generated_sessions_fulfill_intent_sync.py index 54fc8088..473e15b8 100644 --- a/samples/generated_samples/dialogflow_v3_generated_sessions_fulfill_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_sessions_fulfill_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Sessions_FulfillIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_sessions_match_intent_async.py b/samples/generated_samples/dialogflow_v3_generated_sessions_match_intent_async.py index 9cbd67ee..69025c39 100644 --- a/samples/generated_samples/dialogflow_v3_generated_sessions_match_intent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_sessions_match_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Sessions_MatchIntent_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_sessions_match_intent_sync.py b/samples/generated_samples/dialogflow_v3_generated_sessions_match_intent_sync.py index 1f12e4b2..5591d9ec 100644 --- a/samples/generated_samples/dialogflow_v3_generated_sessions_match_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_sessions_match_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Sessions_MatchIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_sessions_streaming_detect_intent_async.py b/samples/generated_samples/dialogflow_v3_generated_sessions_streaming_detect_intent_async.py index dbb1d7a7..2692e617 100644 --- a/samples/generated_samples/dialogflow_v3_generated_sessions_streaming_detect_intent_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_sessions_streaming_detect_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Sessions_StreamingDetectIntent_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_sessions_streaming_detect_intent_sync.py b/samples/generated_samples/dialogflow_v3_generated_sessions_streaming_detect_intent_sync.py index 8314a32e..9d5098ca 100644 --- a/samples/generated_samples/dialogflow_v3_generated_sessions_streaming_detect_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_sessions_streaming_detect_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Sessions_StreamingDetectIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_delete_test_cases_async.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_delete_test_cases_async.py index 7af2dbd5..9684a7ba 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_delete_test_cases_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_delete_test_cases_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_BatchDeleteTestCases_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_delete_test_cases_sync.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_delete_test_cases_sync.py index 53341dd5..1a5ba889 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_delete_test_cases_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_delete_test_cases_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_BatchDeleteTestCases_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_run_test_cases_async.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_run_test_cases_async.py index 8f0f7ddb..425bf137 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_run_test_cases_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_run_test_cases_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_BatchRunTestCases_async] @@ -49,7 +49,7 @@ async def sample_batch_run_test_cases(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_run_test_cases_sync.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_run_test_cases_sync.py index bee10f02..c5db30a6 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_run_test_cases_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_batch_run_test_cases_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_BatchRunTestCases_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_calculate_coverage_async.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_calculate_coverage_async.py index 781d3092..1301583b 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_calculate_coverage_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_calculate_coverage_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_CalculateCoverage_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_calculate_coverage_sync.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_calculate_coverage_sync.py index b53518dc..7dd4df51 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_calculate_coverage_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_calculate_coverage_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_CalculateCoverage_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_create_test_case_async.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_create_test_case_async.py index fdd37a7d..d719a4c9 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_create_test_case_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_create_test_case_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_CreateTestCase_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_create_test_case_sync.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_create_test_case_sync.py index 3237fef3..a4bd3c9c 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_create_test_case_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_create_test_case_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_CreateTestCase_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_export_test_cases_async.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_export_test_cases_async.py index 58519d22..deeb7223 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_export_test_cases_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_export_test_cases_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_ExportTestCases_async] @@ -49,7 +49,7 @@ async def sample_export_test_cases(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_export_test_cases_sync.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_export_test_cases_sync.py index cb8ac83a..fd8176fd 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_export_test_cases_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_export_test_cases_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_ExportTestCases_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_async.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_async.py index 05b63e8a..073dd397 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_GetTestCase_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_result_async.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_result_async.py index 6d896c78..0196ce0f 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_result_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_result_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_GetTestCaseResult_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_result_sync.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_result_sync.py index 0b295bf5..4b9ab8bd 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_result_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_result_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_GetTestCaseResult_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_sync.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_sync.py index 3a437a2f..3b67fe2e 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_get_test_case_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_GetTestCase_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_import_test_cases_async.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_import_test_cases_async.py index 0b50b9e8..128fb32b 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_import_test_cases_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_import_test_cases_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_ImportTestCases_async] @@ -49,7 +49,7 @@ async def sample_import_test_cases(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_import_test_cases_sync.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_import_test_cases_sync.py index 4c5c0ab0..d9b11e8f 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_import_test_cases_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_import_test_cases_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_ImportTestCases_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_case_results_async.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_case_results_async.py index c915d486..ba4f7a02 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_case_results_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_case_results_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_ListTestCaseResults_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_case_results_sync.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_case_results_sync.py index 9f37e22b..0df741b5 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_case_results_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_case_results_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_ListTestCaseResults_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_cases_async.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_cases_async.py index a67965ed..afa7c084 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_cases_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_cases_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_ListTestCases_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_cases_sync.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_cases_sync.py index 068e8707..9594c73e 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_cases_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_list_test_cases_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_ListTestCases_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_run_test_case_async.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_run_test_case_async.py index 6e2dd2f9..c523a493 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_run_test_case_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_run_test_case_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_RunTestCase_async] @@ -48,7 +48,7 @@ async def sample_run_test_case(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_run_test_case_sync.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_run_test_case_sync.py index 9a849fae..1adaa374 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_run_test_case_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_run_test_case_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_RunTestCase_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_update_test_case_async.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_update_test_case_async.py index d6c378b4..d94c40c0 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_update_test_case_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_update_test_case_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_UpdateTestCase_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_test_cases_update_test_case_sync.py b/samples/generated_samples/dialogflow_v3_generated_test_cases_update_test_case_sync.py index cecee94c..83733c0c 100644 --- a/samples/generated_samples/dialogflow_v3_generated_test_cases_update_test_case_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_test_cases_update_test_case_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TestCases_UpdateTestCase_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_create_transition_route_group_async.py b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_create_transition_route_group_async.py index e8e43da9..c79e11ce 100644 --- a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_create_transition_route_group_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_create_transition_route_group_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_create_transition_route_group_sync.py b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_create_transition_route_group_sync.py index fc02640e..198a3258 100644 --- a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_create_transition_route_group_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_create_transition_route_group_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_delete_transition_route_group_async.py b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_delete_transition_route_group_async.py index 435980b9..86441356 100644 --- a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_delete_transition_route_group_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_delete_transition_route_group_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_delete_transition_route_group_sync.py b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_delete_transition_route_group_sync.py index 63456eec..170469c6 100644 --- a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_delete_transition_route_group_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_delete_transition_route_group_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_get_transition_route_group_async.py b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_get_transition_route_group_async.py index 91ae96d6..55442027 100644 --- a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_get_transition_route_group_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_get_transition_route_group_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_get_transition_route_group_sync.py b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_get_transition_route_group_sync.py index 0f3d50e0..09d0c66d 100644 --- a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_get_transition_route_group_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_get_transition_route_group_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_list_transition_route_groups_async.py b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_list_transition_route_groups_async.py index 2eb654cf..f8935f71 100644 --- a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_list_transition_route_groups_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_list_transition_route_groups_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_list_transition_route_groups_sync.py b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_list_transition_route_groups_sync.py index 769bd4dc..9a7a1ee5 100644 --- a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_list_transition_route_groups_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_list_transition_route_groups_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_update_transition_route_group_async.py b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_update_transition_route_group_async.py index 98f540be..98fc154b 100644 --- a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_update_transition_route_group_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_update_transition_route_group_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_update_transition_route_group_sync.py b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_update_transition_route_group_sync.py index 061c3439..2cdbcb0f 100644 --- a/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_update_transition_route_group_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_transition_route_groups_update_transition_route_group_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_versions_compare_versions_async.py b/samples/generated_samples/dialogflow_v3_generated_versions_compare_versions_async.py index 634181d8..a1debce3 100644 --- a/samples/generated_samples/dialogflow_v3_generated_versions_compare_versions_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_versions_compare_versions_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Versions_CompareVersions_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_versions_compare_versions_sync.py b/samples/generated_samples/dialogflow_v3_generated_versions_compare_versions_sync.py index f6105d20..2c27dc51 100644 --- a/samples/generated_samples/dialogflow_v3_generated_versions_compare_versions_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_versions_compare_versions_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Versions_CompareVersions_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_versions_create_version_async.py b/samples/generated_samples/dialogflow_v3_generated_versions_create_version_async.py index f5381834..2a1ea29d 100644 --- a/samples/generated_samples/dialogflow_v3_generated_versions_create_version_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_versions_create_version_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Versions_CreateVersion_async] @@ -52,7 +52,7 @@ async def sample_create_version(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_versions_create_version_sync.py b/samples/generated_samples/dialogflow_v3_generated_versions_create_version_sync.py index 54be0d8a..99131c38 100644 --- a/samples/generated_samples/dialogflow_v3_generated_versions_create_version_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_versions_create_version_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Versions_CreateVersion_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_versions_delete_version_async.py b/samples/generated_samples/dialogflow_v3_generated_versions_delete_version_async.py index 0719c224..683853f6 100644 --- a/samples/generated_samples/dialogflow_v3_generated_versions_delete_version_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_versions_delete_version_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Versions_DeleteVersion_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_versions_delete_version_sync.py b/samples/generated_samples/dialogflow_v3_generated_versions_delete_version_sync.py index 012f1702..d994718d 100644 --- a/samples/generated_samples/dialogflow_v3_generated_versions_delete_version_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_versions_delete_version_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Versions_DeleteVersion_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_versions_get_version_async.py b/samples/generated_samples/dialogflow_v3_generated_versions_get_version_async.py index 74278cbd..05607880 100644 --- a/samples/generated_samples/dialogflow_v3_generated_versions_get_version_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_versions_get_version_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Versions_GetVersion_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_versions_get_version_sync.py b/samples/generated_samples/dialogflow_v3_generated_versions_get_version_sync.py index f8b0e041..cddfd93d 100644 --- a/samples/generated_samples/dialogflow_v3_generated_versions_get_version_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_versions_get_version_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Versions_GetVersion_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_versions_list_versions_async.py b/samples/generated_samples/dialogflow_v3_generated_versions_list_versions_async.py index 2c430bc7..e2565780 100644 --- a/samples/generated_samples/dialogflow_v3_generated_versions_list_versions_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_versions_list_versions_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Versions_ListVersions_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_versions_list_versions_sync.py b/samples/generated_samples/dialogflow_v3_generated_versions_list_versions_sync.py index 66151418..de298257 100644 --- a/samples/generated_samples/dialogflow_v3_generated_versions_list_versions_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_versions_list_versions_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Versions_ListVersions_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_versions_load_version_async.py b/samples/generated_samples/dialogflow_v3_generated_versions_load_version_async.py index 56ee681a..7a55064a 100644 --- a/samples/generated_samples/dialogflow_v3_generated_versions_load_version_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_versions_load_version_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Versions_LoadVersion_async] @@ -48,7 +48,7 @@ async def sample_load_version(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3_generated_versions_load_version_sync.py b/samples/generated_samples/dialogflow_v3_generated_versions_load_version_sync.py index 8ebaffbb..7afccce1 100644 --- a/samples/generated_samples/dialogflow_v3_generated_versions_load_version_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_versions_load_version_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Versions_LoadVersion_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_versions_update_version_async.py b/samples/generated_samples/dialogflow_v3_generated_versions_update_version_async.py index 404e61f5..f53339e5 100644 --- a/samples/generated_samples/dialogflow_v3_generated_versions_update_version_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_versions_update_version_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Versions_UpdateVersion_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_versions_update_version_sync.py b/samples/generated_samples/dialogflow_v3_generated_versions_update_version_sync.py index 533f3a06..1b1d0b64 100644 --- a/samples/generated_samples/dialogflow_v3_generated_versions_update_version_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_versions_update_version_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Versions_UpdateVersion_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_webhooks_create_webhook_async.py b/samples/generated_samples/dialogflow_v3_generated_webhooks_create_webhook_async.py index 74d57f10..77f14b42 100644 --- a/samples/generated_samples/dialogflow_v3_generated_webhooks_create_webhook_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_webhooks_create_webhook_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Webhooks_CreateWebhook_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_webhooks_create_webhook_sync.py b/samples/generated_samples/dialogflow_v3_generated_webhooks_create_webhook_sync.py index 435c3842..db760c81 100644 --- a/samples/generated_samples/dialogflow_v3_generated_webhooks_create_webhook_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_webhooks_create_webhook_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Webhooks_CreateWebhook_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_webhooks_delete_webhook_async.py b/samples/generated_samples/dialogflow_v3_generated_webhooks_delete_webhook_async.py index 9391984d..57034994 100644 --- a/samples/generated_samples/dialogflow_v3_generated_webhooks_delete_webhook_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_webhooks_delete_webhook_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Webhooks_DeleteWebhook_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_webhooks_delete_webhook_sync.py b/samples/generated_samples/dialogflow_v3_generated_webhooks_delete_webhook_sync.py index 4216ced8..13a0a618 100644 --- a/samples/generated_samples/dialogflow_v3_generated_webhooks_delete_webhook_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_webhooks_delete_webhook_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Webhooks_DeleteWebhook_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_webhooks_get_webhook_async.py b/samples/generated_samples/dialogflow_v3_generated_webhooks_get_webhook_async.py index 4b6c5e23..abf401c4 100644 --- a/samples/generated_samples/dialogflow_v3_generated_webhooks_get_webhook_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_webhooks_get_webhook_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Webhooks_GetWebhook_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_webhooks_get_webhook_sync.py b/samples/generated_samples/dialogflow_v3_generated_webhooks_get_webhook_sync.py index 4004f615..3664f95a 100644 --- a/samples/generated_samples/dialogflow_v3_generated_webhooks_get_webhook_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_webhooks_get_webhook_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Webhooks_GetWebhook_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_webhooks_list_webhooks_async.py b/samples/generated_samples/dialogflow_v3_generated_webhooks_list_webhooks_async.py index 405ad29b..100ab03f 100644 --- a/samples/generated_samples/dialogflow_v3_generated_webhooks_list_webhooks_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_webhooks_list_webhooks_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Webhooks_ListWebhooks_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_webhooks_list_webhooks_sync.py b/samples/generated_samples/dialogflow_v3_generated_webhooks_list_webhooks_sync.py index 8d29fa49..c3512b04 100644 --- a/samples/generated_samples/dialogflow_v3_generated_webhooks_list_webhooks_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_webhooks_list_webhooks_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Webhooks_ListWebhooks_sync] diff --git a/samples/generated_samples/dialogflow_v3_generated_webhooks_update_webhook_async.py b/samples/generated_samples/dialogflow_v3_generated_webhooks_update_webhook_async.py index 570d0551..49f56ca1 100644 --- a/samples/generated_samples/dialogflow_v3_generated_webhooks_update_webhook_async.py +++ b/samples/generated_samples/dialogflow_v3_generated_webhooks_update_webhook_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Webhooks_UpdateWebhook_async] diff --git a/samples/generated_samples/dialogflow_v3_generated_webhooks_update_webhook_sync.py b/samples/generated_samples/dialogflow_v3_generated_webhooks_update_webhook_sync.py index d975a6b9..b73e7725 100644 --- a/samples/generated_samples/dialogflow_v3_generated_webhooks_update_webhook_sync.py +++ b/samples/generated_samples/dialogflow_v3_generated_webhooks_update_webhook_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3_generated_Webhooks_UpdateWebhook_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_create_agent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_create_agent_async.py index d9ebf1e0..220dc065 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_create_agent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_create_agent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_CreateAgent_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_create_agent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_create_agent_sync.py index f4dd600e..aece96fa 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_create_agent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_create_agent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_CreateAgent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_delete_agent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_delete_agent_async.py index 52685cc6..0ea17dcb 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_delete_agent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_delete_agent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_DeleteAgent_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_delete_agent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_delete_agent_sync.py index 10c94a68..dd78c49a 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_delete_agent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_delete_agent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_DeleteAgent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_export_agent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_export_agent_async.py index 5a85142d..f6d9d112 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_export_agent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_export_agent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_ExportAgent_async] @@ -48,7 +48,7 @@ async def sample_export_agent(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_export_agent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_export_agent_sync.py index 386a9402..5176871c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_export_agent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_export_agent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_ExportAgent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_async.py index 06b9118b..1adc72ca 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_GetAgent_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_sync.py index 44cb2db2..f9bac522 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_GetAgent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_validation_result_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_validation_result_async.py index 257d7d90..e305c994 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_validation_result_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_validation_result_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_GetAgentValidationResult_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_validation_result_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_validation_result_sync.py index 70f679b9..22beec48 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_validation_result_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_get_agent_validation_result_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_GetAgentValidationResult_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_list_agents_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_list_agents_async.py index 4e795172..ec86ca21 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_list_agents_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_list_agents_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_ListAgents_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_list_agents_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_list_agents_sync.py index 2a2d640f..c0893946 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_list_agents_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_list_agents_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_ListAgents_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_restore_agent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_restore_agent_async.py index 7b77c6e6..25a47078 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_restore_agent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_restore_agent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_RestoreAgent_async] @@ -49,7 +49,7 @@ async def sample_restore_agent(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_restore_agent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_restore_agent_sync.py index a3281763..5331d4e8 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_restore_agent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_restore_agent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_RestoreAgent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_update_agent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_update_agent_async.py index a0d07744..1531bda8 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_update_agent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_update_agent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_UpdateAgent_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_update_agent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_update_agent_sync.py index e7c29693..9fa19bfa 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_update_agent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_update_agent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_UpdateAgent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_validate_agent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_validate_agent_async.py index c6b54160..7e345ce3 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_validate_agent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_validate_agent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_ValidateAgent_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_agents_validate_agent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_agents_validate_agent_sync.py index fc731586..568ac468 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_agents_validate_agent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_agents_validate_agent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Agents_ValidateAgent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_get_changelog_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_get_changelog_async.py index af3b7b90..40671a3e 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_get_changelog_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_get_changelog_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Changelogs_GetChangelog_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_get_changelog_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_get_changelog_sync.py index 90a03d0e..10cc86c1 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_get_changelog_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_get_changelog_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Changelogs_GetChangelog_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_list_changelogs_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_list_changelogs_async.py index 3ba1f5f6..511da9f8 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_list_changelogs_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_list_changelogs_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Changelogs_ListChangelogs_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_list_changelogs_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_list_changelogs_sync.py index a235a09c..87d74dd7 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_list_changelogs_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_changelogs_list_changelogs_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Changelogs_ListChangelogs_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_deployments_get_deployment_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_deployments_get_deployment_async.py index 54cfea67..cc01e32b 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_deployments_get_deployment_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_deployments_get_deployment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Deployments_GetDeployment_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_deployments_get_deployment_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_deployments_get_deployment_sync.py index c6ff2d81..cf39d25b 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_deployments_get_deployment_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_deployments_get_deployment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Deployments_GetDeployment_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_deployments_list_deployments_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_deployments_list_deployments_async.py index 92d419b8..b1beb862 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_deployments_list_deployments_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_deployments_list_deployments_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Deployments_ListDeployments_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_deployments_list_deployments_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_deployments_list_deployments_sync.py index 16938fe6..905575b2 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_deployments_list_deployments_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_deployments_list_deployments_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Deployments_ListDeployments_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_create_entity_type_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_create_entity_type_async.py index 2d26a711..9647662c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_create_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_create_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_EntityTypes_CreateEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_create_entity_type_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_create_entity_type_sync.py index 10018c63..4917a2c8 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_create_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_create_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_EntityTypes_CreateEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_delete_entity_type_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_delete_entity_type_async.py index e138c3e6..c19805f5 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_delete_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_delete_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_EntityTypes_DeleteEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_delete_entity_type_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_delete_entity_type_sync.py index 117ea713..d35678fa 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_delete_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_delete_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_EntityTypes_DeleteEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_get_entity_type_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_get_entity_type_async.py index 48e761bf..8f880cd4 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_get_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_get_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_EntityTypes_GetEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_get_entity_type_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_get_entity_type_sync.py index 3b088554..2b57767c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_get_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_get_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_EntityTypes_GetEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_list_entity_types_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_list_entity_types_async.py index 16f0e757..63830b68 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_list_entity_types_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_list_entity_types_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_EntityTypes_ListEntityTypes_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_list_entity_types_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_list_entity_types_sync.py index 78e5424d..858fbe7f 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_list_entity_types_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_list_entity_types_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_EntityTypes_ListEntityTypes_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_update_entity_type_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_update_entity_type_async.py index b02aa6cc..860bcd3a 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_update_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_update_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_EntityTypes_UpdateEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_update_entity_type_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_update_entity_type_sync.py index b61a589c..c140dbb0 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_update_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_entity_types_update_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_EntityTypes_UpdateEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_create_environment_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_create_environment_async.py index 7d6a820c..aa1e90a8 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_create_environment_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_create_environment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_CreateEnvironment_async] @@ -53,7 +53,7 @@ async def sample_create_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_create_environment_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_create_environment_sync.py index 2defe28b..52a738e5 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_create_environment_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_create_environment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_CreateEnvironment_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_delete_environment_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_delete_environment_async.py index 5cc0a1e6..b15ddb81 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_delete_environment_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_delete_environment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_DeleteEnvironment_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_delete_environment_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_delete_environment_sync.py index 703dca4d..ad90db2e 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_delete_environment_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_delete_environment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_DeleteEnvironment_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_deploy_flow_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_deploy_flow_async.py index 0aa08cab..bcd42c20 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_deploy_flow_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_deploy_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_DeployFlow_async] @@ -49,7 +49,7 @@ async def sample_deploy_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_deploy_flow_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_deploy_flow_sync.py index 1396db1a..3ebc3e03 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_deploy_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_deploy_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_DeployFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_get_environment_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_get_environment_async.py index 2b817f1f..8f58ed8d 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_get_environment_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_get_environment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_GetEnvironment_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_get_environment_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_get_environment_sync.py index b6acb5c3..9db4476f 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_get_environment_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_get_environment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_GetEnvironment_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_continuous_test_results_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_continuous_test_results_async.py index 7fb59145..ac79c6bf 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_continuous_test_results_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_continuous_test_results_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_ListContinuousTestResults_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_continuous_test_results_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_continuous_test_results_sync.py index 0f55cf14..5ab3d4e4 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_continuous_test_results_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_continuous_test_results_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_ListContinuousTestResults_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_environments_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_environments_async.py index 1f61d49a..2bd3363b 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_environments_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_environments_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_ListEnvironments_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_environments_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_environments_sync.py index c4d359ce..d87185db 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_environments_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_list_environments_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_ListEnvironments_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_lookup_environment_history_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_lookup_environment_history_async.py index b1d0c256..b464b8ed 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_lookup_environment_history_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_lookup_environment_history_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_LookupEnvironmentHistory_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_lookup_environment_history_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_lookup_environment_history_sync.py index 3f77a232..fc636709 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_lookup_environment_history_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_lookup_environment_history_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_LookupEnvironmentHistory_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_run_continuous_test_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_run_continuous_test_async.py index a24a7b19..665fd01c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_run_continuous_test_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_run_continuous_test_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_RunContinuousTest_async] @@ -48,7 +48,7 @@ async def sample_run_continuous_test(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_run_continuous_test_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_run_continuous_test_sync.py index 1cda9907..c5e8e2e5 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_run_continuous_test_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_run_continuous_test_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_RunContinuousTest_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_update_environment_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_update_environment_async.py index 1f05831a..dfc8e8e2 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_update_environment_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_update_environment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_UpdateEnvironment_async] @@ -52,7 +52,7 @@ async def sample_update_environment(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_environments_update_environment_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_environments_update_environment_sync.py index 8f1db73f..f89dd86a 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_environments_update_environment_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_environments_update_environment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Environments_UpdateEnvironment_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_create_experiment_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_create_experiment_async.py index 6fa3bb96..f196b655 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_create_experiment_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_create_experiment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Experiments_CreateExperiment_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_create_experiment_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_create_experiment_sync.py index b74b8615..9cfe6537 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_create_experiment_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_create_experiment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Experiments_CreateExperiment_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_delete_experiment_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_delete_experiment_async.py index 408074cd..8c20d09d 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_delete_experiment_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_delete_experiment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Experiments_DeleteExperiment_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_delete_experiment_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_delete_experiment_sync.py index 8ab88af8..51d3fef8 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_delete_experiment_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_delete_experiment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Experiments_DeleteExperiment_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_get_experiment_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_get_experiment_async.py index 39606b1c..28f7f59a 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_get_experiment_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_get_experiment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Experiments_GetExperiment_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_get_experiment_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_get_experiment_sync.py index 113b27d6..6ccb3503 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_get_experiment_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_get_experiment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Experiments_GetExperiment_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_list_experiments_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_list_experiments_async.py index bcbe3797..bde3a551 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_list_experiments_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_list_experiments_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Experiments_ListExperiments_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_list_experiments_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_list_experiments_sync.py index 0b8b00bd..a796636b 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_list_experiments_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_list_experiments_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Experiments_ListExperiments_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_start_experiment_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_start_experiment_async.py index 7a224f52..f974ea46 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_start_experiment_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_start_experiment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Experiments_StartExperiment_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_start_experiment_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_start_experiment_sync.py index ea256e0b..b4be3c42 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_start_experiment_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_start_experiment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Experiments_StartExperiment_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_stop_experiment_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_stop_experiment_async.py index 8213c68a..c6a0be21 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_stop_experiment_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_stop_experiment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Experiments_StopExperiment_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_stop_experiment_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_stop_experiment_sync.py index f8350be8..f866cccf 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_stop_experiment_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_stop_experiment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Experiments_StopExperiment_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_update_experiment_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_update_experiment_async.py index 2fc763ff..dde9f6d5 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_update_experiment_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_update_experiment_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Experiments_UpdateExperiment_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_update_experiment_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_update_experiment_sync.py index 31b4e45c..b06c8500 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_experiments_update_experiment_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_experiments_update_experiment_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Experiments_UpdateExperiment_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_create_flow_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_create_flow_async.py index 50486563..65b71bfa 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_create_flow_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_create_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_CreateFlow_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_create_flow_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_create_flow_sync.py index 2e565867..0a1819b9 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_create_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_create_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_CreateFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_delete_flow_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_delete_flow_async.py index 62341ff6..66cf3011 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_delete_flow_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_delete_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_DeleteFlow_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_delete_flow_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_delete_flow_sync.py index edb4cc83..cd0d8ce5 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_delete_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_delete_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_DeleteFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_export_flow_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_export_flow_async.py index f2307d0f..86ec6937 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_export_flow_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_export_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_ExportFlow_async] @@ -48,7 +48,7 @@ async def sample_export_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_export_flow_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_export_flow_sync.py index 80ecc5ea..db2d145c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_export_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_export_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_ExportFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_async.py index edbb2b19..39c94679 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_GetFlow_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_sync.py index 18fd2cc1..74a6b930 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_GetFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_validation_result_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_validation_result_async.py index 389ec075..8f7b99a3 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_validation_result_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_validation_result_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_GetFlowValidationResult_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_validation_result_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_validation_result_sync.py index 1c4e0b2c..482690c1 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_validation_result_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_get_flow_validation_result_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_GetFlowValidationResult_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_import_flow_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_import_flow_async.py index 2753e682..7e0dfb1c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_import_flow_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_import_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_ImportFlow_async] @@ -49,7 +49,7 @@ async def sample_import_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_import_flow_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_import_flow_sync.py index 995368a2..6bb2041e 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_import_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_import_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_ImportFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_list_flows_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_list_flows_async.py index eece837b..d03a5e1c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_list_flows_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_list_flows_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_ListFlows_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_list_flows_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_list_flows_sync.py index 969c7d80..529ea518 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_list_flows_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_list_flows_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_ListFlows_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_train_flow_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_train_flow_async.py index 7c14a3f2..e1f65050 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_train_flow_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_train_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_TrainFlow_async] @@ -48,7 +48,7 @@ async def sample_train_flow(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_train_flow_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_train_flow_sync.py index 9bb0a272..71b83253 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_train_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_train_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_TrainFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_update_flow_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_update_flow_async.py index 962298bf..12e0c525 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_update_flow_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_update_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_UpdateFlow_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_update_flow_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_update_flow_sync.py index b822654b..3ced31b7 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_update_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_update_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_UpdateFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_validate_flow_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_validate_flow_async.py index 7948018f..1eb1359b 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_validate_flow_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_validate_flow_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_ValidateFlow_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_flows_validate_flow_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_flows_validate_flow_sync.py index 51eceea5..d924ef5c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_flows_validate_flow_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_flows_validate_flow_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Flows_ValidateFlow_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_intents_create_intent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_intents_create_intent_async.py index 75be08ca..8a92955b 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_intents_create_intent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_intents_create_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Intents_CreateIntent_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_intents_create_intent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_intents_create_intent_sync.py index 4ad52688..3c7aa30b 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_intents_create_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_intents_create_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Intents_CreateIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_intents_delete_intent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_intents_delete_intent_async.py index 1f5eb014..91f9b189 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_intents_delete_intent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_intents_delete_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Intents_DeleteIntent_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_intents_delete_intent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_intents_delete_intent_sync.py index 4bc4d081..f6ebeea3 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_intents_delete_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_intents_delete_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Intents_DeleteIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_intents_get_intent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_intents_get_intent_async.py index fb4a5eda..8edc2959 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_intents_get_intent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_intents_get_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Intents_GetIntent_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_intents_get_intent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_intents_get_intent_sync.py index e73d546f..28621736 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_intents_get_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_intents_get_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Intents_GetIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_intents_list_intents_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_intents_list_intents_async.py index f9295caf..fa9be062 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_intents_list_intents_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_intents_list_intents_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Intents_ListIntents_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_intents_list_intents_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_intents_list_intents_sync.py index b3602937..8f1fb38f 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_intents_list_intents_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_intents_list_intents_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Intents_ListIntents_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_intents_update_intent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_intents_update_intent_async.py index 5372a0ba..0e6dfdbf 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_intents_update_intent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_intents_update_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Intents_UpdateIntent_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_intents_update_intent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_intents_update_intent_sync.py index b4122e0c..2949c4fe 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_intents_update_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_intents_update_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Intents_UpdateIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_pages_create_page_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_pages_create_page_async.py index 97f2c170..3755af50 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_pages_create_page_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_pages_create_page_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Pages_CreatePage_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_pages_create_page_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_pages_create_page_sync.py index d2c076df..51886c1c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_pages_create_page_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_pages_create_page_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Pages_CreatePage_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_pages_delete_page_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_pages_delete_page_async.py index 1b717473..92dc6299 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_pages_delete_page_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_pages_delete_page_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Pages_DeletePage_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_pages_delete_page_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_pages_delete_page_sync.py index ebc3bcc2..8ecfc903 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_pages_delete_page_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_pages_delete_page_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Pages_DeletePage_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_pages_get_page_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_pages_get_page_async.py index 610094f4..262be21e 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_pages_get_page_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_pages_get_page_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Pages_GetPage_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_pages_get_page_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_pages_get_page_sync.py index c6a9c2bb..ebba3d91 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_pages_get_page_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_pages_get_page_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Pages_GetPage_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_pages_list_pages_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_pages_list_pages_async.py index 8bf505d0..40adbd24 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_pages_list_pages_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_pages_list_pages_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Pages_ListPages_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_pages_list_pages_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_pages_list_pages_sync.py index e69f14af..778b0a9c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_pages_list_pages_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_pages_list_pages_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Pages_ListPages_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_pages_update_page_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_pages_update_page_async.py index 2f6bf517..4843f5c0 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_pages_update_page_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_pages_update_page_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Pages_UpdatePage_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_pages_update_page_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_pages_update_page_sync.py index f930807f..68249211 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_pages_update_page_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_pages_update_page_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Pages_UpdatePage_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_create_security_settings_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_create_security_settings_async.py index d01e41cd..2ae1301b 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_create_security_settings_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_create_security_settings_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SecuritySettingsService_CreateSecuritySettings_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_create_security_settings_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_create_security_settings_sync.py index 05ca1afa..16f95f85 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_create_security_settings_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_create_security_settings_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SecuritySettingsService_CreateSecuritySettings_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_delete_security_settings_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_delete_security_settings_async.py index e203de76..4b33a032 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_delete_security_settings_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_delete_security_settings_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SecuritySettingsService_DeleteSecuritySettings_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_delete_security_settings_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_delete_security_settings_sync.py index 1b2f454f..2f3ebe31 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_delete_security_settings_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_delete_security_settings_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SecuritySettingsService_DeleteSecuritySettings_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_get_security_settings_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_get_security_settings_async.py index 9bafc4f6..a85e0c5e 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_get_security_settings_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_get_security_settings_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SecuritySettingsService_GetSecuritySettings_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_get_security_settings_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_get_security_settings_sync.py index 6a566d57..9a01a253 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_get_security_settings_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_get_security_settings_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SecuritySettingsService_GetSecuritySettings_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_list_security_settings_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_list_security_settings_async.py index faef0da7..82041014 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_list_security_settings_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_list_security_settings_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SecuritySettingsService_ListSecuritySettings_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_list_security_settings_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_list_security_settings_sync.py index d1db930f..7d0011f9 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_list_security_settings_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_list_security_settings_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SecuritySettingsService_ListSecuritySettings_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_update_security_settings_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_update_security_settings_async.py index d98aedf2..500c5e74 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_update_security_settings_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_update_security_settings_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SecuritySettingsService_UpdateSecuritySettings_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_update_security_settings_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_update_security_settings_sync.py index bcbd94f0..259da3ec 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_update_security_settings_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_security_settings_service_update_security_settings_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SecuritySettingsService_UpdateSecuritySettings_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_create_session_entity_type_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_create_session_entity_type_async.py index ec1b4978..6967854a 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_create_session_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_create_session_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SessionEntityTypes_CreateSessionEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_create_session_entity_type_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_create_session_entity_type_sync.py index 9a8e9a37..37dd0f6a 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_create_session_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_create_session_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SessionEntityTypes_CreateSessionEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_delete_session_entity_type_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_delete_session_entity_type_async.py index cfbd89d0..0b23e760 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_delete_session_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_delete_session_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SessionEntityTypes_DeleteSessionEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_delete_session_entity_type_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_delete_session_entity_type_sync.py index 55562865..fa24406d 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_delete_session_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_delete_session_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SessionEntityTypes_DeleteSessionEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_get_session_entity_type_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_get_session_entity_type_async.py index f945dfb9..448fde1c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_get_session_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_get_session_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SessionEntityTypes_GetSessionEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_get_session_entity_type_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_get_session_entity_type_sync.py index 8f7b5912..79330391 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_get_session_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_get_session_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SessionEntityTypes_GetSessionEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_list_session_entity_types_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_list_session_entity_types_async.py index 64f0e64b..dc4735ec 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_list_session_entity_types_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_list_session_entity_types_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SessionEntityTypes_ListSessionEntityTypes_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_list_session_entity_types_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_list_session_entity_types_sync.py index 73a541d7..2b26cbcb 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_list_session_entity_types_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_list_session_entity_types_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SessionEntityTypes_ListSessionEntityTypes_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_update_session_entity_type_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_update_session_entity_type_async.py index 0d204113..ff749986 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_update_session_entity_type_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_update_session_entity_type_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SessionEntityTypes_UpdateSessionEntityType_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_update_session_entity_type_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_update_session_entity_type_sync.py index 88ef878c..493e2715 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_update_session_entity_type_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_session_entity_types_update_session_entity_type_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_SessionEntityTypes_UpdateSessionEntityType_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_detect_intent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_detect_intent_async.py index 15768c61..560e5a50 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_detect_intent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_detect_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Sessions_DetectIntent_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_detect_intent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_detect_intent_sync.py index f1839d47..d7632781 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_detect_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_detect_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Sessions_DetectIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_fulfill_intent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_fulfill_intent_async.py index f621df5b..1dbbf5ca 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_fulfill_intent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_fulfill_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Sessions_FulfillIntent_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_fulfill_intent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_fulfill_intent_sync.py index 5a9e7d53..f1d743cb 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_fulfill_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_fulfill_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Sessions_FulfillIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_match_intent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_match_intent_async.py index d5becb91..cbb8a544 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_match_intent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_match_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Sessions_MatchIntent_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_match_intent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_match_intent_sync.py index a8f0bf1d..25f2cad7 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_match_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_match_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Sessions_MatchIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_streaming_detect_intent_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_streaming_detect_intent_async.py index fe542b05..a2a3968b 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_streaming_detect_intent_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_streaming_detect_intent_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Sessions_StreamingDetectIntent_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_streaming_detect_intent_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_streaming_detect_intent_sync.py index 29b0cf19..da59210b 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_sessions_streaming_detect_intent_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_sessions_streaming_detect_intent_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Sessions_StreamingDetectIntent_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_delete_test_cases_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_delete_test_cases_async.py index 6788e970..f2ada573 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_delete_test_cases_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_delete_test_cases_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_BatchDeleteTestCases_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_delete_test_cases_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_delete_test_cases_sync.py index 5b1d7056..11e1c85b 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_delete_test_cases_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_delete_test_cases_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_BatchDeleteTestCases_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_run_test_cases_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_run_test_cases_async.py index af86ba0d..ff004dcc 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_run_test_cases_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_run_test_cases_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_BatchRunTestCases_async] @@ -49,7 +49,7 @@ async def sample_batch_run_test_cases(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_run_test_cases_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_run_test_cases_sync.py index bcf96a7b..f64090ce 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_run_test_cases_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_batch_run_test_cases_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_BatchRunTestCases_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_calculate_coverage_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_calculate_coverage_async.py index 2b5bbaa3..3cfe0f6c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_calculate_coverage_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_calculate_coverage_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_CalculateCoverage_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_calculate_coverage_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_calculate_coverage_sync.py index 19005714..9decd74a 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_calculate_coverage_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_calculate_coverage_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_CalculateCoverage_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_create_test_case_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_create_test_case_async.py index 739a3cfb..a7d7d1dd 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_create_test_case_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_create_test_case_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_CreateTestCase_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_create_test_case_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_create_test_case_sync.py index a0323f96..e5b35cb4 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_create_test_case_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_create_test_case_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_CreateTestCase_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_export_test_cases_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_export_test_cases_async.py index 7d90b577..3fd461cf 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_export_test_cases_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_export_test_cases_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_ExportTestCases_async] @@ -49,7 +49,7 @@ async def sample_export_test_cases(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_export_test_cases_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_export_test_cases_sync.py index faf4c5e8..d9da2dc1 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_export_test_cases_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_export_test_cases_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_ExportTestCases_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_async.py index d6d29c0a..0d10e278 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_GetTestCase_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_result_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_result_async.py index fdbb1ed5..369c28b4 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_result_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_result_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_GetTestCaseResult_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_result_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_result_sync.py index 286a477c..0eb6a9ed 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_result_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_result_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_GetTestCaseResult_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_sync.py index 55f40c61..1a3d354e 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_get_test_case_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_GetTestCase_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_import_test_cases_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_import_test_cases_async.py index a2e72b93..8d58d02c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_import_test_cases_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_import_test_cases_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_ImportTestCases_async] @@ -49,7 +49,7 @@ async def sample_import_test_cases(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_import_test_cases_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_import_test_cases_sync.py index 03aa416f..71a72918 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_import_test_cases_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_import_test_cases_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_ImportTestCases_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_case_results_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_case_results_async.py index cb1c477d..12fc1242 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_case_results_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_case_results_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_ListTestCaseResults_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_case_results_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_case_results_sync.py index d635840b..16c0450e 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_case_results_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_case_results_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_ListTestCaseResults_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_cases_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_cases_async.py index b218a71e..41e7ae83 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_cases_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_cases_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_ListTestCases_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_cases_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_cases_sync.py index 24ae1b6b..aa874ba1 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_cases_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_list_test_cases_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_ListTestCases_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_run_test_case_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_run_test_case_async.py index c0073449..197b43d5 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_run_test_case_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_run_test_case_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_RunTestCase_async] @@ -48,7 +48,7 @@ async def sample_run_test_case(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_run_test_case_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_run_test_case_sync.py index ce89df08..fd58564b 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_run_test_case_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_run_test_case_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_RunTestCase_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_update_test_case_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_update_test_case_async.py index e0b13b75..21ab63d0 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_update_test_case_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_update_test_case_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_UpdateTestCase_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_update_test_case_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_update_test_case_sync.py index 97306a94..0fe6ac1f 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_update_test_case_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_test_cases_update_test_case_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TestCases_UpdateTestCase_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_create_transition_route_group_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_create_transition_route_group_async.py index 52c9c8da..9cfafbc1 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_create_transition_route_group_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_create_transition_route_group_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TransitionRouteGroups_CreateTransitionRouteGroup_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_create_transition_route_group_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_create_transition_route_group_sync.py index 5f622a4a..2ceb9da3 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_create_transition_route_group_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_create_transition_route_group_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TransitionRouteGroups_CreateTransitionRouteGroup_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_delete_transition_route_group_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_delete_transition_route_group_async.py index 2baf12ba..4f85384b 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_delete_transition_route_group_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_delete_transition_route_group_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_delete_transition_route_group_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_delete_transition_route_group_sync.py index 5ec06e9f..d334ea1c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_delete_transition_route_group_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_delete_transition_route_group_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_get_transition_route_group_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_get_transition_route_group_async.py index f676d861..960650be 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_get_transition_route_group_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_get_transition_route_group_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TransitionRouteGroups_GetTransitionRouteGroup_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_get_transition_route_group_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_get_transition_route_group_sync.py index a03a8dc4..a019082c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_get_transition_route_group_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_get_transition_route_group_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TransitionRouteGroups_GetTransitionRouteGroup_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_list_transition_route_groups_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_list_transition_route_groups_async.py index 483a7aab..5d823106 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_list_transition_route_groups_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_list_transition_route_groups_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TransitionRouteGroups_ListTransitionRouteGroups_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_list_transition_route_groups_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_list_transition_route_groups_sync.py index 6aa638a7..5a89fd72 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_list_transition_route_groups_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_list_transition_route_groups_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TransitionRouteGroups_ListTransitionRouteGroups_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_update_transition_route_group_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_update_transition_route_group_async.py index cc2a3a10..cf1f42d5 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_update_transition_route_group_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_update_transition_route_group_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_update_transition_route_group_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_update_transition_route_group_sync.py index 3c0a95b2..6b344f71 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_update_transition_route_group_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_transition_route_groups_update_transition_route_group_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_versions_compare_versions_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_versions_compare_versions_async.py index 1bbe51c5..99cc46b2 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_versions_compare_versions_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_versions_compare_versions_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Versions_CompareVersions_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_versions_compare_versions_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_versions_compare_versions_sync.py index fa23231a..8d990442 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_versions_compare_versions_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_versions_compare_versions_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Versions_CompareVersions_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_versions_create_version_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_versions_create_version_async.py index 9ce55ff6..c213de89 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_versions_create_version_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_versions_create_version_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Versions_CreateVersion_async] @@ -52,7 +52,7 @@ async def sample_create_version(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_versions_create_version_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_versions_create_version_sync.py index e511435b..4267ded7 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_versions_create_version_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_versions_create_version_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Versions_CreateVersion_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_versions_delete_version_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_versions_delete_version_async.py index b284bb23..96ae16c0 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_versions_delete_version_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_versions_delete_version_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Versions_DeleteVersion_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_versions_delete_version_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_versions_delete_version_sync.py index 6c52d22a..2e2c66c6 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_versions_delete_version_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_versions_delete_version_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Versions_DeleteVersion_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_versions_get_version_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_versions_get_version_async.py index 2000cc78..b2fff538 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_versions_get_version_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_versions_get_version_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Versions_GetVersion_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_versions_get_version_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_versions_get_version_sync.py index 79014dc8..adfc4432 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_versions_get_version_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_versions_get_version_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Versions_GetVersion_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_versions_list_versions_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_versions_list_versions_async.py index 90207b83..f8a05b5f 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_versions_list_versions_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_versions_list_versions_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Versions_ListVersions_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_versions_list_versions_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_versions_list_versions_sync.py index f5ddb17d..15e81f29 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_versions_list_versions_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_versions_list_versions_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Versions_ListVersions_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_versions_load_version_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_versions_load_version_async.py index 7bc338d5..d16c4667 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_versions_load_version_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_versions_load_version_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Versions_LoadVersion_async] @@ -48,7 +48,7 @@ async def sample_load_version(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_versions_load_version_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_versions_load_version_sync.py index 0c0cabc6..c803e2c9 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_versions_load_version_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_versions_load_version_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Versions_LoadVersion_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_versions_update_version_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_versions_update_version_async.py index a96f7e08..6da992e9 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_versions_update_version_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_versions_update_version_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Versions_UpdateVersion_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_versions_update_version_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_versions_update_version_sync.py index c2860cb9..64780925 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_versions_update_version_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_versions_update_version_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Versions_UpdateVersion_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_create_webhook_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_create_webhook_async.py index ec064ff9..d1608ed2 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_create_webhook_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_create_webhook_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Webhooks_CreateWebhook_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_create_webhook_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_create_webhook_sync.py index 48aa998d..e0f841d5 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_create_webhook_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_create_webhook_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Webhooks_CreateWebhook_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_delete_webhook_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_delete_webhook_async.py index 193a2ae0..34de0e9f 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_delete_webhook_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_delete_webhook_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Webhooks_DeleteWebhook_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_delete_webhook_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_delete_webhook_sync.py index b5eede66..3480ba1d 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_delete_webhook_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_delete_webhook_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Webhooks_DeleteWebhook_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_get_webhook_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_get_webhook_async.py index d400d2fa..f08c3c60 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_get_webhook_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_get_webhook_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Webhooks_GetWebhook_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_get_webhook_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_get_webhook_sync.py index 5d687c18..dd37505f 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_get_webhook_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_get_webhook_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Webhooks_GetWebhook_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_list_webhooks_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_list_webhooks_async.py index 1f8ed23c..e213beba 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_list_webhooks_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_list_webhooks_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Webhooks_ListWebhooks_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_list_webhooks_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_list_webhooks_sync.py index 4b9ece23..fc5098c8 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_list_webhooks_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_list_webhooks_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Webhooks_ListWebhooks_sync] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_update_webhook_async.py b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_update_webhook_async.py index 2dc571a5..972400d1 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_update_webhook_async.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_update_webhook_async.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Webhooks_UpdateWebhook_async] diff --git a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_update_webhook_sync.py b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_update_webhook_sync.py index d24798a2..3e9a031c 100644 --- a/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_update_webhook_sync.py +++ b/samples/generated_samples/dialogflow_v3beta1_generated_webhooks_update_webhook_sync.py @@ -20,7 +20,7 @@ # It may require modifications to work in your environment. # To install the latest published package dependency, execute the following: -# python3 -m pip install google-cloud-dialogflowcx +# python3 -m pip install google-cloud-dialogflow-cx # [START dialogflow_v3beta1_generated_Webhooks_UpdateWebhook_sync] diff --git a/samples/generated_samples/snippet_metadata_dialogflowcx_v3.json b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json similarity index 99% rename from samples/generated_samples/snippet_metadata_dialogflowcx_v3.json rename to samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json index b9729f9d..a1665584 100644 --- a/samples/generated_samples/snippet_metadata_dialogflowcx_v3.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json @@ -7,7 +7,8 @@ } ], "language": "PYTHON", - "name": "google-cloud-dialogflowcx" + "name": "google-cloud-dialogflow-cx", + "version": "1.14.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_dialogflowcx_v3beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json similarity index 99% rename from samples/generated_samples/snippet_metadata_dialogflowcx_v3beta1.json rename to samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json index 52e41730..9bd23dd8 100644 --- a/samples/generated_samples/snippet_metadata_dialogflowcx_v3beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json @@ -7,7 +7,8 @@ } ], "language": "PYTHON", - "name": "google-cloud-dialogflowcx" + "name": "google-cloud-dialogflow-cx", + "version": "1.14.0" }, "snippets": [ { diff --git a/samples/snippets/detect_intent_disabled_webhook.py b/samples/snippets/detect_intent_disabled_webhook.py index 356f7509..8e157199 100644 --- a/samples/snippets/detect_intent_disabled_webhook.py +++ b/samples/snippets/detect_intent_disabled_webhook.py @@ -66,12 +66,9 @@ def detect_intent_disabled_webhook( # Prepare request text_input = session.TextInput(text=text) - query_input = session.QueryInput( - text=text_input, - language_code=language_code - ) + query_input = session.QueryInput(text=text_input, language_code=language_code) query_params = session.QueryParameters( - disable_webhook=True, + disable_webhook=True, ) request = session.DetectIntentRequest( session=session_path, @@ -80,14 +77,16 @@ def detect_intent_disabled_webhook( ) response = session_client.detect_intent(request=request) - print(f'Detect Intent Request: {request.query_params.disable_webhook}') + print(f"Detect Intent Request: {request.query_params.disable_webhook}") response_text = [] for message in response.query_result.response_messages: if message.text: curr_response_text = message.text.text - print(f'Agent Response: {curr_response_text}') + print(f"Agent Response: {curr_response_text}") response_text.append(curr_response_text) return response_text + + # [END dialogflow_cx_detect_intent_with_disabled_webhook] diff --git a/samples/snippets/detect_intent_disabled_webhook_test.py b/samples/snippets/detect_intent_disabled_webhook_test.py index 780a424b..624dfd70 100644 --- a/samples/snippets/detect_intent_disabled_webhook_test.py +++ b/samples/snippets/detect_intent_disabled_webhook_test.py @@ -27,16 +27,16 @@ def test_detect_intent_positive(): response_text_list = detect_intent_disabled_webhook( PROJECT_ID, - 'global', + "global", AGENT_ID, - 'Perfect!', - 'en-us', + "Perfect!", + "en-us", ) for response_text in response_text_list: assert response_text[0] in [ - 'You are welcome!', - 'It\'s my pleasure.', - 'Anytime.', - 'Of course.', - 'It\'s my pleasure to serve you.', + "You are welcome!", + "It's my pleasure.", + "Anytime.", + "Of course.", + "It's my pleasure to serve you.", ] diff --git a/samples/snippets/detect_intent_event.py b/samples/snippets/detect_intent_event.py index 27207c83..211ff208 100644 --- a/samples/snippets/detect_intent_event.py +++ b/samples/snippets/detect_intent_event.py @@ -32,11 +32,11 @@ def run_sample(): # event = "YOUR-EVENT" # language_code = "YOUR-LANGUAGE-CODE" - project_id = 'dialogflow-cx-demo-1-348717' - location = 'global' - agent_id = '8caa6b47-5dd7-4380-b86e-ea4301d565b0' - event = 'sys.no-match-default' - language_code = 'en-us' + project_id = "dialogflow-cx-demo-1-348717" + location = "global" + agent_id = "8caa6b47-5dd7-4380-b86e-ea4301d565b0" + event = "sys.no-match-default" + language_code = "en-us" detect_intent_with_event_input( project_id, @@ -71,19 +71,18 @@ def detect_intent_with_event_input( # Construct detect intent request: event = session.EventInput(event=event) - query_input = session.QueryInput( - event=event, - language_code=language_code - ) + query_input = session.QueryInput(event=event, language_code=language_code) request = session.DetectIntentRequest( - session=session_path, - query_input=query_input, + session=session_path, + query_input=query_input, ) response = session_client.detect_intent(request=request) response_text = response.query_result.response_messages[0].text.text[0] - print(f'Response: {response_text}') + print(f"Response: {response_text}") return response_text + + # [END dialogflow_cx_v3_detect_intent_event_input_async] diff --git a/samples/snippets/detect_intent_event_test.py b/samples/snippets/detect_intent_event_test.py index bb95b493..5c0f0339 100644 --- a/samples/snippets/detect_intent_event_test.py +++ b/samples/snippets/detect_intent_event_test.py @@ -27,22 +27,22 @@ def test_detect_intent_positive(): response_text = detect_intent_with_event_input( PROJECT_ID, - 'global', + "global", AGENT_ID, - 'sys.no-match-default', - 'en-us', + "sys.no-match-default", + "en-us", ) assert response_text in [ - 'Can you say that again?', - 'I didn\'t get that. Can you repeat?', - 'I didn\'t get that. Can you say it again?', - 'I missed that, say that again?', - 'I missed what you said. What was that?', - 'One more time?', - 'Say that one more time?', - 'Sorry, can you say that again?', - 'Sorry, could you say that again?', - 'Sorry, I didn\'t get that. Can you rephrase?', - 'Sorry, what was that?', - 'What was that?', + "Can you say that again?", + "I didn't get that. Can you repeat?", + "I didn't get that. Can you say it again?", + "I missed that, say that again?", + "I missed what you said. What was that?", + "One more time?", + "Say that one more time?", + "Sorry, can you say that again?", + "Sorry, could you say that again?", + "Sorry, I didn't get that. Can you rephrase?", + "Sorry, what was that?", + "What was that?", ] diff --git a/samples/snippets/detect_intent_synthesize_tts_response.py b/samples/snippets/detect_intent_synthesize_tts_response.py index 8336568e..8d1c0e23 100644 --- a/samples/snippets/detect_intent_synthesize_tts_response.py +++ b/samples/snippets/detect_intent_synthesize_tts_response.py @@ -71,18 +71,14 @@ def detect_intent_synthesize_tts_response( session=session_id, ) text_input = session.TextInput(text=text) - query_input = session.QueryInput( - text=text_input, - language_code=language_code - ) + query_input = session.QueryInput(text=text_input, language_code=language_code) synthesize_speech_config = audio_config.SynthesizeSpeechConfig( - speaking_rate=1.25, - pitch=10.0, + speaking_rate=1.25, + pitch=10.0, ) output_audio_config = audio_config.OutputAudioConfig( - synthesize_speech_config=synthesize_speech_config, - audio_encoding=audio_config.OutputAudioEncoding[ - audio_encoding], + synthesize_speech_config=synthesize_speech_config, + audio_encoding=audio_config.OutputAudioEncoding[audio_encoding], ) request = session.DetectIntentRequest( session=session_path, @@ -92,14 +88,15 @@ def detect_intent_synthesize_tts_response( response = session_client.detect_intent(request=request) print( - 'Speaking Rate: ' - f'{response.output_audio_config.synthesize_speech_config.speaking_rate}') - print( - 'Pitch: ' - f'{response.output_audio_config.synthesize_speech_config.pitch}') - with open(output_file, 'wb') as fout: + "Speaking Rate: " + f"{response.output_audio_config.synthesize_speech_config.speaking_rate}" + ) + print("Pitch: " f"{response.output_audio_config.synthesize_speech_config.pitch}") + with open(output_file, "wb") as fout: fout.write(response.output_audio) - print(f'Audio content written to file: {output_file}') + print(f"Audio content written to file: {output_file}") + + # [END dialogflow_cx_v3_detect_intent_synthesize_tts_response_async] diff --git a/samples/snippets/detect_intent_synthesize_tts_response_test.py b/samples/snippets/detect_intent_synthesize_tts_response_test.py index f889abfb..61d4b0fa 100644 --- a/samples/snippets/detect_intent_synthesize_tts_response_test.py +++ b/samples/snippets/detect_intent_synthesize_tts_response_test.py @@ -30,12 +30,12 @@ def test_detect_intent_positive(capsys, tmp_path_factory): detect_intent_synthesize_tts_response( PROJECT_ID, - 'global', + "global", AGENT_ID, "Perfect!", - 'OUTPUT_AUDIO_ENCODING_LINEAR_16', + "OUTPUT_AUDIO_ENCODING_LINEAR_16", "en-us", output_file, ) out, _ = capsys.readouterr() - assert f'Audio content written to file: {output_file}' in out + assert f"Audio content written to file: {output_file}" in out diff --git a/samples/snippets/detect_intent_with_intent_input.py b/samples/snippets/detect_intent_with_intent_input.py index bc1194f6..05823fb1 100644 --- a/samples/snippets/detect_intent_with_intent_input.py +++ b/samples/snippets/detect_intent_with_intent_input.py @@ -73,10 +73,7 @@ def detect_intent_with_intent_input( ) intent = session.IntentInput(intent=intent_path) - query_input = session.QueryInput( - intent=intent, - language_code=language_code - ) + query_input = session.QueryInput(intent=intent, language_code=language_code) request = session.DetectIntentRequest( session=session_path, query_input=query_input, @@ -88,6 +85,8 @@ def detect_intent_with_intent_input( response_text.append(response_message.text.text) print(response_message.text.text) return response_text + + # [END dialogflow_cx_v3_detect_intent_with_intent_input_async] diff --git a/samples/snippets/detect_intent_with_intent_input_test.py b/samples/snippets/detect_intent_with_intent_input_test.py index 5a14e918..5681254e 100644 --- a/samples/snippets/detect_intent_with_intent_input_test.py +++ b/samples/snippets/detect_intent_with_intent_input_test.py @@ -28,7 +28,7 @@ def test_detect_intent_with_intent_input(): response_text = detect_intent_with_intent_input( PROJECT_ID, - 'global', + "global", AGENT_ID, INTENT_ID, "en-us", diff --git a/samples/snippets/detect_intent_with_sentiment_analysis.py b/samples/snippets/detect_intent_with_sentiment_analysis.py index 166a9900..0f7103a6 100644 --- a/samples/snippets/detect_intent_with_sentiment_analysis.py +++ b/samples/snippets/detect_intent_with_sentiment_analysis.py @@ -66,12 +66,9 @@ def detect_intent_with_sentiment_analysis( ) text_input = session.TextInput(text=text) - query_input = session.QueryInput( - text=text_input, - language_code=language_code - ) + query_input = session.QueryInput(text=text_input, language_code=language_code) query_params = session.QueryParameters( - analyze_query_text_sentiment=True, + analyze_query_text_sentiment=True, ) request = session.DetectIntentRequest( session=session_path, @@ -81,9 +78,10 @@ def detect_intent_with_sentiment_analysis( response = session_client.detect_intent(request=request) score = response.query_result.sentiment_analysis_result.score - print('Sentiment Score: {score}') + print("Sentiment Score: {score}") return score + # [END dialogflow_cx_v3_detect_intent_sentiment_analysis_async] diff --git a/samples/snippets/detect_intent_with_sentiment_analysis_test.py b/samples/snippets/detect_intent_with_sentiment_analysis_test.py index 73941243..47ae758f 100644 --- a/samples/snippets/detect_intent_with_sentiment_analysis_test.py +++ b/samples/snippets/detect_intent_with_sentiment_analysis_test.py @@ -28,13 +28,13 @@ @pytest.mark.parametrize( "text, expected_score_min, expected_score_max", - (['Perfect', .5, 1], ['I am not happy', -1, -.5]) + (["Perfect", 0.5, 1], ["I am not happy", -1, -0.5]), ) def test_detect_intent_positive(text, expected_score_min, expected_score_max): score = detect_intent_with_sentiment_analysis( PROJECT_ID, - 'global', + "global", AGENT_ID, text, "en-us", diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index 0398d72f..e8283c38 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -18,7 +18,7 @@ import os from pathlib import Path import sys -from typing import Callable, Dict, List, Optional +from typing import Callable, Dict, Optional import nox @@ -109,22 +109,6 @@ def get_pytest_env_vars() -> Dict[str, str]: # -def _determine_local_import_names(start_dir: str) -> List[str]: - """Determines all import names that should be considered "local". - - This is used when running the linter to insure that import order is - properly checked. - """ - file_ext_pairs = [os.path.splitext(path) for path in os.listdir(start_dir)] - return [ - basename - for basename, extension in file_ext_pairs - if extension == ".py" - or os.path.isdir(os.path.join(start_dir, basename)) - and basename not in ("__pycache__") - ] - - # Linting with flake8. # # We ignore the following rules: @@ -139,7 +123,6 @@ def _determine_local_import_names(start_dir: str) -> List[str]: "--show-source", "--builtin=gettext", "--max-complexity=20", - "--import-order-style=google", "--exclude=.nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py", "--ignore=E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I202", "--max-line-length=88", @@ -149,14 +132,11 @@ def _determine_local_import_names(start_dir: str) -> List[str]: @nox.session def lint(session: nox.sessions.Session) -> None: if not TEST_CONFIG["enforce_type_hints"]: - session.install("flake8", "flake8-import-order") + session.install("flake8") else: - session.install("flake8", "flake8-import-order", "flake8-annotations") + session.install("flake8", "flake8-annotations") - local_names = _determine_local_import_names(".") args = FLAKE8_COMMON_ARGS + [ - "--application-import-names", - ",".join(local_names), ".", ] session.run("flake8", *args) @@ -180,6 +160,7 @@ def blacken(session: nox.sessions.Session) -> None: # format = isort + black # + @nox.session def format(session: nox.sessions.Session) -> None: """ @@ -207,7 +188,9 @@ def _session_tests( session: nox.sessions.Session, post_install: Callable = None ) -> None: # check for presence of tests - test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True) + test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob( + "**/test_*.py", recursive=True + ) test_list.extend(glob.glob("**/tests", recursive=True)) if len(test_list) == 0: @@ -229,9 +212,7 @@ def _session_tests( if os.path.exists("requirements-test.txt"): if os.path.exists("constraints-test.txt"): - session.install( - "-r", "requirements-test.txt", "-c", "constraints-test.txt" - ) + session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt") else: session.install("-r", "requirements-test.txt") with open("requirements-test.txt") as rtfile: @@ -244,9 +225,9 @@ def _session_tests( post_install(session) if "pytest-parallel" in packages: - concurrent_args.extend(['--workers', 'auto', '--tests-per-worker', 'auto']) + concurrent_args.extend(["--workers", "auto", "--tests-per-worker", "auto"]) elif "pytest-xdist" in packages: - concurrent_args.extend(['-n', 'auto']) + concurrent_args.extend(["-n", "auto"]) session.run( "pytest", @@ -276,7 +257,7 @@ def py(session: nox.sessions.Session) -> None: def _get_repo_root() -> Optional[str]: - """ Returns the root folder of the project. """ + """Returns the root folder of the project.""" # Get root of this repository. Assume we don't have directories nested deeper than 10 items. p = Path(os.getcwd()) for i in range(10): diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 35e6605b..26afa0f9 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-dialogflow-cx==1.13.4 +google-cloud-dialogflow-cx==1.13.5 Flask==2.2.2 diff --git a/samples/snippets/streaming_detect_intent_partial_response.py b/samples/snippets/streaming_detect_intent_partial_response.py index cd96fce6..29b8ffdf 100644 --- a/samples/snippets/streaming_detect_intent_partial_response.py +++ b/samples/snippets/streaming_detect_intent_partial_response.py @@ -29,9 +29,9 @@ def run_sample(): location = "YOUR-LOCATION-ID" agent_id = "YOUR-AGENT-ID" audio_file_name = "YOUR-AUDIO-FILE-PATH" - encoding = 'AUDIO_ENCODING_LINEAR_16' + encoding = "AUDIO_ENCODING_LINEAR_16" sample_rate_hertz = 16000 - language_code = 'en' + language_code = "en" streaming_detect_intent_partial_response( project_id, @@ -93,16 +93,16 @@ def request_generator(): break # The later requests contains audio data. audio_input = session.AudioInput(audio=chunk, config=config) - query_input = session.QueryInput(audio=audio_input, language_code=language_code) + query_input = session.QueryInput( + audio=audio_input, language_code=language_code + ) yield session.StreamingDetectIntentRequest( session=session_path, query_input=query_input, enable_partial_response=True, ) - responses = session_client.streaming_detect_intent( - requests=request_generator() - ) + responses = session_client.streaming_detect_intent(requests=request_generator()) print("=" * 20) for response in responses: @@ -116,6 +116,8 @@ def request_generator(): " ".join(msg.text.text) for msg in response.query_result.response_messages ] print(f"Response text: {' '.join(response_messages)}\n") + + # [END dialogflow_cx_streaming_detect_intent_enable_partial_response] diff --git a/samples/snippets/streaming_detect_intent_partial_response_test.py b/samples/snippets/streaming_detect_intent_partial_response_test.py index 63bfdd44..c773e105 100644 --- a/samples/snippets/streaming_detect_intent_partial_response_test.py +++ b/samples/snippets/streaming_detect_intent_partial_response_test.py @@ -17,7 +17,9 @@ import os -from streaming_detect_intent_partial_response import streaming_detect_intent_partial_response +from streaming_detect_intent_partial_response import ( + streaming_detect_intent_partial_response, +) DIRNAME = os.path.realpath(os.path.dirname(__file__)) @@ -29,17 +31,17 @@ def test_streaming_detect_intent_partial_response(capsys): - encoding = 'AUDIO_ENCODING_LINEAR_16' + encoding = "AUDIO_ENCODING_LINEAR_16" sample_rate_hertz = 24000 streaming_detect_intent_partial_response( - PROJECT_ID, - 'global', - AGENT_ID, - AUDIO, - encoding, - sample_rate_hertz, - "en-US", + PROJECT_ID, + "global", + AGENT_ID, + AUDIO, + encoding, + sample_rate_hertz, + "en-US", ) out, _ = capsys.readouterr() diff --git a/samples/snippets/webhook.py b/samples/snippets/webhook.py index 516000cd..4a75f8dd 100644 --- a/samples/snippets/webhook.py +++ b/samples/snippets/webhook.py @@ -33,21 +33,10 @@ def handle_webhook(request): # You can also use the google.cloud.dialogflowcx_v3.types.WebhookRequest protos instead of manually writing the json object # Please see https://googleapis.dev/python/dialogflow/latest/dialogflow_v2/types.html?highlight=webhookresponse#google.cloud.dialogflow_v2.types.WebhookResponse for an overview - res = { - "fulfillment_response": { - "messages": [ - { - "text": { - "text": [ - text - ] - } - } - ] - } - } + res = {"fulfillment_response": {"messages": [{"text": {"text": [text]}}]}} # Returns json return res + # [END dialogflow_cx_webhook] diff --git a/samples/snippets/webhook_log_session_info.py b/samples/snippets/webhook_log_session_info.py index 64492700..d309c9ec 100644 --- a/samples/snippets/webhook_log_session_info.py +++ b/samples/snippets/webhook_log_session_info.py @@ -34,11 +34,7 @@ def log_session_id_for_troubleshooting(request): # Return a generic response res = { "fulfillment_response": { - "messages": [{ - "text": { - "text": [f"Request Session ID: {session_id}"] - } - }] + "messages": [{"text": {"text": [f"Request Session ID: {session_id}"]}}] } } diff --git a/samples/snippets/webhook_prebuilt_telecom.py b/samples/snippets/webhook_prebuilt_telecom.py index b6536480..c786ef17 100644 --- a/samples/snippets/webhook_prebuilt_telecom.py +++ b/samples/snippets/webhook_prebuilt_telecom.py @@ -18,7 +18,7 @@ def cxPrebuiltAgentsTelecom(request): - logging.info('Cloud Function:' + 'Invoked cloud function from Dialogflow') + logging.info("Cloud Function:" + "Invoked cloud function from Dialogflow") request_dict = request.get_json() # Get the parameters in current page @@ -32,8 +32,8 @@ def cxPrebuiltAgentsTelecom(request): tag = request_dict["fulfillmentInfo"]["tag"] # BEGIN detectCustomerAnomaly - if tag == 'detectCustomerAnomaly': - logging.info(tag + ' was triggered.') + if tag == "detectCustomerAnomaly": + logging.info(tag + " was triggered.") phone_number = parameter_dict["phone_number"] bill_state = parameter_dict["bill_state"] parameters = copy.deepcopy(parameter_dict) @@ -54,7 +54,7 @@ def cxPrebuiltAgentsTelecom(request): # December, December 1st, November # Only 999999 will have anomaly detection - if str(phone_number) == '999999': + if str(phone_number) == "999999": anomaly_detect = "true" product_line = "phone" purchase = "device protection" @@ -63,9 +63,9 @@ def cxPrebuiltAgentsTelecom(request): updated_parameters["last_month"] = last_month_name # If bill hike amount is given - we just add it to the total bill - if 'bill_amount' in parameters: - bill_amount = parameters['bill_amount'] - purchase_amount = bill_amount['amount'] + if "bill_amount" in parameters: + bill_amount = parameters["bill_amount"] + purchase_amount = bill_amount["amount"] total_bill_amount = 54.34 + purchase_amount # Adding the updated session parameters to the new parameters json @@ -76,20 +76,16 @@ def cxPrebuiltAgentsTelecom(request): updated_parameters["total_bill"] = total_bill_amount updated_parameters["first_month"] = first_of_month - res = { - "sessionInfo": { - "parameters": updated_parameters - } - } + res = {"sessionInfo": {"parameters": updated_parameters}} # BEGIN validatePhoneLine - elif tag == 'validatePhoneLine': - logging.info(tag + ' was triggered.') + elif tag == "validatePhoneLine": + logging.info(tag + " was triggered.") phone = parameter_dict["phone_number"] - phone_line_verified = 'false' + phone_line_verified = "false" line_index = None - domestic_coverage = 'false' - covered_lines = ['5555555555', '5105105100', '1231231234', '9999999999'] + domestic_coverage = "false" + covered_lines = ["5555555555", "5105105100", "1231231234", "9999999999"] # Loop over the covered lines array for index, line in enumerate(covered_lines): @@ -97,101 +93,119 @@ def cxPrebuiltAgentsTelecom(request): # included in the string. when true, update the line_index variable if phone == line: line_index = index - logging.info('This is the index ' + str(line_index)) + logging.info("This is the index " + str(line_index)) # Only 9999999999 will fail if line_index == 3: - phone_line_verified = 'false' + phone_line_verified = "false" else: - phone_line_verified = 'true' + phone_line_verified = "true" # Only 1231231234 will have domestic coverage if line_index == 2: - domestic_coverage = 'true' + domestic_coverage = "true" else: - domestic_coverage = 'false' + domestic_coverage = "false" res = { "sessionInfo": { "parameters": { "phone_line_verified": phone_line_verified, - "domestic_coverage": domestic_coverage + "domestic_coverage": domestic_coverage, } } } # BEGIN cruisePlanCoverage - elif tag == 'cruisePlanCoverage': - logging.info(tag + ' was triggered.') + elif tag == "cruisePlanCoverage": + logging.info(tag + " was triggered.") port = parameter_dict["destination"] port_is_covered = None # Sample list of covered cruise ports. covered_ports = [ - 'mexico', - 'canada', - 'anguilla', + "mexico", + "canada", + "anguilla", ] if port.lower() in covered_ports: - port_is_covered = 'true' + port_is_covered = "true" else: - port_is_covered = 'false' + port_is_covered = "false" res = { "sessionInfo": { "parameters": { "port_is_covered": port_is_covered, - } } } + } # BEGIN internationalCoverage - elif tag == 'internationalCoverage': - logging.info(tag + ' was triggered.') + elif tag == "internationalCoverage": + logging.info(tag + " was triggered.") destination = parameter_dict["destination"] coverage = None # Sample list of covered international monthly destinations. covered_by_monthly = [ - 'anguilla', - 'australia', - 'brazil', - 'canada', - 'chile', - 'england', - 'france', - 'india', - 'japan', - 'mexico', - 'russia', - 'singapore', + "anguilla", + "australia", + "brazil", + "canada", + "chile", + "england", + "france", + "india", + "japan", + "mexico", + "russia", + "singapore", ] # Sample list of covered international daily destinations. covered_by_daily = [ - 'anguilla', 'australia', 'brazil', 'canada', 'chile', 'england', - 'france', 'india', 'japan', 'mexico', 'singapore' + "anguilla", + "australia", + "brazil", + "canada", + "chile", + "england", + "france", + "india", + "japan", + "mexico", + "singapore", ] - if destination.lower() in covered_by_monthly and destination.lower() in covered_by_daily: - coverage = 'both' - elif destination.lower() in covered_by_monthly and destination.lower() not in covered_by_daily: - coverage = 'monthly_only' - elif destination.lower() not in covered_by_monthly and destination.lower() not in covered_by_daily: - coverage = 'neither' + if ( + destination.lower() in covered_by_monthly + and destination.lower() in covered_by_daily + ): + coverage = "both" + elif ( + destination.lower() in covered_by_monthly + and destination.lower() not in covered_by_daily + ): + coverage = "monthly_only" + elif ( + destination.lower() not in covered_by_monthly + and destination.lower() not in covered_by_daily + ): + coverage = "neither" else: # This should never happen, because covered_by_daily is a subset of # covered_by_monthly - coverage = 'daily_only' + coverage = "daily_only" res = { "sessionInfo": { "parameters": { "coverage": coverage, - } } } + } # BEGIN cheapestPlan - elif tag == 'cheapestPlan': - logging.info(tag + ' was triggered.') + elif tag == "cheapestPlan": + logging.info(tag + " was triggered.") trip_duration = parameter_dict["trip_duration"] monthly_cost = None daily_cost = None @@ -204,7 +218,7 @@ def cxPrebuiltAgentsTelecom(request): if trip_duration > 30: monthly_cost = (int(trip_duration / 30)) * 70 daily_cost = trip_duration * 10 - suggested_plan = 'monthly' + suggested_plan = "monthly" # When trip is <= 30 days, but greater than 6 days, calculate monthly # plan cost and daily plan cost. Suggest monthly b/c it is the cheaper @@ -212,29 +226,29 @@ def cxPrebuiltAgentsTelecom(request): elif trip_duration <= 30 and trip_duration > 6: monthly_cost = 70 daily_cost = trip_duration * 10 - suggested_plan = 'monthly' + suggested_plan = "monthly" # When trip is <= 6 days, calculate daily plan cost. Suggest daily # plan. elif trip_duration <= 6 and trip_duration > 0: monthly_cost = 70 daily_cost = trip_duration * 10 - suggested_plan = 'daily' + suggested_plan = "daily" else: # This should never happen b/c trip_duration would have to be # negative - suggested_plan = 'null' + suggested_plan = "null" res = { "sessionInfo": { "parameters": { - "monthly_cost": monthly_cost, - "daily_cost": daily_cost, - "suggested_plan": suggested_plan, - } + "monthly_cost": monthly_cost, + "daily_cost": daily_cost, + "suggested_plan": suggested_plan, } } + } # Default Case else: @@ -250,7 +264,20 @@ def cxPrebuiltAgentsTelecom(request): def get_date_details(bill_state): from datetime import date - monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] + monthNames = [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December", + ] today = date.today() # index starts with 0 first_month_name = monthNames[today.month - 1] @@ -260,8 +287,10 @@ def get_date_details(bill_state): last_month_name = monthNames[today.month - 2] last_month_first_day_str = str(today.replace(day=1, month=(today.month - 1))) second_last_month_name = monthNames[today.month - 3] - if bill_state == 'current': + if bill_state == "current": return [first_month_name, first_day_str, last_month_name] else: return [last_month_name, last_month_first_day_str, second_last_month_name] + + # [END dialogflow_cx_v3_webhook_prebuilt_telecom] diff --git a/samples/snippets/webhook_prebuilt_telecom_test.py b/samples/snippets/webhook_prebuilt_telecom_test.py index 1f20d5ec..4a627930 100644 --- a/samples/snippets/webhook_prebuilt_telecom_test.py +++ b/samples/snippets/webhook_prebuilt_telecom_test.py @@ -30,19 +30,27 @@ def test_detect_customeranomaly_current(app): from datetime import date - request = {"fulfillmentInfo": {"tag": "detectCustomerAnomaly"}, - "pageInfo": {"formInfo": {"parameterInfo": [ - {"displayName": "phone_number", "value": 999999}, - {"displayName": "bill_state", "value": "current"}, - {"displayName": "bill_amount", "value": {"amount": 1000}}, - ]}}} + request = { + "fulfillmentInfo": {"tag": "detectCustomerAnomaly"}, + "pageInfo": { + "formInfo": { + "parameterInfo": [ + {"displayName": "phone_number", "value": 999999}, + {"displayName": "bill_state", "value": "current"}, + {"displayName": "bill_amount", "value": {"amount": 1000}}, + ] + } + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) print(res) - assert res["sessionInfo"]["parameters"]["anomaly_detect"] == 'true' + assert res["sessionInfo"]["parameters"]["anomaly_detect"] == "true" assert res["sessionInfo"]["parameters"]["total_bill"] == 1054.34 - assert res["sessionInfo"]["parameters"]["first_month"] == str(date.today().replace(day=1)) + assert res["sessionInfo"]["parameters"]["first_month"] == str( + date.today().replace(day=1) + ) def test_detect_customeranomaly_other(app): @@ -50,177 +58,267 @@ def test_detect_customeranomaly_other(app): from datetime import date - request = {"fulfillmentInfo": {"tag": "detectCustomerAnomaly"}, - "pageInfo": {"formInfo": {"parameterInfo": [ - {"displayName": "phone_number", "value": 8231234789}, - {"displayName": "bill_state", "value": "other situation"}, - {"displayName": "bill_amount", "value": {"amount": 1000}}, - ]}}} + request = { + "fulfillmentInfo": {"tag": "detectCustomerAnomaly"}, + "pageInfo": { + "formInfo": { + "parameterInfo": [ + {"displayName": "phone_number", "value": 8231234789}, + {"displayName": "bill_state", "value": "other situation"}, + {"displayName": "bill_amount", "value": {"amount": 1000}}, + ] + } + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) print(res) today = date.today() - assert res["sessionInfo"]["parameters"]["anomaly_detect"] == 'false' + assert res["sessionInfo"]["parameters"]["anomaly_detect"] == "false" assert res["sessionInfo"]["parameters"]["total_bill"] == 1054.34 - assert res["sessionInfo"]["parameters"]["first_month"] == str(today.replace(day=1, month=(today.month - 1))) + assert res["sessionInfo"]["parameters"]["first_month"] == str( + today.replace(day=1, month=(today.month - 1)) + ) def test_validate_phoneline(app): """Parameterized test for validate form parameter webhook snippet.""" - request = {"fulfillmentInfo": {"tag": "validatePhoneLine"}, - "pageInfo": {"formInfo": {"parameterInfo": [{"displayName": "phone_number", "value": '5105105100'}]}}} + request = { + "fulfillmentInfo": {"tag": "validatePhoneLine"}, + "pageInfo": { + "formInfo": { + "parameterInfo": [ + {"displayName": "phone_number", "value": "5105105100"} + ] + } + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) print(res) - assert res["sessionInfo"]["parameters"]["phone_line_verified"] == 'true' + assert res["sessionInfo"]["parameters"]["phone_line_verified"] == "true" def test_invalid_phoneline(app): """Parameterized test for validate form parameter webhook snippet.""" - request = {"fulfillmentInfo": {"tag": "validatePhoneLine"}, - "pageInfo": {"formInfo": {"parameterInfo": [{"displayName": "phone_number", "value": '9999999999'}]}}} + request = { + "fulfillmentInfo": {"tag": "validatePhoneLine"}, + "pageInfo": { + "formInfo": { + "parameterInfo": [ + {"displayName": "phone_number", "value": "9999999999"} + ] + } + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) print(res) - assert res["sessionInfo"]["parameters"]["phone_line_verified"] == 'false' + assert res["sessionInfo"]["parameters"]["phone_line_verified"] == "false" def test_invalid_phoneline2(app): """Parameterized test for validate form parameter webhook snippet.""" - request = {"fulfillmentInfo": {"tag": "validatePhoneLine"}, - "pageInfo": {"formInfo": {"parameterInfo": [{"displayName": "phone_number", "value": '1231231234'}]}}} + request = { + "fulfillmentInfo": {"tag": "validatePhoneLine"}, + "pageInfo": { + "formInfo": { + "parameterInfo": [ + {"displayName": "phone_number", "value": "1231231234"} + ] + } + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) print(res) - assert res["sessionInfo"]["parameters"]["domestic_coverage"] == 'true' + assert res["sessionInfo"]["parameters"]["domestic_coverage"] == "true" def test_cruiseplan_coverage(app): """Parameterized test for cruise plan coverage webhook snippet.""" - request = {"fulfillmentInfo": {"tag": "cruisePlanCoverage"}, - "pageInfo": {"formInfo": {"parameterInfo": [{"displayName": "destination", "value": 'mexico'}]}}} + request = { + "fulfillmentInfo": {"tag": "cruisePlanCoverage"}, + "pageInfo": { + "formInfo": { + "parameterInfo": [{"displayName": "destination", "value": "mexico"}] + } + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) print(res) - assert res["sessionInfo"]["parameters"]["port_is_covered"] == 'true' + assert res["sessionInfo"]["parameters"]["port_is_covered"] == "true" def test_cruiseplan_notcovered(app): """Parameterized test for cruise plan coverage webhook snippet.""" - request = {"fulfillmentInfo": {"tag": "cruisePlanCoverage"}, - "pageInfo": {"formInfo": {"parameterInfo": [{"displayName": "destination", "value": 'china'}]}}} + request = { + "fulfillmentInfo": {"tag": "cruisePlanCoverage"}, + "pageInfo": { + "formInfo": { + "parameterInfo": [{"displayName": "destination", "value": "china"}] + } + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) print(res) - assert res["sessionInfo"]["parameters"]["port_is_covered"] == 'false' + assert res["sessionInfo"]["parameters"]["port_is_covered"] == "false" def test_international_coverage1(app): """Parameterized test for international coverage webhook snippet.""" - request = {"fulfillmentInfo": {"tag": "internationalCoverage"}, - "pageInfo": {"formInfo": {"parameterInfo": [{"displayName": "destination", "value": 'singapore'}]}}} + request = { + "fulfillmentInfo": {"tag": "internationalCoverage"}, + "pageInfo": { + "formInfo": { + "parameterInfo": [{"displayName": "destination", "value": "singapore"}] + } + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) print(res) - assert res["sessionInfo"]["parameters"]["coverage"] == 'both' + assert res["sessionInfo"]["parameters"]["coverage"] == "both" def test_international_coverage2(app): """Parameterized test for international coverage webhook snippet.""" - request = {"fulfillmentInfo": {"tag": "internationalCoverage"}, - "pageInfo": {"formInfo": {"parameterInfo": [{"displayName": "destination", "value": 'russia'}]}}} + request = { + "fulfillmentInfo": {"tag": "internationalCoverage"}, + "pageInfo": { + "formInfo": { + "parameterInfo": [{"displayName": "destination", "value": "russia"}] + } + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) print(res) - assert res["sessionInfo"]["parameters"]["coverage"] == 'monthly_only' + assert res["sessionInfo"]["parameters"]["coverage"] == "monthly_only" def test_international_coverage3(app): """Parameterized test for international coverage webhook snippet.""" - request = {"fulfillmentInfo": {"tag": "internationalCoverage"}, - "pageInfo": {"formInfo": {"parameterInfo": [{"displayName": "destination", "value": 'china'}]}}} + request = { + "fulfillmentInfo": {"tag": "internationalCoverage"}, + "pageInfo": { + "formInfo": { + "parameterInfo": [{"displayName": "destination", "value": "china"}] + } + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) print(res) - assert res["sessionInfo"]["parameters"]["coverage"] == 'neither' + assert res["sessionInfo"]["parameters"]["coverage"] == "neither" def test_cheapest_plan1(app): """Parameterized test for international coverage webhook snippet.""" - request = {"fulfillmentInfo": {"tag": "cheapestPlan"}, - "pageInfo": {"formInfo": {"parameterInfo": [{"displayName": "trip_duration", "value": 40}]}}} + request = { + "fulfillmentInfo": {"tag": "cheapestPlan"}, + "pageInfo": { + "formInfo": { + "parameterInfo": [{"displayName": "trip_duration", "value": 40}] + } + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) print(res) assert res["sessionInfo"]["parameters"]["monthly_cost"] == 70 assert res["sessionInfo"]["parameters"]["daily_cost"] == 400 - assert res["sessionInfo"]["parameters"]["suggested_plan"] == 'monthly' + assert res["sessionInfo"]["parameters"]["suggested_plan"] == "monthly" def test_cheapest_plan2(app): """Parameterized test for international coverage webhook snippet.""" - request = {"fulfillmentInfo": {"tag": "cheapestPlan"}, - "pageInfo": {"formInfo": {"parameterInfo": [{"displayName": "trip_duration", "value": 20}]}}} + request = { + "fulfillmentInfo": {"tag": "cheapestPlan"}, + "pageInfo": { + "formInfo": { + "parameterInfo": [{"displayName": "trip_duration", "value": 20}] + } + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) print(res) assert res["sessionInfo"]["parameters"]["monthly_cost"] == 70 assert res["sessionInfo"]["parameters"]["daily_cost"] == 200 - assert res["sessionInfo"]["parameters"]["suggested_plan"] == 'monthly' + assert res["sessionInfo"]["parameters"]["suggested_plan"] == "monthly" def test_cheapest_plan3(app): """Parameterized test for international coverage webhook snippet.""" - request = {"fulfillmentInfo": {"tag": "cheapestPlan"}, - "pageInfo": {"formInfo": {"parameterInfo": [{"displayName": "trip_duration", "value": 5}]}}} + request = { + "fulfillmentInfo": {"tag": "cheapestPlan"}, + "pageInfo": { + "formInfo": { + "parameterInfo": [{"displayName": "trip_duration", "value": 5}] + } + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) print(res) assert res["sessionInfo"]["parameters"]["monthly_cost"] == 70 assert res["sessionInfo"]["parameters"]["daily_cost"] == 50 - assert res["sessionInfo"]["parameters"]["suggested_plan"] == 'daily' + assert res["sessionInfo"]["parameters"]["suggested_plan"] == "daily" def test_cheapest_plan4(app): """Invalid Case: This happens only when customer enters a negative number""" - request = {"fulfillmentInfo": {"tag": "cheapestPlan"}, - "pageInfo": {"formInfo": {"parameterInfo": [{"displayName": "trip_duration", "value": -1}]}}} + request = { + "fulfillmentInfo": {"tag": "cheapestPlan"}, + "pageInfo": { + "formInfo": { + "parameterInfo": [{"displayName": "trip_duration", "value": -1}] + } + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) print(res) - assert res["sessionInfo"]["parameters"]["suggested_plan"] == 'null' + assert res["sessionInfo"]["parameters"]["suggested_plan"] == "null" def test_default_tag(app): """Default Case.""" - request = {"fulfillmentInfo": {"tag": None}, - "pageInfo": {"formInfo": {"parameterInfo": [{"displayName": None, "value": None}]}}} + request = { + "fulfillmentInfo": {"tag": None}, + "pageInfo": { + "formInfo": {"parameterInfo": [{"displayName": None, "value": None}]} + }, + } with app.test_request_context(json=request): res = cxPrebuiltAgentsTelecom(flask.request) diff --git a/samples/snippets/webhook_validate_form_parameter.py b/samples/snippets/webhook_validate_form_parameter.py index 026f979f..5e2574fc 100644 --- a/samples/snippets/webhook_validate_form_parameter.py +++ b/samples/snippets/webhook_validate_form_parameter.py @@ -17,6 +17,7 @@ # [START dialogflow_cx_v3_webhook_validate_form_parameter] + def validate_parameter(request): """Webhook will validate or invalidate parameter based on logic configured by the user.""" return { @@ -24,9 +25,9 @@ def validate_parameter(request): "form_info": { "parameter_info": [ { - "displayName": 'orderNumber', + "displayName": "orderNumber", "required": True, - "state": 'INVALID', + "state": "INVALID", "value": 123, }, ], @@ -40,4 +41,5 @@ def validate_parameter(request): }, } + # [END dialogflow_cx_v3_webhook_validate_form_parameter] diff --git a/samples/snippets/webhook_validate_form_parameter_test.py b/samples/snippets/webhook_validate_form_parameter_test.py index ff33a893..8a29f5eb 100644 --- a/samples/snippets/webhook_validate_form_parameter_test.py +++ b/samples/snippets/webhook_validate_form_parameter_test.py @@ -32,7 +32,4 @@ def test_validate_parameter(app): with app.test_request_context(json=request): res = validate_parameter(flask.request) - assert ( - res["page_info"]["form_info"]["parameter_info"][0]["state"] - == 'INVALID' - ) + assert res["page_info"]["form_info"]["parameter_info"][0]["state"] == "INVALID" diff --git a/setup.py b/setup.py index b3395a96..b19381e3 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- - -# Copyright (C) 2019 Google LLC +# 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. @@ -14,12 +13,36 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import io import os + import setuptools # type: ignore -version = "1.13.5" +package_root = os.path.abspath(os.path.dirname(__file__)) + +name = "google-cloud-dialogflow-cx" + + +description = "Google Cloud Dialogflow Cx API client library" + +version = {} +with open( + os.path.join(package_root, "google/cloud/dialogflowcx/gapic_version.py") +) as fp: + exec(fp.read(), version) +version = version["__version__"] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + +dependencies = [ + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", + "proto-plus >= 1.22.0, <2.0.0dev", + "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", +] +url = "https://github.com/googleapis/python-dialogflow-cx" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -27,40 +50,43 @@ with io.open(readme_filename, encoding="utf-8") as readme_file: readme = readme_file.read() +packages = [ + package + for package in setuptools.PEP420PackageFinder.find() + if package.startswith("google") +] + +namespaces = ["google"] +if "google.cloud" in packages: + namespaces.append("google.cloud") setuptools.setup( - name="google-cloud-dialogflow-cx", + name=name, version=version, + description=description, long_description=readme, author="Google LLC", author_email="googleapis-packages@google.com", license="Apache 2.0", - url="https://github.com/googleapis/python-dialogflow-cx", - packages=[ - package - for package in setuptools.PEP420PackageFinder.find() - if package.startswith("google") - ], - namespace_packages=("google", "google.cloud"), - platforms="Posix; MacOS X; Windows", - include_package_data=True, - install_requires=( - "google-api-core[grpc] >= 1.32.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", - "proto-plus >= 1.22.0, <2.0.0dev", - "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", - ), - python_requires=">=3.6", + url=url, classifiers=[ - "Development Status :: 5 - Production/Stable", + release_status, "Intended Audience :: Developers", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3.6", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Operating System :: OS Independent", "Topic :: Internet", - "Topic :: Software Development :: Libraries :: Python Modules", ], + platforms="Posix; MacOS X; Windows", + packages=packages, + python_requires=">=3.7", + namespace_packages=namespaces, + install_requires=dependencies, + include_package_data=True, zip_safe=False, ) diff --git a/testing/constraints-3.10.txt b/testing/constraints-3.10.txt index e69de29b..ed7f9aed 100644 --- a/testing/constraints-3.10.txt +++ b/testing/constraints-3.10.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/testing/constraints-3.11.txt b/testing/constraints-3.11.txt index e69de29b..ed7f9aed 100644 --- a/testing/constraints-3.11.txt +++ b/testing/constraints-3.11.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index 5dcaa6fd..6c44adfe 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -1,10 +1,9 @@ # This constraints file is used to check that lower bounds # are correct in setup.py -# List *all* library dependencies and extras in this file. +# List all library dependencies and extras in this file. # Pin the version to the lower bound. -# -# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", -# Then this file should have foo==1.14.0 -google-api-core==1.32.0 +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.0 proto-plus==1.22.0 protobuf==3.19.5 diff --git a/testing/constraints-3.8.txt b/testing/constraints-3.8.txt index e69de29b..ed7f9aed 100644 --- a/testing/constraints-3.8.txt +++ b/testing/constraints-3.8.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/testing/constraints-3.9.txt b/testing/constraints-3.9.txt index e69de29b..ed7f9aed 100644 --- a/testing/constraints-3.9.txt +++ b/testing/constraints-3.9.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/tests/unit/gapic/dialogflowcx_v3/test_agents.py b/tests/unit/gapic/dialogflowcx_v3/test_agents.py index 3a24092c..f08ef1ea 100644 --- a/tests/unit/gapic/dialogflowcx_v3/test_agents.py +++ b/tests/unit/gapic/dialogflowcx_v3/test_agents.py @@ -52,6 +52,7 @@ from google.cloud.location import locations_pb2 from google.longrunning import operations_pb2 from google.oauth2 import service_account +from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import struct_pb2 # type: ignore import google.auth diff --git a/tests/unit/gapic/dialogflowcx_v3/test_flows.py b/tests/unit/gapic/dialogflowcx_v3/test_flows.py index e3cd3b05..b9d7753b 100644 --- a/tests/unit/gapic/dialogflowcx_v3/test_flows.py +++ b/tests/unit/gapic/dialogflowcx_v3/test_flows.py @@ -54,6 +54,7 @@ from google.cloud.location import locations_pb2 from google.longrunning import operations_pb2 from google.oauth2 import service_account +from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import struct_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore diff --git a/tests/unit/gapic/dialogflowcx_v3/test_versions.py b/tests/unit/gapic/dialogflowcx_v3/test_versions.py index 0d0e0ae4..1859b272 100644 --- a/tests/unit/gapic/dialogflowcx_v3/test_versions.py +++ b/tests/unit/gapic/dialogflowcx_v3/test_versions.py @@ -51,6 +51,7 @@ from google.cloud.location import locations_pb2 from google.longrunning import operations_pb2 from google.oauth2 import service_account +from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import struct_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore diff --git a/tests/unit/gapic/dialogflowcx_v3beta1/test_agents.py b/tests/unit/gapic/dialogflowcx_v3beta1/test_agents.py index 5ec689a8..08e59988 100644 --- a/tests/unit/gapic/dialogflowcx_v3beta1/test_agents.py +++ b/tests/unit/gapic/dialogflowcx_v3beta1/test_agents.py @@ -52,6 +52,7 @@ from google.cloud.location import locations_pb2 from google.longrunning import operations_pb2 from google.oauth2 import service_account +from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import struct_pb2 # type: ignore import google.auth diff --git a/tests/unit/gapic/dialogflowcx_v3beta1/test_flows.py b/tests/unit/gapic/dialogflowcx_v3beta1/test_flows.py index f18d3ba0..a5b0de3f 100644 --- a/tests/unit/gapic/dialogflowcx_v3beta1/test_flows.py +++ b/tests/unit/gapic/dialogflowcx_v3beta1/test_flows.py @@ -54,6 +54,7 @@ from google.cloud.location import locations_pb2 from google.longrunning import operations_pb2 from google.oauth2 import service_account +from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import struct_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore diff --git a/tests/unit/gapic/dialogflowcx_v3beta1/test_versions.py b/tests/unit/gapic/dialogflowcx_v3beta1/test_versions.py index 082c0e9f..f381fdc7 100644 --- a/tests/unit/gapic/dialogflowcx_v3beta1/test_versions.py +++ b/tests/unit/gapic/dialogflowcx_v3beta1/test_versions.py @@ -51,6 +51,7 @@ from google.cloud.location import locations_pb2 from google.longrunning import operations_pb2 from google.oauth2 import service_account +from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import struct_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore