diff --git a/.flake8 b/.flake8 index 2e438749..87f6e408 100644 --- a/.flake8 +++ b/.flake8 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2020 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b8edda51..dd98abbd 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:2e247c7bf5154df7f98cce087a20ca7605e236340c7d6d1a14447e5c06791bd6 + digest: sha256:08e34975760f002746b1d8c86fdc90660be45945ee6d9db914d1508acdf9a547 +# created: 2023-10-09T14:06:13.397766266Z diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml index 41bff0b5..b2016d11 100644 --- a/.github/auto-label.yaml +++ b/.github/auto-label.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.gitignore b/.gitignore index b4243ced..d083ea1d 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,7 @@ docs.metadata # Virtual environment env/ +venv/ # Test logs coverage.xml diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 9223a65d..8ce4cd7b 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2018 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile index f8137d0a..8e39a2cc 100644 --- a/.kokoro/docker/docs/Dockerfile +++ b/.kokoro/docker/docs/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/populate-secrets.sh b/.kokoro/populate-secrets.sh index f5251425..6f397214 100755 --- a/.kokoro/populate-secrets.sh +++ b/.kokoro/populate-secrets.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2020 Google LLC. +# Copyright 2023 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/publish-docs.sh b/.kokoro/publish-docs.sh index 1c4d6237..9eafe0be 100755 --- a/.kokoro/publish-docs.sh +++ b/.kokoro/publish-docs.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2020 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 82d23bd6..0b57d342 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2020 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index 7ddba4bd..711e9f39 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -38,3 +38,12 @@ env_vars: { key: "SECRET_MANAGER_KEYS" value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" } + +# Store the packages we uploaded to PyPI. That way, we have a record of exactly +# what we published, which we can use to generate SBOMs and attestations. +action { + define_artifacts { + regex: "github/python-asset/**/*.tar.gz" + strip_prefix: "github/python-asset" + } +} diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index 66a2172a..0332d326 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.12.7 \ - --hash=sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3 \ - --hash=sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18 +certifi==2023.7.22 \ + --hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 \ + --hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9 # via requests cffi==1.15.1 \ --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ @@ -113,28 +113,30 @@ commonmark==0.9.1 \ --hash=sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60 \ --hash=sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9 # via rich -cryptography==39.0.1 \ - --hash=sha256:0f8da300b5c8af9f98111ffd512910bc792b4c77392a9523624680f7956a99d4 \ - --hash=sha256:35f7c7d015d474f4011e859e93e789c87d21f6f4880ebdc29896a60403328f1f \ - --hash=sha256:5aa67414fcdfa22cf052e640cb5ddc461924a045cacf325cd164e65312d99502 \ - --hash=sha256:5d2d8b87a490bfcd407ed9d49093793d0f75198a35e6eb1a923ce1ee86c62b41 \ - --hash=sha256:6687ef6d0a6497e2b58e7c5b852b53f62142cfa7cd1555795758934da363a965 \ - --hash=sha256:6f8ba7f0328b79f08bdacc3e4e66fb4d7aab0c3584e0bd41328dce5262e26b2e \ - --hash=sha256:706843b48f9a3f9b9911979761c91541e3d90db1ca905fd63fee540a217698bc \ - --hash=sha256:807ce09d4434881ca3a7594733669bd834f5b2c6d5c7e36f8c00f691887042ad \ - --hash=sha256:83e17b26de248c33f3acffb922748151d71827d6021d98c70e6c1a25ddd78505 \ - --hash=sha256:96f1157a7c08b5b189b16b47bc9db2332269d6680a196341bf30046330d15388 \ - --hash=sha256:aec5a6c9864be7df2240c382740fcf3b96928c46604eaa7f3091f58b878c0bb6 \ - --hash=sha256:b0afd054cd42f3d213bf82c629efb1ee5f22eba35bf0eec88ea9ea7304f511a2 \ - --hash=sha256:ced4e447ae29ca194449a3f1ce132ded8fcab06971ef5f618605aacaa612beac \ - --hash=sha256:d1f6198ee6d9148405e49887803907fe8962a23e6c6f83ea7d98f1c0de375695 \ - --hash=sha256:e124352fd3db36a9d4a21c1aa27fd5d051e621845cb87fb851c08f4f75ce8be6 \ - --hash=sha256:e422abdec8b5fa8462aa016786680720d78bdce7a30c652b7fadf83a4ba35336 \ - --hash=sha256:ef8b72fa70b348724ff1218267e7f7375b8de4e8194d1636ee60510aae104cd0 \ - --hash=sha256:f0c64d1bd842ca2633e74a1a28033d139368ad959872533b1bab8c80e8240a0c \ - --hash=sha256:f24077a3b5298a5a06a8e0536e3ea9ec60e4c7ac486755e5fb6e6ea9b3500106 \ - --hash=sha256:fdd188c8a6ef8769f148f88f859884507b954cc64db6b52f66ef199bb9ad660a \ - --hash=sha256:fe913f20024eb2cb2f323e42a64bdf2911bb9738a15dba7d3cce48151034e3a8 +cryptography==41.0.4 \ + --hash=sha256:004b6ccc95943f6a9ad3142cfabcc769d7ee38a3f60fb0dddbfb431f818c3a67 \ + --hash=sha256:047c4603aeb4bbd8db2756e38f5b8bd7e94318c047cfe4efeb5d715e08b49311 \ + --hash=sha256:0d9409894f495d465fe6fda92cb70e8323e9648af912d5b9141d616df40a87b8 \ + --hash=sha256:23a25c09dfd0d9f28da2352503b23e086f8e78096b9fd585d1d14eca01613e13 \ + --hash=sha256:2ed09183922d66c4ec5fdaa59b4d14e105c084dd0febd27452de8f6f74704143 \ + --hash=sha256:35c00f637cd0b9d5b6c6bd11b6c3359194a8eba9c46d4e875a3660e3b400005f \ + --hash=sha256:37480760ae08065437e6573d14be973112c9e6dcaf5f11d00147ee74f37a3829 \ + --hash=sha256:3b224890962a2d7b57cf5eeb16ccaafba6083f7b811829f00476309bce2fe0fd \ + --hash=sha256:5a0f09cefded00e648a127048119f77bc2b2ec61e736660b5789e638f43cc397 \ + --hash=sha256:5b72205a360f3b6176485a333256b9bcd48700fc755fef51c8e7e67c4b63e3ac \ + --hash=sha256:7e53db173370dea832190870e975a1e09c86a879b613948f09eb49324218c14d \ + --hash=sha256:7febc3094125fc126a7f6fb1f420d0da639f3f32cb15c8ff0dc3997c4549f51a \ + --hash=sha256:80907d3faa55dc5434a16579952ac6da800935cd98d14dbd62f6f042c7f5e839 \ + --hash=sha256:86defa8d248c3fa029da68ce61fe735432b047e32179883bdb1e79ed9bb8195e \ + --hash=sha256:8ac4f9ead4bbd0bc8ab2d318f97d85147167a488be0e08814a37eb2f439d5cf6 \ + --hash=sha256:93530900d14c37a46ce3d6c9e6fd35dbe5f5601bf6b3a5c325c7bffc030344d9 \ + --hash=sha256:9eeb77214afae972a00dee47382d2591abe77bdae166bda672fb1e24702a3860 \ + --hash=sha256:b5f4dfe950ff0479f1f00eda09c18798d4f49b98f4e2006d644b3301682ebdca \ + --hash=sha256:c3391bd8e6de35f6f1140e50aaeb3e2b3d6a9012536ca23ab0d9c35ec18c8a91 \ + --hash=sha256:c880eba5175f4307129784eca96f4e70b88e57aa3f680aeba3bab0e980b0f37d \ + --hash=sha256:cecfefa17042941f94ab54f769c8ce0fe14beff2694e9ac684176a2535bf9714 \ + --hash=sha256:e40211b4923ba5a6dc9769eab704bdb3fbb58d56c5b336d30996c24fcf12aadb \ + --hash=sha256:efc8ad4e6fc4f1752ebfb58aefece8b4e3c4cae940b0994d43649bdfce8d0d4f # via # gcp-releasetool # secretstorage @@ -380,6 +382,7 @@ protobuf==3.20.3 \ # gcp-docuploader # gcp-releasetool # google-api-core + # googleapis-common-protos pyasn1==0.4.8 \ --hash=sha256:39c7e2ec30515947ff4e87fb6f456dfc6e84857d34be479c9d4a4ba4bf46aa5d \ --hash=sha256:aef77c9fb94a3ac588e87841208bdec464471d9871bd5050a287cc9a475cd0ba @@ -394,9 +397,9 @@ pycparser==2.21 \ --hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \ --hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206 # via cffi -pygments==2.13.0 \ - --hash=sha256:56a8508ae95f98e2b9bdf93a6be5ae3f7d8af858b43e02c5a2ff083726be40c1 \ - --hash=sha256:f643f331ab57ba3c9d89212ee4a2dabc6e94f117cf4eefde99a0574720d14c42 +pygments==2.15.0 \ + --hash=sha256:77a3299119af881904cd5ecd1ac6a66214b6e9bed1f2db16993b54adede64094 \ + --hash=sha256:f7e36cffc4c517fbc252861b9a6e4644ca0e5abadf9a113c72d1358ad09b9500 # via # readme-renderer # rich @@ -419,9 +422,9 @@ readme-renderer==37.3 \ --hash=sha256:cd653186dfc73055656f090f227f5cb22a046d7f71a841dfa305f55c9a513273 \ --hash=sha256:f67a16caedfa71eef48a31b39708637a6f4664c4394801a7b0d6432d13907343 # via twine -requests==2.28.1 \ - --hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983 \ - --hash=sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349 +requests==2.31.0 \ + --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ + --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 # via # gcp-releasetool # google-api-core @@ -464,9 +467,9 @@ typing-extensions==4.4.0 \ --hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \ --hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e # via -r requirements.in -urllib3==1.26.12 \ - --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ - --hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997 +urllib3==1.26.17 \ + --hash=sha256:24d6a242c28d29af46c3fae832c36db3bbebcc533dd1bb549172cd739c82df21 \ + --hash=sha256:94a757d178c9be92ef5539b8840d48dc9cf1b2709c9d6b588232a055c524458b # via # requests # twine diff --git a/.kokoro/test-samples-against-head.sh b/.kokoro/test-samples-against-head.sh index ba3a707b..63ac41df 100755 --- a/.kokoro/test-samples-against-head.sh +++ b/.kokoro/test-samples-against-head.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2020 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/test-samples-impl.sh b/.kokoro/test-samples-impl.sh index 2c6500ca..5a0f5fab 100755 --- a/.kokoro/test-samples-impl.sh +++ b/.kokoro/test-samples-impl.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/test-samples.sh b/.kokoro/test-samples.sh index 11c042d3..50b35a48 100755 --- a/.kokoro/test-samples.sh +++ b/.kokoro/test-samples.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2020 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/trampoline.sh b/.kokoro/trampoline.sh index f39236e9..d85b1f26 100755 --- a/.kokoro/trampoline.sh +++ b/.kokoro/trampoline.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2017 Google Inc. +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.kokoro/trampoline_v2.sh b/.kokoro/trampoline_v2.sh index 4af6cdc2..59a7cf3a 100755 --- a/.kokoro/trampoline_v2.sh +++ b/.kokoro/trampoline_v2.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -# Copyright 2020 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5405cc8f..6a8e1695 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,4 @@ -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,10 +22,10 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.7.0 hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 3.9.2 + rev: 6.1.0 hooks: - id: flake8 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 60a50ee6..cce622a6 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.19.0" + ".": "3.19.1" } diff --git a/.trampolinerc b/.trampolinerc index 0eee72ab..a7dfeb42 100644 --- a/.trampolinerc +++ b/.trampolinerc @@ -1,4 +1,4 @@ -# Copyright 2020 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Template for .trampolinerc - # Add required env vars here. required_envvars+=( ) diff --git a/CHANGELOG.md b/CHANGELOG.md index a584362a..8c65a3b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-asset/#history +## [3.19.1](https://github.com/googleapis/python-asset/compare/v3.19.0...v3.19.1) (2023-07-04) + + +### Bug Fixes + +* Add async context manager return types ([#571](https://github.com/googleapis/python-asset/issues/571)) ([4bdad82](https://github.com/googleapis/python-asset/commit/4bdad82a3e49dd4a6e61f6fab40a8b7a54e8c771)) + ## [3.19.0](https://github.com/googleapis/python-asset/compare/v3.18.1...v3.19.0) (2023-04-01) diff --git a/MANIFEST.in b/MANIFEST.in index e783f4c6..e0a66705 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2020 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/README.rst b/README.rst index d7b8b124..57128145 100644 --- a/README.rst +++ b/README.rst @@ -36,21 +36,24 @@ In order to use this library, you first need to go through the following steps: Installation ~~~~~~~~~~~~ -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. +Install this library in a virtual environment using `venv`_. `venv`_ is a tool that +creates isolated Python environments. These isolated environments can have separate +versions of Python packages, which allows you to isolate one project's dependencies +from the dependencies of other projects. -With `virtualenv`_, it's possible to install this library without needing system +With `venv`_, it's possible to install this library without needing system install permissions, and without clashing with the installed system dependencies. -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ +.. _`venv`: https://docs.python.org/3/library/venv.html Code samples and snippets ~~~~~~~~~~~~~~~~~~~~~~~~~ -Code samples and snippets live in the `samples/` folder. +Code samples and snippets live in the `samples/`_ folder. + +.. _samples/: https://github.com/googleapis/python-asset/tree/main/samples Supported Python Versions @@ -77,10 +80,9 @@ Mac/Linux .. code-block:: console - pip install virtualenv - virtualenv + python3 -m venv source /bin/activate - /bin/pip install google-cloud-asset + pip install google-cloud-asset Windows @@ -88,10 +90,9 @@ Windows .. code-block:: console - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-asset + py -m venv + .\\Scripts\activate + pip install google-cloud-asset Next Steps ~~~~~~~~~~ diff --git a/docs/conf.py b/docs/conf.py index 38249472..763402f7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2021 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset/__init__.py b/google/cloud/asset/__init__.py index 8871f730..33511a4d 100644 --- a/google/cloud/asset/__init__.py +++ b/google/cloud/asset/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -103,6 +103,7 @@ from google.cloud.asset_v1.types.assets import Asset from google.cloud.asset_v1.types.assets import AttachedResource from google.cloud.asset_v1.types.assets import ConditionEvaluation +from google.cloud.asset_v1.types.assets import EffectiveTagDetails from google.cloud.asset_v1.types.assets import IamPolicyAnalysisResult from google.cloud.asset_v1.types.assets import IamPolicyAnalysisState from google.cloud.asset_v1.types.assets import IamPolicySearchResult @@ -113,6 +114,7 @@ from google.cloud.asset_v1.types.assets import RelationshipAttributes from google.cloud.asset_v1.types.assets import Resource from google.cloud.asset_v1.types.assets import ResourceSearchResult +from google.cloud.asset_v1.types.assets import Tag from google.cloud.asset_v1.types.assets import TemporalAsset from google.cloud.asset_v1.types.assets import TimeWindow from google.cloud.asset_v1.types.assets import VersionedResource @@ -184,6 +186,7 @@ "Asset", "AttachedResource", "ConditionEvaluation", + "EffectiveTagDetails", "IamPolicyAnalysisResult", "IamPolicyAnalysisState", "IamPolicySearchResult", @@ -194,6 +197,7 @@ "RelationshipAttributes", "Resource", "ResourceSearchResult", + "Tag", "TemporalAsset", "TimeWindow", "VersionedResource", diff --git a/google/cloud/asset/gapic_version.py b/google/cloud/asset/gapic_version.py index 4e343f66..2822f44a 100644 --- a/google/cloud/asset/gapic_version.py +++ b/google/cloud/asset/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "3.19.0" # {x-release-please-version} +__version__ = "3.19.1" # {x-release-please-version} diff --git a/google/cloud/asset_v1/__init__.py b/google/cloud/asset_v1/__init__.py index 0a4635fb..3788a43d 100644 --- a/google/cloud/asset_v1/__init__.py +++ b/google/cloud/asset_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -85,6 +85,7 @@ from .types.assets import Asset from .types.assets import AttachedResource from .types.assets import ConditionEvaluation +from .types.assets import EffectiveTagDetails from .types.assets import IamPolicyAnalysisResult from .types.assets import IamPolicyAnalysisState from .types.assets import IamPolicySearchResult @@ -95,6 +96,7 @@ from .types.assets import RelationshipAttributes from .types.assets import Resource from .types.assets import ResourceSearchResult +from .types.assets import Tag from .types.assets import TemporalAsset from .types.assets import TimeWindow from .types.assets import VersionedResource @@ -130,6 +132,7 @@ "CreateSavedQueryRequest", "DeleteFeedRequest", "DeleteSavedQueryRequest", + "EffectiveTagDetails", "ExportAssetsRequest", "ExportAssetsResponse", "Feed", @@ -174,6 +177,7 @@ "SearchAllResourcesResponse", "TableFieldSchema", "TableSchema", + "Tag", "TemporalAsset", "TimeWindow", "UpdateFeedRequest", diff --git a/google/cloud/asset_v1/gapic_version.py b/google/cloud/asset_v1/gapic_version.py index 4e343f66..2822f44a 100644 --- a/google/cloud/asset_v1/gapic_version.py +++ b/google/cloud/asset_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "3.19.0" # {x-release-please-version} +__version__ = "3.19.1" # {x-release-please-version} diff --git a/google/cloud/asset_v1/services/__init__.py b/google/cloud/asset_v1/services/__init__.py index e8e1c384..89a37dc9 100644 --- a/google/cloud/asset_v1/services/__init__.py +++ b/google/cloud/asset_v1/services/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1/services/asset_service/__init__.py b/google/cloud/asset_v1/services/asset_service/__init__.py index 4af01a66..13e0e330 100644 --- a/google/cloud/asset_v1/services/asset_service/__init__.py +++ b/google/cloud/asset_v1/services/asset_service/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1/services/asset_service/async_client.py b/google/cloud/asset_v1/services/asset_service/async_client.py index dcb187bc..692fb57f 100644 --- a/google/cloud/asset_v1/services/asset_service/async_client.py +++ b/google/cloud/asset_v1/services/asset_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,7 +47,7 @@ from google.cloud.asset_v1.services.asset_service import pagers from google.cloud.asset_v1.types import asset_service from google.cloud.asset_v1.types import assets -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore @@ -406,6 +406,7 @@ async def sample_list_assets(): Returns: google.cloud.asset_v1.services.asset_service.pagers.ListAssetsAsyncPager: ListAssets response. + Iterating over this object will yield results and resolve additional pages automatically. @@ -642,6 +643,7 @@ async def sample_create_feed(): exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Pub/Sub topics. """ @@ -750,6 +752,7 @@ async def sample_get_feed(): exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Pub/Sub topics. """ @@ -986,6 +989,7 @@ async def sample_update_feed(): exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Pub/Sub topics. """ @@ -1207,62 +1211,93 @@ async def sample_search_all_resources(): Examples: - ``name:Important`` to find Google Cloud resources - whose name contains "Important" as a word. + whose name contains ``Important`` as a word. - ``name=Important`` to find the Google Cloud resource - whose name is exactly "Important". + whose name is exactly ``Important``. - ``displayName:Impor*`` to find Google Cloud resources - whose display name contains "Impor" as a prefix of + whose display name contains ``Impor`` as a prefix of any word in the field. - ``location:us-west*`` to find Google Cloud resources - whose location contains both "us" and "west" as + whose location contains both ``us`` and ``west`` as prefixes. - ``labels:prod`` to find Google Cloud resources whose - labels contain "prod" as a key or value. + labels contain ``prod`` as a key or value. - ``labels.env:prod`` to find Google Cloud resources - that have a label "env" and its value is "prod". + that have a label ``env`` and its value is ``prod``. - ``labels.env:*`` to find Google Cloud resources that - have a label "env". + have a label ``env``. + - ``tagKeys:env`` to find Google Cloud resources that + have directly attached tags where the + ```TagKey`` `__ + .\ ``namespacedName`` contains ``env``. + - ``tagValues:prod*`` to find Google Cloud resources + that have directly attached tags where the + ```TagValue`` `__ + .\ ``namespacedName`` contains a word prefixed by + ``prod``. + - ``tagValueIds=tagValues/123`` to find Google Cloud + resources that have directly attached tags where the + ```TagValue`` `__ + .\ ``name`` is exactly ``tagValues/123``. + - ``effectiveTagKeys:env`` to find Google Cloud + resources that have directly attached or inherited + tags where the + ```TagKey`` `__ + .\ ``namespacedName`` contains ``env``. + - ``effectiveTagValues:prod*`` to find Google Cloud + resources that have directly attached or inherited + tags where the + ```TagValue`` `__ + .\ ``namespacedName`` contains a word prefixed by + ``prod``. + - ``effectiveTagValueIds=tagValues/123`` to find Google + Cloud resources that have directly attached or + inherited tags where the + ```TagValue`` `__ + .\ ``name`` is exactly ``tagValues/123``. - ``kmsKey:key`` to find Google Cloud resources encrypted with a customer-managed encryption key - whose name contains "key" as a word. This field is + whose name contains ``key`` as a word. This field is deprecated. Please use the ``kmsKeys`` field to retrieve Cloud KMS key information. - ``kmsKeys:key`` to find Google Cloud resources encrypted with customer-managed encryption keys whose - name contains the word "key". + name contains the word ``key``. - ``relationships:instance-group-1`` to find Google Cloud resources that have relationships with - "instance-group-1" in the related resource name. + ``instance-group-1`` in the related resource name. - ``relationships:INSTANCE_TO_INSTANCEGROUP`` to find Compute Engine instances that have relationships of - type "INSTANCE_TO_INSTANCEGROUP". + type ``INSTANCE_TO_INSTANCEGROUP``. - ``relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1`` to find Compute Engine instances that have - relationships with "instance-group-1" in the Compute - Engine instance group resource name, for relationship - type "INSTANCE_TO_INSTANCEGROUP". + relationships with ``instance-group-1`` in the + Compute Engine instance group resource name, for + relationship type ``INSTANCE_TO_INSTANCEGROUP``. - ``state:ACTIVE`` to find Google Cloud resources whose - state contains "ACTIVE" as a word. + state contains ``ACTIVE`` as a word. - ``NOT state:ACTIVE`` to find Google Cloud resources - whose state doesn't contain "ACTIVE" as a word. + whose state doesn't contain ``ACTIVE`` as a word. - ``createTime<1609459200`` to find Google Cloud - resources that were created before "2021-01-01 - 00:00:00 UTC". 1609459200 is the epoch timestamp of - "2021-01-01 00:00:00 UTC" in seconds. + resources that were created before + ``2021-01-01 00:00:00 UTC``. ``1609459200`` is the + epoch timestamp of ``2021-01-01 00:00:00 UTC`` in + seconds. - ``updateTime>1609459200`` to find Google Cloud - resources that were updated after "2021-01-01 - 00:00:00 UTC". 1609459200 is the epoch timestamp of - "2021-01-01 00:00:00 UTC" in seconds. + resources that were updated after + ``2021-01-01 00:00:00 UTC``. ``1609459200`` is the + epoch timestamp of ``2021-01-01 00:00:00 UTC`` in + seconds. - ``Important`` to find Google Cloud resources that - contain "Important" as a word in any of the + contain ``Important`` as a word in any of the searchable fields. - ``Impor*`` to find Google Cloud resources that - contain "Impor" as a prefix of any word in any of the - searchable fields. + contain ``Impor`` as a prefix of any word in any of + the searchable fields. - ``Important location:(us-west1 OR global)`` to find - Google Cloud resources that contain "Important" as a - word in any of the searchable fields and are also - located in the "us-west1" region or the "global" + Google Cloud resources that contain ``Important`` as + a word in any of the searchable fields and are also + located in the ``us-west1`` region or the ``global`` location. This corresponds to the ``query`` field @@ -1300,6 +1335,7 @@ async def sample_search_all_resources(): Returns: google.cloud.asset_v1.services.asset_service.pagers.SearchAllResourcesAsyncPager: Search all resources response. + Iterating over this object will yield results and resolve additional pages automatically. @@ -1500,6 +1536,7 @@ async def sample_search_all_iam_policies(): Returns: google.cloud.asset_v1.services.asset_service.pagers.SearchAllIamPoliciesAsyncPager: Search all IAM policies response. + Iterating over this object will yield results and resolve additional pages automatically. @@ -1874,8 +1911,8 @@ async def query_assets( metadata: Sequence[Tuple[str, str]] = (), ) -> asset_service.QueryAssetsResponse: r"""Issue a job that queries assets using a SQL statement compatible - with `BigQuery Standard - SQL `__. + with `BigQuery + SQL `__. If the query execution finishes within timeout and there's no pagination, the full query results will be returned in the @@ -1886,9 +1923,9 @@ async def query_assets( ``QueryAssets`` call. Note, the query result has approximately 10 GB limitation - enforced by BigQuery - https://cloud.google.com/bigquery/docs/best-practices-performance-output, - queries return larger results will result in errors. + enforced by + `BigQuery `__. + Queries return larger results will result in errors. .. code-block:: python @@ -2281,6 +2318,7 @@ async def sample_list_saved_queries(): Returns: google.cloud.asset_v1.services.asset_service.pagers.ListSavedQueriesAsyncPager: Response of listing saved queries. + Iterating over this object will yield results and resolve additional pages automatically. @@ -3224,7 +3262,7 @@ async def get_operation( # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "AssetServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/asset_v1/services/asset_service/client.py b/google/cloud/asset_v1/services/asset_service/client.py index 0f4b3911..dbacd132 100644 --- a/google/cloud/asset_v1/services/asset_service/client.py +++ b/google/cloud/asset_v1/services/asset_service/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ from google.cloud.asset_v1.services.asset_service import pagers from google.cloud.asset_v1.types import asset_service from google.cloud.asset_v1.types import assets -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore @@ -720,6 +720,7 @@ def sample_list_assets(): Returns: google.cloud.asset_v1.services.asset_service.pagers.ListAssetsPager: ListAssets response. + Iterating over this object will yield results and resolve additional pages automatically. @@ -937,6 +938,7 @@ def sample_create_feed(): exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Pub/Sub topics. """ @@ -1045,6 +1047,7 @@ def sample_get_feed(): exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Pub/Sub topics. """ @@ -1261,6 +1264,7 @@ def sample_update_feed(): exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Pub/Sub topics. """ @@ -1472,62 +1476,93 @@ def sample_search_all_resources(): Examples: - ``name:Important`` to find Google Cloud resources - whose name contains "Important" as a word. + whose name contains ``Important`` as a word. - ``name=Important`` to find the Google Cloud resource - whose name is exactly "Important". + whose name is exactly ``Important``. - ``displayName:Impor*`` to find Google Cloud resources - whose display name contains "Impor" as a prefix of + whose display name contains ``Impor`` as a prefix of any word in the field. - ``location:us-west*`` to find Google Cloud resources - whose location contains both "us" and "west" as + whose location contains both ``us`` and ``west`` as prefixes. - ``labels:prod`` to find Google Cloud resources whose - labels contain "prod" as a key or value. + labels contain ``prod`` as a key or value. - ``labels.env:prod`` to find Google Cloud resources - that have a label "env" and its value is "prod". + that have a label ``env`` and its value is ``prod``. - ``labels.env:*`` to find Google Cloud resources that - have a label "env". + have a label ``env``. + - ``tagKeys:env`` to find Google Cloud resources that + have directly attached tags where the + ```TagKey`` `__ + .\ ``namespacedName`` contains ``env``. + - ``tagValues:prod*`` to find Google Cloud resources + that have directly attached tags where the + ```TagValue`` `__ + .\ ``namespacedName`` contains a word prefixed by + ``prod``. + - ``tagValueIds=tagValues/123`` to find Google Cloud + resources that have directly attached tags where the + ```TagValue`` `__ + .\ ``name`` is exactly ``tagValues/123``. + - ``effectiveTagKeys:env`` to find Google Cloud + resources that have directly attached or inherited + tags where the + ```TagKey`` `__ + .\ ``namespacedName`` contains ``env``. + - ``effectiveTagValues:prod*`` to find Google Cloud + resources that have directly attached or inherited + tags where the + ```TagValue`` `__ + .\ ``namespacedName`` contains a word prefixed by + ``prod``. + - ``effectiveTagValueIds=tagValues/123`` to find Google + Cloud resources that have directly attached or + inherited tags where the + ```TagValue`` `__ + .\ ``name`` is exactly ``tagValues/123``. - ``kmsKey:key`` to find Google Cloud resources encrypted with a customer-managed encryption key - whose name contains "key" as a word. This field is + whose name contains ``key`` as a word. This field is deprecated. Please use the ``kmsKeys`` field to retrieve Cloud KMS key information. - ``kmsKeys:key`` to find Google Cloud resources encrypted with customer-managed encryption keys whose - name contains the word "key". + name contains the word ``key``. - ``relationships:instance-group-1`` to find Google Cloud resources that have relationships with - "instance-group-1" in the related resource name. + ``instance-group-1`` in the related resource name. - ``relationships:INSTANCE_TO_INSTANCEGROUP`` to find Compute Engine instances that have relationships of - type "INSTANCE_TO_INSTANCEGROUP". + type ``INSTANCE_TO_INSTANCEGROUP``. - ``relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1`` to find Compute Engine instances that have - relationships with "instance-group-1" in the Compute - Engine instance group resource name, for relationship - type "INSTANCE_TO_INSTANCEGROUP". + relationships with ``instance-group-1`` in the + Compute Engine instance group resource name, for + relationship type ``INSTANCE_TO_INSTANCEGROUP``. - ``state:ACTIVE`` to find Google Cloud resources whose - state contains "ACTIVE" as a word. + state contains ``ACTIVE`` as a word. - ``NOT state:ACTIVE`` to find Google Cloud resources - whose state doesn't contain "ACTIVE" as a word. + whose state doesn't contain ``ACTIVE`` as a word. - ``createTime<1609459200`` to find Google Cloud - resources that were created before "2021-01-01 - 00:00:00 UTC". 1609459200 is the epoch timestamp of - "2021-01-01 00:00:00 UTC" in seconds. + resources that were created before + ``2021-01-01 00:00:00 UTC``. ``1609459200`` is the + epoch timestamp of ``2021-01-01 00:00:00 UTC`` in + seconds. - ``updateTime>1609459200`` to find Google Cloud - resources that were updated after "2021-01-01 - 00:00:00 UTC". 1609459200 is the epoch timestamp of - "2021-01-01 00:00:00 UTC" in seconds. + resources that were updated after + ``2021-01-01 00:00:00 UTC``. ``1609459200`` is the + epoch timestamp of ``2021-01-01 00:00:00 UTC`` in + seconds. - ``Important`` to find Google Cloud resources that - contain "Important" as a word in any of the + contain ``Important`` as a word in any of the searchable fields. - ``Impor*`` to find Google Cloud resources that - contain "Impor" as a prefix of any word in any of the - searchable fields. + contain ``Impor`` as a prefix of any word in any of + the searchable fields. - ``Important location:(us-west1 OR global)`` to find - Google Cloud resources that contain "Important" as a - word in any of the searchable fields and are also - located in the "us-west1" region or the "global" + Google Cloud resources that contain ``Important`` as + a word in any of the searchable fields and are also + located in the ``us-west1`` region or the ``global`` location. This corresponds to the ``query`` field @@ -1565,6 +1600,7 @@ def sample_search_all_resources(): Returns: google.cloud.asset_v1.services.asset_service.pagers.SearchAllResourcesPager: Search all resources response. + Iterating over this object will yield results and resolve additional pages automatically. @@ -1756,6 +1792,7 @@ def sample_search_all_iam_policies(): Returns: google.cloud.asset_v1.services.asset_service.pagers.SearchAllIamPoliciesPager: Search all IAM policies response. + Iterating over this object will yield results and resolve additional pages automatically. @@ -2117,8 +2154,8 @@ def query_assets( metadata: Sequence[Tuple[str, str]] = (), ) -> asset_service.QueryAssetsResponse: r"""Issue a job that queries assets using a SQL statement compatible - with `BigQuery Standard - SQL `__. + with `BigQuery + SQL `__. If the query execution finishes within timeout and there's no pagination, the full query results will be returned in the @@ -2129,9 +2166,9 @@ def query_assets( ``QueryAssets`` call. Note, the query result has approximately 10 GB limitation - enforced by BigQuery - https://cloud.google.com/bigquery/docs/best-practices-performance-output, - queries return larger results will result in errors. + enforced by + `BigQuery `__. + Queries return larger results will result in errors. .. code-block:: python @@ -2506,6 +2543,7 @@ def sample_list_saved_queries(): Returns: google.cloud.asset_v1.services.asset_service.pagers.ListSavedQueriesPager: Response of listing saved queries. + Iterating over this object will yield results and resolve additional pages automatically. diff --git a/google/cloud/asset_v1/services/asset_service/pagers.py b/google/cloud/asset_v1/services/asset_service/pagers.py index 40848113..fd41af39 100644 --- a/google/cloud/asset_v1/services/asset_service/pagers.py +++ b/google/cloud/asset_v1/services/asset_service/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1/services/asset_service/transports/__init__.py b/google/cloud/asset_v1/services/asset_service/transports/__init__.py index 58f49f56..793ae8e8 100644 --- a/google/cloud/asset_v1/services/asset_service/transports/__init__.py +++ b/google/cloud/asset_v1/services/asset_service/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1/services/asset_service/transports/base.py b/google/cloud/asset_v1/services/asset_service/transports/base.py index 2290dd69..fb1a263f 100644 --- a/google/cloud/asset_v1/services/asset_service/transports/base.py +++ b/google/cloud/asset_v1/services/asset_service/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ from google.oauth2 import service_account # type: ignore from google.cloud.asset_v1.types import asset_service -from google.longrunning import operations_pb2 from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore diff --git a/google/cloud/asset_v1/services/asset_service/transports/grpc.py b/google/cloud/asset_v1/services/asset_service/transports/grpc.py index a2f2a8c6..0dfc989e 100644 --- a/google/cloud/asset_v1/services/asset_service/transports/grpc.py +++ b/google/cloud/asset_v1/services/asset_service/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -26,7 +26,6 @@ import grpc # type: ignore from google.cloud.asset_v1.types import asset_service -from google.longrunning import operations_pb2 from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore from .base import AssetServiceTransport, DEFAULT_CLIENT_INFO @@ -656,8 +655,8 @@ def query_assets( r"""Return a callable for the query assets method over gRPC. Issue a job that queries assets using a SQL statement compatible - with `BigQuery Standard - SQL `__. + with `BigQuery + SQL `__. If the query execution finishes within timeout and there's no pagination, the full query results will be returned in the @@ -668,9 +667,9 @@ def query_assets( ``QueryAssets`` call. Note, the query result has approximately 10 GB limitation - enforced by BigQuery - https://cloud.google.com/bigquery/docs/best-practices-performance-output, - queries return larger results will result in errors. + enforced by + `BigQuery `__. + Queries return larger results will result in errors. Returns: Callable[[~.QueryAssetsRequest], diff --git a/google/cloud/asset_v1/services/asset_service/transports/grpc_asyncio.py b/google/cloud/asset_v1/services/asset_service/transports/grpc_asyncio.py index 00529bf1..ee27b0c0 100644 --- a/google/cloud/asset_v1/services/asset_service/transports/grpc_asyncio.py +++ b/google/cloud/asset_v1/services/asset_service/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -26,7 +26,6 @@ from grpc.experimental import aio # type: ignore from google.cloud.asset_v1.types import asset_service -from google.longrunning import operations_pb2 from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore from .base import AssetServiceTransport, DEFAULT_CLIENT_INFO @@ -671,8 +670,8 @@ def query_assets( r"""Return a callable for the query assets method over gRPC. Issue a job that queries assets using a SQL statement compatible - with `BigQuery Standard - SQL `__. + with `BigQuery + SQL `__. If the query execution finishes within timeout and there's no pagination, the full query results will be returned in the @@ -683,9 +682,9 @@ def query_assets( ``QueryAssets`` call. Note, the query result has approximately 10 GB limitation - enforced by BigQuery - https://cloud.google.com/bigquery/docs/best-practices-performance-output, - queries return larger results will result in errors. + enforced by + `BigQuery `__. + Queries return larger results will result in errors. Returns: Callable[[~.QueryAssetsRequest], diff --git a/google/cloud/asset_v1/services/asset_service/transports/rest.py b/google/cloud/asset_v1/services/asset_service/transports/rest.py index de5899bb..9d3fa1fc 100644 --- a/google/cloud/asset_v1/services/asset_service/transports/rest.py +++ b/google/cloud/asset_v1/services/asset_service/transports/rest.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ from google.protobuf import json_format from google.api_core import operations_v1 -from google.longrunning import operations_pb2 from requests import __version__ as requests_version import dataclasses import re @@ -42,8 +41,8 @@ from google.cloud.asset_v1.types import asset_service -from google.longrunning import operations_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore +from google.longrunning import operations_pb2 # type: ignore from .base import AssetServiceTransport, DEFAULT_CLIENT_INFO as BASE_DEFAULT_CLIENT_INFO @@ -1711,6 +1710,7 @@ def __call__( exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Pub/Sub topics. """ @@ -2160,6 +2160,7 @@ def __call__( exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Pub/Sub topics. """ @@ -2872,6 +2873,7 @@ def __call__( exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Pub/Sub topics. """ @@ -3260,7 +3262,6 @@ def __call__( timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operations_pb2.Operation: - r"""Call the get operation method over HTTP. Args: diff --git a/google/cloud/asset_v1/types/__init__.py b/google/cloud/asset_v1/types/__init__.py index eede4916..349fb085 100644 --- a/google/cloud/asset_v1/types/__init__.py +++ b/google/cloud/asset_v1/types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -80,6 +80,7 @@ Asset, AttachedResource, ConditionEvaluation, + EffectiveTagDetails, IamPolicyAnalysisResult, IamPolicyAnalysisState, IamPolicySearchResult, @@ -90,6 +91,7 @@ RelationshipAttributes, Resource, ResourceSearchResult, + Tag, TemporalAsset, TimeWindow, VersionedResource, @@ -160,6 +162,7 @@ "Asset", "AttachedResource", "ConditionEvaluation", + "EffectiveTagDetails", "IamPolicyAnalysisResult", "IamPolicyAnalysisState", "IamPolicySearchResult", @@ -170,6 +173,7 @@ "RelationshipAttributes", "Resource", "ResourceSearchResult", + "Tag", "TemporalAsset", "TimeWindow", "VersionedResource", diff --git a/google/cloud/asset_v1/types/asset_service.py b/google/cloud/asset_v1/types/asset_service.py index 681a81c1..087db5d2 100644 --- a/google/cloud/asset_v1/types/asset_service.py +++ b/google/cloud/asset_v1/types/asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -962,6 +962,7 @@ class Feed(proto.Message): An asset feed filter controls what updates are exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Pub/Sub topics. Attributes: @@ -1097,60 +1098,89 @@ class SearchAllResourcesRequest(proto.Message): Examples: - ``name:Important`` to find Google Cloud resources whose - name contains "Important" as a word. + name contains ``Important`` as a word. - ``name=Important`` to find the Google Cloud resource - whose name is exactly "Important". + whose name is exactly ``Important``. - ``displayName:Impor*`` to find Google Cloud resources - whose display name contains "Impor" as a prefix of any + whose display name contains ``Impor`` as a prefix of any word in the field. - ``location:us-west*`` to find Google Cloud resources - whose location contains both "us" and "west" as prefixes. + whose location contains both ``us`` and ``west`` as + prefixes. - ``labels:prod`` to find Google Cloud resources whose - labels contain "prod" as a key or value. + labels contain ``prod`` as a key or value. - ``labels.env:prod`` to find Google Cloud resources that - have a label "env" and its value is "prod". + have a label ``env`` and its value is ``prod``. - ``labels.env:*`` to find Google Cloud resources that have - a label "env". + a label ``env``. + - ``tagKeys:env`` to find Google Cloud resources that have + directly attached tags where the + ```TagKey`` `__ + .\ ``namespacedName`` contains ``env``. + - ``tagValues:prod*`` to find Google Cloud resources that + have directly attached tags where the + ```TagValue`` `__ + .\ ``namespacedName`` contains a word prefixed by + ``prod``. + - ``tagValueIds=tagValues/123`` to find Google Cloud + resources that have directly attached tags where the + ```TagValue`` `__ + .\ ``name`` is exactly ``tagValues/123``. + - ``effectiveTagKeys:env`` to find Google Cloud resources + that have directly attached or inherited tags where the + ```TagKey`` `__ + .\ ``namespacedName`` contains ``env``. + - ``effectiveTagValues:prod*`` to find Google Cloud + resources that have directly attached or inherited tags + where the + ```TagValue`` `__ + .\ ``namespacedName`` contains a word prefixed by + ``prod``. + - ``effectiveTagValueIds=tagValues/123`` to find Google + Cloud resources that have directly attached or inherited + tags where the + ```TagValue`` `__ + .\ ``name`` is exactly ``tagValues/123``. - ``kmsKey:key`` to find Google Cloud resources encrypted with a customer-managed encryption key whose name - contains "key" as a word. This field is deprecated. + contains ``key`` as a word. This field is deprecated. Please use the ``kmsKeys`` field to retrieve Cloud KMS key information. - ``kmsKeys:key`` to find Google Cloud resources encrypted with customer-managed encryption keys whose name contains - the word "key". + the word ``key``. - ``relationships:instance-group-1`` to find Google Cloud - resources that have relationships with "instance-group-1" - in the related resource name. + resources that have relationships with + ``instance-group-1`` in the related resource name. - ``relationships:INSTANCE_TO_INSTANCEGROUP`` to find Compute Engine instances that have relationships of type - "INSTANCE_TO_INSTANCEGROUP". + ``INSTANCE_TO_INSTANCEGROUP``. - ``relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1`` to find Compute Engine instances that have relationships - with "instance-group-1" in the Compute Engine instance + with ``instance-group-1`` in the Compute Engine instance group resource name, for relationship type - "INSTANCE_TO_INSTANCEGROUP". + ``INSTANCE_TO_INSTANCEGROUP``. - ``state:ACTIVE`` to find Google Cloud resources whose - state contains "ACTIVE" as a word. + state contains ``ACTIVE`` as a word. - ``NOT state:ACTIVE`` to find Google Cloud resources whose - state doesn't contain "ACTIVE" as a word. + state doesn't contain ``ACTIVE`` as a word. - ``createTime<1609459200`` to find Google Cloud resources - that were created before "2021-01-01 00:00:00 UTC". - 1609459200 is the epoch timestamp of "2021-01-01 00:00:00 - UTC" in seconds. + that were created before ``2021-01-01 00:00:00 UTC``. + ``1609459200`` is the epoch timestamp of + ``2021-01-01 00:00:00 UTC`` in seconds. - ``updateTime>1609459200`` to find Google Cloud resources - that were updated after "2021-01-01 00:00:00 UTC". - 1609459200 is the epoch timestamp of "2021-01-01 00:00:00 - UTC" in seconds. + that were updated after ``2021-01-01 00:00:00 UTC``. + ``1609459200`` is the epoch timestamp of + ``2021-01-01 00:00:00 UTC`` in seconds. - ``Important`` to find Google Cloud resources that contain - "Important" as a word in any of the searchable fields. + ``Important`` as a word in any of the searchable fields. - ``Impor*`` to find Google Cloud resources that contain - "Impor" as a prefix of any word in any of the searchable - fields. + ``Impor`` as a prefix of any word in any of the + searchable fields. - ``Important location:(us-west1 OR global)`` to find - Google Cloud resources that contain "Important" as a word - in any of the searchable fields and are also located in - the "us-west1" region or the "global" location. + Google Cloud resources that contain ``Important`` as a + word in any of the searchable fields and are also located + in the ``us-west1`` region or the ``global`` location. asset_types (MutableSequence[str]): Optional. A list of asset types that this request searches for. If empty, it will search all the `searchable asset @@ -1172,10 +1202,10 @@ class SearchAllResourcesRequest(proto.Message): page_size (int): Optional. The page size for search result pagination. Page size is capped at 500 even if a larger value is given. If - set to zero, server will pick an appropriate default. - Returned results may be fewer than requested. When this - happens, there could be more results as long as - ``next_page_token`` is returned. + set to zero or a negative value, server will pick an + appropriate default. Returned results may be fewer than + requested. When this happens, there could be more results as + long as ``next_page_token`` is returned. page_token (str): Optional. If present, then retrieve the next batch of results from the preceding call to this method. @@ -1187,8 +1217,8 @@ class SearchAllResourcesRequest(proto.Message): sorting order of the results. The default order is ascending. Add " DESC" after the field name to indicate descending order. Redundant space characters are ignored. - Example: "location DESC, name". Only singular primitive - fields in the response are sortable: + Example: "location DESC, name". Only the following fields in + the response are sortable: - name - assetType @@ -1201,47 +1231,40 @@ class SearchAllResourcesRequest(proto.Message): - state - parentFullResourceName - parentAssetType - - All the other fields such as repeated fields (e.g., - ``networkTags``, ``kmsKeys``), map fields (e.g., ``labels``) - and struct fields (e.g., ``additionalAttributes``) are not - supported. read_mask (google.protobuf.field_mask_pb2.FieldMask): - Optional. A comma-separated list of fields specifying which - fields to be returned in ResourceSearchResult. Only '*' or - combination of top level fields can be specified. Field - names of both snake_case and camelCase are supported. - Examples: ``"*"``, ``"name,location"``, - ``"name,versionedResources"``. - - The read_mask paths must be valid field paths listed but not - limited to (both snake_case and camelCase are supported): - - - name - - assetType - - project - - displayName - - description - - location - - tagKeys - - tagValues - - tagValueIds - - labels - - networkTags - - kmsKey (This field is deprecated. Please use the - ``kmsKeys`` field to retrieve Cloud KMS key information.) - - kmsKeys - - createTime - - updateTime - - state - - additionalAttributes - - versionedResources - - If read_mask is not specified, all fields except - versionedResources will be returned. If only '*' is - specified, all fields including versionedResources will be - returned. Any invalid field path will trigger - INVALID_ARGUMENT error. + Optional. A comma-separated list of fields that you want + returned in the results. The following fields are returned + by default if not specified: + + - ``name`` + - ``assetType`` + - ``project`` + - ``folders`` + - ``organization`` + - ``displayName`` + - ``description`` + - ``location`` + - ``labels`` + - ``tags`` + - ``effectiveTags`` + - ``networkTags`` + - ``kmsKeys`` + - ``createTime`` + - ``updateTime`` + - ``state`` + - ``additionalAttributes`` + - ``parentFullResourceName`` + - ``parentAssetType`` + + Some fields of large size, such as ``versionedResources``, + ``attachedResources``, ``effectiveTags`` etc., are not + returned by default, but you can specify them in the + ``read_mask`` parameter if you want to include them. If + ``"*"`` is specified, all `available + fields `__ + are returned. Examples: ``"name,location"``, + ``"name,versionedResources"``, ``"*"``. Any invalid field + path will trigger INVALID_ARGUMENT error. """ scope: str = proto.Field( @@ -1373,10 +1396,10 @@ class SearchAllIamPoliciesRequest(proto.Message): page_size (int): Optional. The page size for search result pagination. Page size is capped at 500 even if a larger value is given. If - set to zero, server will pick an appropriate default. - Returned results may be fewer than requested. When this - happens, there could be more results as long as - ``next_page_token`` is returned. + set to zero or a negative value, server will pick an + appropriate default. Returned results may be fewer than + requested. When this happens, there could be more results as + long as ``next_page_token`` is returned. page_token (str): Optional. If present, retrieve the next batch of results from the preceding call to this method. ``page_token`` must @@ -2629,8 +2652,7 @@ class QueryAssetsRequest(proto.Message): Only assets belonging to the ``parent`` will be returned. statement (str): Optional. A SQL statement that's compatible with `BigQuery - Standard - SQL `__. + SQL `__. This field is a member of `oneof`_ ``query``. job_reference (str): @@ -3086,7 +3108,11 @@ class AnalyzerOrgPolicy(proto.Message): """ class Rule(proto.Message): - r"""Represents a rule defined in an organization policy + r"""This rule message is a customized version of the one defined + in the Organization Policy system. In addition to the fields + defined in the original organization policy, it contains + additional field(s) under specific circumstances to support + analysis results. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -3896,8 +3922,8 @@ class GovernedIamPolicy(proto.Message): Attributes: attached_resource (str): - The full resource name of the resource associated with this - IAM policy. Example: + The full resource name of the resource on which this IAM + policy is set. Example: ``//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1``. See `Cloud Asset Inventory Resource Name Format `__ diff --git a/google/cloud/asset_v1/types/assets.py b/google/cloud/asset_v1/types/assets.py index daac375e..282300f8 100644 --- a/google/cloud/asset_v1/types/assets.py +++ b/google/cloud/asset_v1/types/assets.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -40,6 +40,8 @@ "RelatedAssets", "RelationshipAttributes", "RelatedAsset", + "Tag", + "EffectiveTagDetails", "ResourceSearchResult", "VersionedResource", "AttachedResource", @@ -510,9 +512,90 @@ class RelatedAsset(proto.Message): ) +class Tag(proto.Message): + r"""The key and value for a + `tag `__, + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + tag_key (str): + TagKey namespaced name, in the format of + {ORG_ID}/{TAG_KEY_SHORT_NAME}. + + This field is a member of `oneof`_ ``_tag_key``. + tag_value (str): + TagValue namespaced name, in the format of + {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. + + This field is a member of `oneof`_ ``_tag_value``. + tag_value_id (str): + TagValue ID, in the format of tagValues/{TAG_VALUE_ID}. + + This field is a member of `oneof`_ ``_tag_value_id``. + """ + + tag_key: str = proto.Field( + proto.STRING, + number=1, + optional=True, + ) + tag_value: str = proto.Field( + proto.STRING, + number=3, + optional=True, + ) + tag_value_id: str = proto.Field( + proto.STRING, + number=4, + optional=True, + ) + + +class EffectiveTagDetails(proto.Message): + r"""The effective tags and the ancestor resources from which they + were inherited. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + attached_resource (str): + The `full resource + name `__ + of the ancestor from which an [effective_tag][] is + inherited, according to `tag + inheritance `__. + + This field is a member of `oneof`_ ``_attached_resource``. + effective_tags (MutableSequence[google.cloud.asset_v1.types.Tag]): + The effective tags inherited from the + [attached_resource][google.cloud.asset.v1.EffectiveTagDetails.attached_resource]. + Note that tags with the same key but different values may + attach to resources at a different hierarchy levels. The + lower hierarchy tag value will overwrite the higher + hierarchy tag value of the same tag key. In this case, the + tag value at the higher hierarchy level will be removed. For + more information, see `tag + inheritance `__. + """ + + attached_resource: str = proto.Field( + proto.STRING, + number=1, + optional=True, + ) + effective_tags: MutableSequence["Tag"] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="Tag", + ) + + class ResourceSearchResult(proto.Message): r"""A result of Resource Search, containing information of a - cloud resource. Next ID: 32 + cloud resource. Next ID: 34 Attributes: name (str): @@ -765,6 +848,9 @@ class ResourceSearchResult(proto.Message): ``INSTANCE_TO_INSTANCEGROUP``. See `supported relationship types `__. tag_keys (MutableSequence[str]): + This field is only present for the purpose of backward + compatibility. Please use the ``tags`` field instead. + TagKey namespaced names, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. To search against the ``tagKeys``: @@ -779,6 +865,9 @@ class ResourceSearchResult(proto.Message): - ``env`` tag_values (MutableSequence[str]): + This field is only present for the purpose of backward + compatibility. Please use the ``tags`` field instead. + TagValue namespaced names, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. To search against the ``tagValues``: @@ -794,17 +883,57 @@ class ResourceSearchResult(proto.Message): - ``prod`` tag_value_ids (MutableSequence[str]): + This field is only present for the purpose of backward + compatibility. Please use the ``tags`` field instead. + TagValue IDs, in the format of tagValues/{TAG_VALUE_ID}. To search against the ``tagValueIds``: - Use a field query. Example: - - ``tagValueIds:"456"`` - ``tagValueIds="tagValues/456"`` - Use a free text query. Example: - ``456`` + tags (MutableSequence[google.cloud.asset_v1.types.Tag]): + The tags directly attached to this resource. + + To search against the ``tags``: + + - Use a field query. Example: + + - ``tagKeys:"123456789/env*"`` + - ``tagKeys="123456789/env"`` + - ``tagKeys:"env"`` + - ``tagValues:"env"`` + - ``tagValues:"env/prod"`` + - ``tagValues:"123456789/env/prod*"`` + - ``tagValues="123456789/env/prod"`` + - ``tagValueIds="tagValues/456"`` + + - Use a free text query. Example: + + - ``env/prod`` + effective_tags (MutableSequence[google.cloud.asset_v1.types.EffectiveTagDetails]): + The effective tags on this resource. All of the tags that + are both attached to and inherited by a resource are + collectively called the effective tags. For more + information, see `tag + inheritance `__. + + To search against the ``effective_tags``: + + - Use a field query. Example: + + - ``effectiveTagKeys:"123456789/env*"`` + - ``effectiveTagKeys="123456789/env"`` + - ``effectiveTagKeys:"env"`` + - ``effectiveTagValues:"env"`` + - ``effectiveTagValues:"env/prod"`` + - ``effectiveTagValues:"123456789/env/prod*"`` + - ``effectiveTagValues="123456789/env/prod"`` + - ``effectiveTagValueIds="tagValues/456"`` parent_asset_type (str): The type of this resource's immediate parent, if there is one. @@ -815,6 +944,23 @@ class ResourceSearchResult(proto.Message): ``parentAssetType:"cloudresourcemanager.googleapis.com/Project"`` - Use a free text query. Example: ``cloudresourcemanager.googleapis.com/Project`` + scc_security_marks (MutableMapping[str, str]): + The actual content of Security Command Center security marks + associated with the asset. + + Note that both staging & prod SecurityMarks are attached on + prod resources. In CAS preprod/prod, both staging & prod + SecurityMarks are ingested and returned in the following + ``security_marks`` map. In that case, the prefix "staging." + will be added to the keys of all the staging marks. To + search against SCC SecurityMarks field: + + - Use a field query: + + - query by a given key value pair. Example: + ``sccSecurityMarks.foo=bar`` + - query by a given key's existence. Example: + ``sccSecurityMarks.foo:*`` """ name: str = proto.Field( @@ -917,10 +1063,25 @@ class ResourceSearchResult(proto.Message): proto.STRING, number=26, ) + tags: MutableSequence["Tag"] = proto.RepeatedField( + proto.MESSAGE, + number=29, + message="Tag", + ) + effective_tags: MutableSequence["EffectiveTagDetails"] = proto.RepeatedField( + proto.MESSAGE, + number=30, + message="EffectiveTagDetails", + ) parent_asset_type: str = proto.Field( proto.STRING, number=103, ) + scc_security_marks: MutableMapping[str, str] = proto.MapField( + proto.STRING, + proto.STRING, + number=32, + ) class VersionedResource(proto.Message): @@ -1345,10 +1506,10 @@ class Identity(proto.Message): Attributes: name (str): - The identity name in any form of members appear in `IAM + The identity of members, formatted as appear in an `IAM policy - binding `__, - such as: + binding `__. + For example, they might be formatted like the following: - user:foo@google.com - group:group1@google.com @@ -1356,7 +1517,6 @@ class Identity(proto.Message): - projectOwner:some_project_id - domain:google.com - allUsers - - etc. analysis_state (google.cloud.asset_v1.types.IamPolicyAnalysisState): The analysis state of this identity. """ diff --git a/google/cloud/asset_v1p1beta1/__init__.py b/google/cloud/asset_v1p1beta1/__init__.py index c43c6385..80dc0fb0 100644 --- a/google/cloud/asset_v1p1beta1/__init__.py +++ b/google/cloud/asset_v1p1beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p1beta1/gapic_version.py b/google/cloud/asset_v1p1beta1/gapic_version.py index 4e343f66..2822f44a 100644 --- a/google/cloud/asset_v1p1beta1/gapic_version.py +++ b/google/cloud/asset_v1p1beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "3.19.0" # {x-release-please-version} +__version__ = "3.19.1" # {x-release-please-version} diff --git a/google/cloud/asset_v1p1beta1/services/__init__.py b/google/cloud/asset_v1p1beta1/services/__init__.py index e8e1c384..89a37dc9 100644 --- a/google/cloud/asset_v1p1beta1/services/__init__.py +++ b/google/cloud/asset_v1p1beta1/services/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p1beta1/services/asset_service/__init__.py b/google/cloud/asset_v1p1beta1/services/asset_service/__init__.py index 4af01a66..13e0e330 100644 --- a/google/cloud/asset_v1p1beta1/services/asset_service/__init__.py +++ b/google/cloud/asset_v1p1beta1/services/asset_service/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p1beta1/services/asset_service/async_client.py b/google/cloud/asset_v1p1beta1/services/asset_service/async_client.py index 309c2dac..5e3f46db 100644 --- a/google/cloud/asset_v1p1beta1/services/asset_service/async_client.py +++ b/google/cloud/asset_v1p1beta1/services/asset_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ from google.cloud.asset_v1p1beta1.services.asset_service import pagers from google.cloud.asset_v1p1beta1.types import asset_service from google.cloud.asset_v1p1beta1.types import assets -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore from .transports.base import AssetServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import AssetServiceGrpcAsyncIOTransport from .client import AssetServiceClient @@ -294,6 +294,7 @@ async def sample_search_all_resources(): Returns: google.cloud.asset_v1p1beta1.services.asset_service.pagers.SearchAllResourcesAsyncPager: Search all resources response. + Iterating over this object will yield results and resolve additional pages automatically. @@ -445,6 +446,7 @@ async def sample_search_all_iam_policies(): Returns: google.cloud.asset_v1p1beta1.services.asset_service.pagers.SearchAllIamPoliciesAsyncPager: Search all IAM policies response. + Iterating over this object will yield results and resolve additional pages automatically. @@ -513,7 +515,7 @@ async def sample_search_all_iam_policies(): # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "AssetServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/asset_v1p1beta1/services/asset_service/client.py b/google/cloud/asset_v1p1beta1/services/asset_service/client.py index 44c73807..894f4226 100644 --- a/google/cloud/asset_v1p1beta1/services/asset_service/client.py +++ b/google/cloud/asset_v1p1beta1/services/asset_service/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ from google.cloud.asset_v1p1beta1.services.asset_service import pagers from google.cloud.asset_v1p1beta1.types import asset_service from google.cloud.asset_v1p1beta1.types import assets -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore from .transports.base import AssetServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import AssetServiceGrpcTransport from .transports.grpc_asyncio import AssetServiceGrpcAsyncIOTransport @@ -505,6 +505,7 @@ def sample_search_all_resources(): Returns: google.cloud.asset_v1p1beta1.services.asset_service.pagers.SearchAllResourcesPager: Search all resources response. + Iterating over this object will yield results and resolve additional pages automatically. @@ -646,6 +647,7 @@ def sample_search_all_iam_policies(): Returns: google.cloud.asset_v1p1beta1.services.asset_service.pagers.SearchAllIamPoliciesPager: Search all IAM policies response. + Iterating over this object will yield results and resolve additional pages automatically. diff --git a/google/cloud/asset_v1p1beta1/services/asset_service/pagers.py b/google/cloud/asset_v1p1beta1/services/asset_service/pagers.py index a2aea41b..94e25db9 100644 --- a/google/cloud/asset_v1p1beta1/services/asset_service/pagers.py +++ b/google/cloud/asset_v1p1beta1/services/asset_service/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p1beta1/services/asset_service/transports/__init__.py b/google/cloud/asset_v1p1beta1/services/asset_service/transports/__init__.py index 58f49f56..793ae8e8 100644 --- a/google/cloud/asset_v1p1beta1/services/asset_service/transports/__init__.py +++ b/google/cloud/asset_v1p1beta1/services/asset_service/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p1beta1/services/asset_service/transports/base.py b/google/cloud/asset_v1p1beta1/services/asset_service/transports/base.py index 44d3df77..83abfafb 100644 --- a/google/cloud/asset_v1p1beta1/services/asset_service/transports/base.py +++ b/google/cloud/asset_v1p1beta1/services/asset_service/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ from google.oauth2 import service_account # type: ignore from google.cloud.asset_v1p1beta1.types import asset_service -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( gapic_version=package_version.__version__ diff --git a/google/cloud/asset_v1p1beta1/services/asset_service/transports/grpc.py b/google/cloud/asset_v1p1beta1/services/asset_service/transports/grpc.py index 1cf665f4..7c0d44df 100644 --- a/google/cloud/asset_v1p1beta1/services/asset_service/transports/grpc.py +++ b/google/cloud/asset_v1p1beta1/services/asset_service/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import grpc # type: ignore from google.cloud.asset_v1p1beta1.types import asset_service -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore from .base import AssetServiceTransport, DEFAULT_CLIENT_INFO diff --git a/google/cloud/asset_v1p1beta1/services/asset_service/transports/grpc_asyncio.py b/google/cloud/asset_v1p1beta1/services/asset_service/transports/grpc_asyncio.py index af3f9abd..e0cbccf7 100644 --- a/google/cloud/asset_v1p1beta1/services/asset_service/transports/grpc_asyncio.py +++ b/google/cloud/asset_v1p1beta1/services/asset_service/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ from grpc.experimental import aio # type: ignore from google.cloud.asset_v1p1beta1.types import asset_service -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore from .base import AssetServiceTransport, DEFAULT_CLIENT_INFO from .grpc import AssetServiceGrpcTransport diff --git a/google/cloud/asset_v1p1beta1/services/asset_service/transports/rest.py b/google/cloud/asset_v1p1beta1/services/asset_service/transports/rest.py index 1012a95d..070c2b0e 100644 --- a/google/cloud/asset_v1p1beta1/services/asset_service/transports/rest.py +++ b/google/cloud/asset_v1p1beta1/services/asset_service/transports/rest.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,7 +27,6 @@ from google.api_core import gapic_v1 from google.protobuf import json_format -from google.longrunning import operations_pb2 from requests import __version__ as requests_version import dataclasses import re @@ -41,6 +40,7 @@ from google.cloud.asset_v1p1beta1.types import asset_service +from google.longrunning import operations_pb2 # type: ignore from .base import AssetServiceTransport, DEFAULT_CLIENT_INFO as BASE_DEFAULT_CLIENT_INFO diff --git a/google/cloud/asset_v1p1beta1/types/__init__.py b/google/cloud/asset_v1p1beta1/types/__init__.py index 467f8a85..7ec260a6 100644 --- a/google/cloud/asset_v1p1beta1/types/__init__.py +++ b/google/cloud/asset_v1p1beta1/types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p1beta1/types/asset_service.py b/google/cloud/asset_v1p1beta1/types/asset_service.py index cd6f91e6..964d8ee7 100644 --- a/google/cloud/asset_v1p1beta1/types/asset_service.py +++ b/google/cloud/asset_v1p1beta1/types/asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p1beta1/types/assets.py b/google/cloud/asset_v1p1beta1/types/assets.py index f1a9cdab..c582b244 100644 --- a/google/cloud/asset_v1p1beta1/types/assets.py +++ b/google/cloud/asset_v1p1beta1/types/assets.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p2beta1/__init__.py b/google/cloud/asset_v1p2beta1/__init__.py index 59bb16d7..5f6ea5a3 100644 --- a/google/cloud/asset_v1p2beta1/__init__.py +++ b/google/cloud/asset_v1p2beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p2beta1/gapic_version.py b/google/cloud/asset_v1p2beta1/gapic_version.py index 4e343f66..2822f44a 100644 --- a/google/cloud/asset_v1p2beta1/gapic_version.py +++ b/google/cloud/asset_v1p2beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "3.19.0" # {x-release-please-version} +__version__ = "3.19.1" # {x-release-please-version} diff --git a/google/cloud/asset_v1p2beta1/services/__init__.py b/google/cloud/asset_v1p2beta1/services/__init__.py index e8e1c384..89a37dc9 100644 --- a/google/cloud/asset_v1p2beta1/services/__init__.py +++ b/google/cloud/asset_v1p2beta1/services/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p2beta1/services/asset_service/__init__.py b/google/cloud/asset_v1p2beta1/services/asset_service/__init__.py index 4af01a66..13e0e330 100644 --- a/google/cloud/asset_v1p2beta1/services/asset_service/__init__.py +++ b/google/cloud/asset_v1p2beta1/services/asset_service/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p2beta1/services/asset_service/async_client.py b/google/cloud/asset_v1p2beta1/services/asset_service/async_client.py index 0eb69ae7..45a6aa67 100644 --- a/google/cloud/asset_v1p2beta1/services/asset_service/async_client.py +++ b/google/cloud/asset_v1p2beta1/services/asset_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -283,6 +283,7 @@ async def sample_create_feed(): exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Cloud Pub/Sub topics. """ @@ -391,6 +392,7 @@ async def sample_get_feed(): exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Cloud Pub/Sub topics. """ @@ -627,6 +629,7 @@ async def sample_update_feed(): exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Cloud Pub/Sub topics. """ @@ -775,7 +778,7 @@ async def sample_delete_feed(): metadata=metadata, ) - async def __aenter__(self): + async def __aenter__(self) -> "AssetServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/asset_v1p2beta1/services/asset_service/client.py b/google/cloud/asset_v1p2beta1/services/asset_service/client.py index e858ecd5..1a770778 100644 --- a/google/cloud/asset_v1p2beta1/services/asset_service/client.py +++ b/google/cloud/asset_v1p2beta1/services/asset_service/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -509,6 +509,7 @@ def sample_create_feed(): exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Cloud Pub/Sub topics. """ @@ -617,6 +618,7 @@ def sample_get_feed(): exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Cloud Pub/Sub topics. """ @@ -833,6 +835,7 @@ def sample_update_feed(): exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Cloud Pub/Sub topics. """ diff --git a/google/cloud/asset_v1p2beta1/services/asset_service/transports/__init__.py b/google/cloud/asset_v1p2beta1/services/asset_service/transports/__init__.py index 58f49f56..793ae8e8 100644 --- a/google/cloud/asset_v1p2beta1/services/asset_service/transports/__init__.py +++ b/google/cloud/asset_v1p2beta1/services/asset_service/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p2beta1/services/asset_service/transports/base.py b/google/cloud/asset_v1p2beta1/services/asset_service/transports/base.py index 611a2c29..c6228c5c 100644 --- a/google/cloud/asset_v1p2beta1/services/asset_service/transports/base.py +++ b/google/cloud/asset_v1p2beta1/services/asset_service/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p2beta1/services/asset_service/transports/grpc.py b/google/cloud/asset_v1p2beta1/services/asset_service/transports/grpc.py index 1e238527..143a3476 100644 --- a/google/cloud/asset_v1p2beta1/services/asset_service/transports/grpc.py +++ b/google/cloud/asset_v1p2beta1/services/asset_service/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p2beta1/services/asset_service/transports/grpc_asyncio.py b/google/cloud/asset_v1p2beta1/services/asset_service/transports/grpc_asyncio.py index f9d2f333..95031c49 100644 --- a/google/cloud/asset_v1p2beta1/services/asset_service/transports/grpc_asyncio.py +++ b/google/cloud/asset_v1p2beta1/services/asset_service/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p2beta1/services/asset_service/transports/rest.py b/google/cloud/asset_v1p2beta1/services/asset_service/transports/rest.py index 8899653d..fc6a897f 100644 --- a/google/cloud/asset_v1p2beta1/services/asset_service/transports/rest.py +++ b/google/cloud/asset_v1p2beta1/services/asset_service/transports/rest.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -343,6 +343,7 @@ def __call__( exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Cloud Pub/Sub topics. """ @@ -519,6 +520,7 @@ def __call__( exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Cloud Pub/Sub topics. """ @@ -698,6 +700,7 @@ def __call__( exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Cloud Pub/Sub topics. """ diff --git a/google/cloud/asset_v1p2beta1/types/__init__.py b/google/cloud/asset_v1p2beta1/types/__init__.py index 90bd5612..af3f0005 100644 --- a/google/cloud/asset_v1p2beta1/types/__init__.py +++ b/google/cloud/asset_v1p2beta1/types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p2beta1/types/asset_service.py b/google/cloud/asset_v1p2beta1/types/asset_service.py index afc7cf02..95aedc4e 100644 --- a/google/cloud/asset_v1p2beta1/types/asset_service.py +++ b/google/cloud/asset_v1p2beta1/types/asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -277,6 +277,7 @@ class Feed(proto.Message): An asset feed filter controls what updates are exported. The asset feed must be created within a project, organization, or folder. Supported destinations are: + Cloud Pub/Sub topics. Attributes: diff --git a/google/cloud/asset_v1p2beta1/types/assets.py b/google/cloud/asset_v1p2beta1/types/assets.py index 915862a1..5e90d36b 100644 --- a/google/cloud/asset_v1p2beta1/types/assets.py +++ b/google/cloud/asset_v1p2beta1/types/assets.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p4beta1/gapic_version.py b/google/cloud/asset_v1p4beta1/gapic_version.py index 4e343f66..2822f44a 100644 --- a/google/cloud/asset_v1p4beta1/gapic_version.py +++ b/google/cloud/asset_v1p4beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "3.19.0" # {x-release-please-version} +__version__ = "3.19.1" # {x-release-please-version} diff --git a/google/cloud/asset_v1p5beta1/__init__.py b/google/cloud/asset_v1p5beta1/__init__.py index 56cf5efa..84d3d573 100644 --- a/google/cloud/asset_v1p5beta1/__init__.py +++ b/google/cloud/asset_v1p5beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p5beta1/gapic_version.py b/google/cloud/asset_v1p5beta1/gapic_version.py index 4e343f66..2822f44a 100644 --- a/google/cloud/asset_v1p5beta1/gapic_version.py +++ b/google/cloud/asset_v1p5beta1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "3.19.0" # {x-release-please-version} +__version__ = "3.19.1" # {x-release-please-version} diff --git a/google/cloud/asset_v1p5beta1/services/__init__.py b/google/cloud/asset_v1p5beta1/services/__init__.py index e8e1c384..89a37dc9 100644 --- a/google/cloud/asset_v1p5beta1/services/__init__.py +++ b/google/cloud/asset_v1p5beta1/services/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p5beta1/services/asset_service/__init__.py b/google/cloud/asset_v1p5beta1/services/asset_service/__init__.py index 4af01a66..13e0e330 100644 --- a/google/cloud/asset_v1p5beta1/services/asset_service/__init__.py +++ b/google/cloud/asset_v1p5beta1/services/asset_service/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p5beta1/services/asset_service/async_client.py b/google/cloud/asset_v1p5beta1/services/asset_service/async_client.py index 8a56b6bc..0a5f7ba9 100644 --- a/google/cloud/asset_v1p5beta1/services/asset_service/async_client.py +++ b/google/cloud/asset_v1p5beta1/services/asset_service/async_client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ from google.cloud.asset_v1p5beta1.services.asset_service import pagers from google.cloud.asset_v1p5beta1.types import asset_service from google.cloud.asset_v1p5beta1.types import assets -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore from .transports.base import AssetServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import AssetServiceGrpcAsyncIOTransport from .client import AssetServiceClient @@ -280,6 +280,7 @@ async def sample_list_assets(): Returns: google.cloud.asset_v1p5beta1.services.asset_service.pagers.ListAssetsAsyncPager: ListAssets response. + Iterating over this object will yield results and resolve additional pages automatically. @@ -346,7 +347,7 @@ async def sample_list_assets(): # Done; return the response. return response - async def __aenter__(self): + async def __aenter__(self) -> "AssetServiceAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): diff --git a/google/cloud/asset_v1p5beta1/services/asset_service/client.py b/google/cloud/asset_v1p5beta1/services/asset_service/client.py index d1670775..299c6fcf 100644 --- a/google/cloud/asset_v1p5beta1/services/asset_service/client.py +++ b/google/cloud/asset_v1p5beta1/services/asset_service/client.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ from google.cloud.asset_v1p5beta1.services.asset_service import pagers from google.cloud.asset_v1p5beta1.types import asset_service from google.cloud.asset_v1p5beta1.types import assets -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore from .transports.base import AssetServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import AssetServiceGrpcTransport from .transports.grpc_asyncio import AssetServiceGrpcAsyncIOTransport @@ -541,6 +541,7 @@ def sample_list_assets(): Returns: google.cloud.asset_v1p5beta1.services.asset_service.pagers.ListAssetsPager: ListAssets response. + Iterating over this object will yield results and resolve additional pages automatically. diff --git a/google/cloud/asset_v1p5beta1/services/asset_service/pagers.py b/google/cloud/asset_v1p5beta1/services/asset_service/pagers.py index 026619cb..87ad1332 100644 --- a/google/cloud/asset_v1p5beta1/services/asset_service/pagers.py +++ b/google/cloud/asset_v1p5beta1/services/asset_service/pagers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p5beta1/services/asset_service/transports/__init__.py b/google/cloud/asset_v1p5beta1/services/asset_service/transports/__init__.py index 58f49f56..793ae8e8 100644 --- a/google/cloud/asset_v1p5beta1/services/asset_service/transports/__init__.py +++ b/google/cloud/asset_v1p5beta1/services/asset_service/transports/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p5beta1/services/asset_service/transports/base.py b/google/cloud/asset_v1p5beta1/services/asset_service/transports/base.py index e26f202f..06e71404 100644 --- a/google/cloud/asset_v1p5beta1/services/asset_service/transports/base.py +++ b/google/cloud/asset_v1p5beta1/services/asset_service/transports/base.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ from google.oauth2 import service_account # type: ignore from google.cloud.asset_v1p5beta1.types import asset_service -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( gapic_version=package_version.__version__ diff --git a/google/cloud/asset_v1p5beta1/services/asset_service/transports/grpc.py b/google/cloud/asset_v1p5beta1/services/asset_service/transports/grpc.py index 2b98ffe7..05cb35f1 100644 --- a/google/cloud/asset_v1p5beta1/services/asset_service/transports/grpc.py +++ b/google/cloud/asset_v1p5beta1/services/asset_service/transports/grpc.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import grpc # type: ignore from google.cloud.asset_v1p5beta1.types import asset_service -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore from .base import AssetServiceTransport, DEFAULT_CLIENT_INFO diff --git a/google/cloud/asset_v1p5beta1/services/asset_service/transports/grpc_asyncio.py b/google/cloud/asset_v1p5beta1/services/asset_service/transports/grpc_asyncio.py index d5ed9fec..71fa2d76 100644 --- a/google/cloud/asset_v1p5beta1/services/asset_service/transports/grpc_asyncio.py +++ b/google/cloud/asset_v1p5beta1/services/asset_service/transports/grpc_asyncio.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ from grpc.experimental import aio # type: ignore from google.cloud.asset_v1p5beta1.types import asset_service -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore from .base import AssetServiceTransport, DEFAULT_CLIENT_INFO from .grpc import AssetServiceGrpcTransport diff --git a/google/cloud/asset_v1p5beta1/services/asset_service/transports/rest.py b/google/cloud/asset_v1p5beta1/services/asset_service/transports/rest.py index af592133..7022a395 100644 --- a/google/cloud/asset_v1p5beta1/services/asset_service/transports/rest.py +++ b/google/cloud/asset_v1p5beta1/services/asset_service/transports/rest.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,7 +27,6 @@ from google.api_core import gapic_v1 from google.protobuf import json_format -from google.longrunning import operations_pb2 from requests import __version__ as requests_version import dataclasses import re @@ -41,6 +40,7 @@ from google.cloud.asset_v1p5beta1.types import asset_service +from google.longrunning import operations_pb2 # type: ignore from .base import AssetServiceTransport, DEFAULT_CLIENT_INFO as BASE_DEFAULT_CLIENT_INFO diff --git a/google/cloud/asset_v1p5beta1/types/__init__.py b/google/cloud/asset_v1p5beta1/types/__init__.py index fbb8dc99..6d1907a2 100644 --- a/google/cloud/asset_v1p5beta1/types/__init__.py +++ b/google/cloud/asset_v1p5beta1/types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p5beta1/types/asset_service.py b/google/cloud/asset_v1p5beta1/types/asset_service.py index 3e0f7978..aec01957 100644 --- a/google/cloud/asset_v1p5beta1/types/asset_service.py +++ b/google/cloud/asset_v1p5beta1/types/asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/asset_v1p5beta1/types/assets.py b/google/cloud/asset_v1p5beta1/types/assets.py index 13d775c5..64c98432 100644 --- a/google/cloud/asset_v1p5beta1/types/assets.py +++ b/google/cloud/asset_v1p5beta1/types/assets.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/noxfile.py b/noxfile.py index 91a45415..fc49ce9e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2018 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,21 +17,24 @@ # Generated by synthtool. DO NOT EDIT! from __future__ import absolute_import + import os import pathlib import re import shutil +from typing import Dict, List import warnings import nox -BLACK_VERSION = "black==22.3.0" -ISORT_VERSION = "isort==5.10.1" +FLAKE8_VERSION = "flake8==6.1.0" +BLACK_VERSION = "black[jupyter]==23.7.0" +ISORT_VERSION = "isort==5.11.0" LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" -UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"] +UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"] UNIT_TEST_STANDARD_DEPENDENCIES = [ "mock", "asyncmock", @@ -39,23 +42,23 @@ "pytest-cov", "pytest-asyncio", ] -UNIT_TEST_EXTERNAL_DEPENDENCIES = [] -UNIT_TEST_LOCAL_DEPENDENCIES = [] -UNIT_TEST_DEPENDENCIES = [] -UNIT_TEST_EXTRAS = [] -UNIT_TEST_EXTRAS_BY_PYTHON = {} - -SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] -SYSTEM_TEST_STANDARD_DEPENDENCIES = [ +UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = [] +UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = [] +UNIT_TEST_DEPENDENCIES: List[str] = [] +UNIT_TEST_EXTRAS: List[str] = [] +UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} + +SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8"] +SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [ "mock", "pytest", "google-cloud-testutils", ] -SYSTEM_TEST_EXTERNAL_DEPENDENCIES = [] -SYSTEM_TEST_LOCAL_DEPENDENCIES = [] -SYSTEM_TEST_DEPENDENCIES = [] -SYSTEM_TEST_EXTRAS = [] -SYSTEM_TEST_EXTRAS_BY_PYTHON = {} +SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = [] +SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = [] +SYSTEM_TEST_DEPENDENCIES: List[str] = [] +SYSTEM_TEST_EXTRAS: List[str] = [] +SYSTEM_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {} CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -68,6 +71,7 @@ "lint_setup_py", "blacken", "docs", + "format", ] # Error if a python version is missing @@ -81,7 +85,7 @@ def lint(session): Returns a failure if the linters find linting errors or sufficiently serious code quality issues. """ - session.install("flake8", BLACK_VERSION) + session.install(FLAKE8_VERSION, BLACK_VERSION) session.run( "black", "--check", @@ -186,7 +190,6 @@ def unit(session): def install_systemtest_dependencies(session, *constraints): - # Use pre-release gRPC for system tests. # Exclude version 1.52.0rc1 which has a known issue. # See https://github.com/grpc/grpc/issues/32163 @@ -304,10 +307,9 @@ def docfx(session): session.install("-e", ".") session.install( - "sphinx==4.0.1", + "gcp-sphinx-docfx-yaml", "alabaster", "recommonmark", - "gcp-sphinx-docfx-yaml", ) shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) @@ -379,6 +381,7 @@ def prerelease_deps(session): "grpcio!=1.52.0rc1", "grpcio-status", "google-api-core", + "google-auth", "proto-plus", "google-cloud-testutils", # dependencies of google-cloud-testutils" @@ -391,7 +394,6 @@ def prerelease_deps(session): # Remaining dependencies other_deps = [ "requests", - "google-auth", ] session.install(*other_deps) @@ -400,6 +402,7 @@ def prerelease_deps(session): "python", "-c", "import google.protobuf; print(google.protobuf.__version__)" ) session.run("python", "-c", "import grpc; print(grpc.__version__)") + session.run("python", "-c", "import google.auth; print(google.auth.__version__)") session.run("py.test", "tests/unit") diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_async.py index f9caabe8..4a13b281 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_async.py index 0fbd7944..47fb7196 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_sync.py index dd4fb419..5f29caec 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_sync.py index 3d592e39..c2aa7028 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_iam_policy_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_move_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_move_async.py index a8a8ec86..377f2e12 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_move_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_move_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_move_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_move_sync.py index 527907dc..5ec453c1 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_move_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_move_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policies_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policies_async.py index daddf101..625f3dec 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policies_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policies_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policies_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policies_sync.py index 9bf4daa8..892f5a15 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policies_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policies_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_assets_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_assets_async.py index a78b3f84..81b67efb 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_assets_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_assets_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_assets_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_assets_sync.py index 1b76fda2..86aca87d 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_assets_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_assets_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_containers_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_containers_async.py index b45bd064..3a24500e 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_containers_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_containers_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_containers_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_containers_sync.py index f3a4d7cd..4aa243c9 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_containers_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_analyze_org_policy_governed_containers_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_assets_history_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_assets_history_async.py index a54a5e1d..6dd1e1dc 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_assets_history_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_assets_history_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_assets_history_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_assets_history_sync.py index 5df919fe..87e233fb 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_assets_history_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_assets_history_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_effective_iam_policies_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_effective_iam_policies_async.py index 13d9c133..30ef0c4e 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_effective_iam_policies_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_effective_iam_policies_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_effective_iam_policies_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_effective_iam_policies_sync.py index 5f003121..f64e953a 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_effective_iam_policies_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_batch_get_effective_iam_policies_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_create_feed_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_create_feed_async.py index 668903c5..f5aaf9a0 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_create_feed_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_create_feed_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_create_feed_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_create_feed_sync.py index ce7b974b..4ef06854 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_create_feed_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_create_feed_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_create_saved_query_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_create_saved_query_async.py index 4d5b5286..b495af66 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_create_saved_query_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_create_saved_query_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_create_saved_query_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_create_saved_query_sync.py index 5dd1e4d4..bdebace2 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_create_saved_query_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_create_saved_query_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_feed_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_feed_async.py index 0dcea55a..cd3fab7c 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_feed_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_feed_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_feed_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_feed_sync.py index 735baf2c..b6edad9d 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_feed_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_feed_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_saved_query_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_saved_query_async.py index 78856627..40cdf7f6 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_saved_query_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_saved_query_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_saved_query_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_saved_query_sync.py index f2cbe896..29d2ed16 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_saved_query_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_delete_saved_query_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_async.py index 36815d3c..bc593077 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_sync.py index 60816961..0e402bbf 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_export_assets_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_get_feed_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_get_feed_async.py index b5b9a6e1..75bdd2fd 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_get_feed_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_get_feed_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_get_feed_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_get_feed_sync.py index 41d11939..01cd552c 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_get_feed_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_get_feed_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_get_saved_query_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_get_saved_query_async.py index d6605762..7f218510 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_get_saved_query_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_get_saved_query_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_get_saved_query_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_get_saved_query_sync.py index d4a55682..947c761d 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_get_saved_query_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_get_saved_query_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_list_assets_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_list_assets_async.py index 65ef19c8..91bc6e83 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_list_assets_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_list_assets_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_list_assets_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_list_assets_sync.py index f2e41b18..cbd05991 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_list_assets_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_list_assets_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_list_feeds_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_list_feeds_async.py index 88f0613f..52059178 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_list_feeds_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_list_feeds_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_list_feeds_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_list_feeds_sync.py index 3ee6b48b..2c516167 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_list_feeds_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_list_feeds_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_list_saved_queries_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_list_saved_queries_async.py index e3f3b95c..c4be56a4 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_list_saved_queries_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_list_saved_queries_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_list_saved_queries_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_list_saved_queries_sync.py index 262f82c0..9825502a 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_list_saved_queries_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_list_saved_queries_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_query_assets_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_query_assets_async.py index 79714d1b..bd68125c 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_query_assets_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_query_assets_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_query_assets_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_query_assets_sync.py index 59322833..e64414fd 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_query_assets_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_query_assets_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_iam_policies_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_iam_policies_async.py index 367eae93..f99c4503 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_iam_policies_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_iam_policies_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_iam_policies_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_iam_policies_sync.py index ca656c39..2095ee02 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_iam_policies_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_iam_policies_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_resources_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_resources_async.py index 1757ab26..6e228419 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_resources_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_resources_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_resources_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_resources_sync.py index 770ee767..4a82b7eb 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_resources_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_search_all_resources_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_update_feed_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_update_feed_async.py index fe93ab55..80d4dca4 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_update_feed_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_update_feed_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_update_feed_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_update_feed_sync.py index 320e04de..da3483f2 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_update_feed_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_update_feed_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_update_saved_query_async.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_update_saved_query_async.py index 7ad44fd0..56aaab9f 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_update_saved_query_async.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_update_saved_query_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1_generated_asset_service_update_saved_query_sync.py b/samples/generated_samples/cloudasset_v1_generated_asset_service_update_saved_query_sync.py index c050a417..ef6a45d6 100644 --- a/samples/generated_samples/cloudasset_v1_generated_asset_service_update_saved_query_sync.py +++ b/samples/generated_samples/cloudasset_v1_generated_asset_service_update_saved_query_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_iam_policies_async.py b/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_iam_policies_async.py index 1f459565..eeab16da 100644 --- a/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_iam_policies_async.py +++ b/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_iam_policies_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_iam_policies_sync.py b/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_iam_policies_sync.py index 946a0c14..1198c482 100644 --- a/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_iam_policies_sync.py +++ b/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_iam_policies_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_resources_async.py b/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_resources_async.py index 6f839c0a..173f0087 100644 --- a/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_resources_async.py +++ b/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_resources_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_resources_sync.py b/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_resources_sync.py index 5584a896..fe079175 100644 --- a/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_resources_sync.py +++ b/samples/generated_samples/cloudasset_v1p1beta1_generated_asset_service_search_all_resources_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_create_feed_async.py b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_create_feed_async.py index f3c3879c..f67a4091 100644 --- a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_create_feed_async.py +++ b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_create_feed_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_create_feed_sync.py b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_create_feed_sync.py index 933431eb..81a02f1e 100644 --- a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_create_feed_sync.py +++ b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_create_feed_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_delete_feed_async.py b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_delete_feed_async.py index f00385fd..6cdb9735 100644 --- a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_delete_feed_async.py +++ b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_delete_feed_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_delete_feed_sync.py b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_delete_feed_sync.py index 74d79127..344ec815 100644 --- a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_delete_feed_sync.py +++ b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_delete_feed_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_get_feed_async.py b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_get_feed_async.py index e55b49dc..fe72e7dd 100644 --- a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_get_feed_async.py +++ b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_get_feed_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_get_feed_sync.py b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_get_feed_sync.py index b9118709..d195101d 100644 --- a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_get_feed_sync.py +++ b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_get_feed_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_list_feeds_async.py b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_list_feeds_async.py index 871b6565..075192eb 100644 --- a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_list_feeds_async.py +++ b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_list_feeds_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_list_feeds_sync.py b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_list_feeds_sync.py index 61620d23..75cf95b5 100644 --- a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_list_feeds_sync.py +++ b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_list_feeds_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_update_feed_async.py b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_update_feed_async.py index f310678d..9dcdad41 100644 --- a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_update_feed_async.py +++ b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_update_feed_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_update_feed_sync.py b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_update_feed_sync.py index f87e674b..697a6e4b 100644 --- a/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_update_feed_sync.py +++ b/samples/generated_samples/cloudasset_v1p2beta1_generated_asset_service_update_feed_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p5beta1_generated_asset_service_list_assets_async.py b/samples/generated_samples/cloudasset_v1p5beta1_generated_asset_service_list_assets_async.py index a9fcadaf..2f32e298 100644 --- a/samples/generated_samples/cloudasset_v1p5beta1_generated_asset_service_list_assets_async.py +++ b/samples/generated_samples/cloudasset_v1p5beta1_generated_asset_service_list_assets_async.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudasset_v1p5beta1_generated_asset_service_list_assets_sync.py b/samples/generated_samples/cloudasset_v1p5beta1_generated_asset_service_list_assets_sync.py index 413c369c..3c5deb0a 100644 --- a/samples/generated_samples/cloudasset_v1p5beta1_generated_asset_service_list_assets_sync.py +++ b/samples/generated_samples/cloudasset_v1p5beta1_generated_asset_service_list_assets_sync.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/decrypt-secrets.sh b/scripts/decrypt-secrets.sh index 21f6d2a2..0018b421 100755 --- a/scripts/decrypt-secrets.sh +++ b/scripts/decrypt-secrets.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2015 Google Inc. All rights reserved. +# Copyright 2023 Google LLC All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/fixup_asset_v1_keywords.py b/scripts/fixup_asset_v1_keywords.py index 778c2c6c..979373d9 100644 --- a/scripts/fixup_asset_v1_keywords.py +++ b/scripts/fixup_asset_v1_keywords.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/fixup_asset_v1p1beta1_keywords.py b/scripts/fixup_asset_v1p1beta1_keywords.py index 3a8adae1..1846c478 100644 --- a/scripts/fixup_asset_v1p1beta1_keywords.py +++ b/scripts/fixup_asset_v1p1beta1_keywords.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/fixup_asset_v1p2beta1_keywords.py b/scripts/fixup_asset_v1p2beta1_keywords.py index cde2d7d3..f6174e16 100644 --- a/scripts/fixup_asset_v1p2beta1_keywords.py +++ b/scripts/fixup_asset_v1p2beta1_keywords.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/fixup_asset_v1p5beta1_keywords.py b/scripts/fixup_asset_v1p5beta1_keywords.py index 70552c56..ec38c673 100644 --- a/scripts/fixup_asset_v1p5beta1_keywords.py +++ b/scripts/fixup_asset_v1p5beta1_keywords.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py index 91b59676..1acc1198 100644 --- a/scripts/readme-gen/readme_gen.py +++ b/scripts/readme-gen/readme_gen.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright 2016 Google Inc +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -33,17 +33,17 @@ autoescape=True, ) -README_TMPL = jinja_env.get_template('README.tmpl.rst') +README_TMPL = jinja_env.get_template("README.tmpl.rst") def get_help(file): - return subprocess.check_output(['python', file, '--help']).decode() + return subprocess.check_output(["python", file, "--help"]).decode() def main(): parser = argparse.ArgumentParser() - parser.add_argument('source') - parser.add_argument('--destination', default='README.rst') + parser.add_argument("source") + parser.add_argument("--destination", default="README.rst") args = parser.parse_args() @@ -51,9 +51,9 @@ def main(): root = os.path.dirname(source) destination = os.path.join(root, args.destination) - jinja_env.globals['get_help'] = get_help + jinja_env.globals["get_help"] = get_help - with io.open(source, 'r') as f: + with io.open(source, "r") as f: config = yaml.load(f) # This allows get_help to execute in the right directory. @@ -61,9 +61,9 @@ def main(): output = README_TMPL.render(config) - with io.open(destination, 'w') as f: + with io.open(destination, "w") as f: f.write(output) -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/setup.cfg b/setup.cfg index c3a2b39f..05235008 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright 2020 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/__init__.py b/tests/__init__.py index e8e1c384..89a37dc9 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py index e8e1c384..89a37dc9 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/__init__.py b/tests/unit/gapic/__init__.py index e8e1c384..89a37dc9 100644 --- a/tests/unit/gapic/__init__.py +++ b/tests/unit/gapic/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/asset_v1/__init__.py b/tests/unit/gapic/asset_v1/__init__.py index e8e1c384..89a37dc9 100644 --- a/tests/unit/gapic/asset_v1/__init__.py +++ b/tests/unit/gapic/asset_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/asset_v1/test_asset_service.py b/tests/unit/gapic/asset_v1/test_asset_service.py index a13ce647..cdbb6676 100644 --- a/tests/unit/gapic/asset_v1/test_asset_service.py +++ b/tests/unit/gapic/asset_v1/test_asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -54,7 +54,7 @@ from google.cloud.asset_v1.services.asset_service import transports from google.cloud.asset_v1.types import asset_service from google.cloud.asset_v1.types import assets -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -1258,9 +1258,11 @@ async def test_list_assets_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_assets(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3054,9 +3056,11 @@ async def test_search_all_resources_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.search_all_resources(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3507,9 +3511,11 @@ async def test_search_all_iam_policies_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.search_all_iam_policies(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3997,7 +4003,6 @@ def test_query_assets(request_type, transport: str = "grpc"): call.return_value = asset_service.QueryAssetsResponse( job_reference="job_reference_value", done=True, - error=status_pb2.Status(code=411), ) response = client.query_assets(request) @@ -5085,9 +5090,11 @@ async def test_list_saved_queries_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_saved_queries(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6211,9 +6218,11 @@ async def test_analyze_org_policies_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.analyze_org_policies(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -6686,9 +6695,11 @@ async def test_analyze_org_policy_governed_containers_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.analyze_org_policy_governed_containers(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7159,9 +7170,11 @@ async def test_analyze_org_policy_governed_assets_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.analyze_org_policy_governed_assets(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -7411,8 +7424,9 @@ def test_list_assets_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListAssetsResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListAssetsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -7496,8 +7510,9 @@ def test_list_assets_rest_required_fields(request_type=asset_service.ListAssetsR response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListAssetsResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListAssetsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -7634,8 +7649,9 @@ def test_list_assets_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListAssetsResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListAssetsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -7751,8 +7767,9 @@ def test_batch_get_assets_history_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.BatchGetAssetsHistoryResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.BatchGetAssetsHistoryResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -7835,10 +7852,9 @@ def test_batch_get_assets_history_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.BatchGetAssetsHistoryResponse.pb( - return_value - ) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.BatchGetAssetsHistoryResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -7987,8 +8003,9 @@ def test_create_feed_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -8070,8 +8087,9 @@ def test_create_feed_rest_required_fields(request_type=asset_service.CreateFeedR response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -8203,8 +8221,9 @@ def test_create_feed_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -8271,8 +8290,9 @@ def test_get_feed_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -8349,8 +8369,9 @@ def test_get_feed_rest_required_fields(request_type=asset_service.GetFeedRequest response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -8471,8 +8492,9 @@ def test_get_feed_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -8533,8 +8555,9 @@ def test_list_feeds_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListFeedsResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListFeedsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -8606,8 +8629,9 @@ def test_list_feeds_rest_required_fields(request_type=asset_service.ListFeedsReq response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListFeedsResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListFeedsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -8730,8 +8754,9 @@ def test_list_feeds_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListFeedsResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListFeedsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -8798,8 +8823,9 @@ def test_update_feed_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -8872,8 +8898,9 @@ def test_update_feed_rest_required_fields(request_type=asset_service.UpdateFeedR response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -9004,8 +9031,9 @@ def test_update_feed_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -9317,8 +9345,9 @@ def test_search_all_resources_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SearchAllResourcesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SearchAllResourcesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -9404,8 +9433,9 @@ def test_search_all_resources_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SearchAllResourcesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SearchAllResourcesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -9544,8 +9574,9 @@ def test_search_all_resources_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SearchAllResourcesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SearchAllResourcesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -9667,8 +9698,9 @@ def test_search_all_iam_policies_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SearchAllIamPoliciesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SearchAllIamPoliciesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -9753,10 +9785,9 @@ def test_search_all_iam_policies_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SearchAllIamPoliciesResponse.pb( - return_value - ) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SearchAllIamPoliciesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -9893,8 +9924,9 @@ def test_search_all_iam_policies_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SearchAllIamPoliciesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SearchAllIamPoliciesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -10015,8 +10047,9 @@ def test_analyze_iam_policy_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.AnalyzeIamPolicyResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.AnalyzeIamPolicyResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -10094,8 +10127,9 @@ def test_analyze_iam_policy_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.AnalyzeIamPolicyResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.AnalyzeIamPolicyResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -10452,8 +10486,9 @@ def test_analyze_move_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.AnalyzeMoveResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.AnalyzeMoveResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -10541,8 +10576,9 @@ def test_analyze_move_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.AnalyzeMoveResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.AnalyzeMoveResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -10692,14 +10728,14 @@ def test_query_assets_rest(request_type): return_value = asset_service.QueryAssetsResponse( job_reference="job_reference_value", done=True, - error=status_pb2.Status(code=411), ) # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.QueryAssetsResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.QueryAssetsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -10776,8 +10812,9 @@ def test_query_assets_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.QueryAssetsResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.QueryAssetsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -10929,6 +10966,70 @@ def test_create_saved_query_rest(request_type): } }, } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = asset_service.CreateSavedQueryRequest.meta.fields["saved_query"] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + else: + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + for field, value in request_init["saved_query"].items(): + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + for subfield_to_delete in subfields_not_in_runtime: + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range(0, len(request_init["saved_query"][field])): + del request_init["saved_query"][field][i][subfield] + else: + del request_init["saved_query"][field][subfield] request = request_type(**request_init) # Mock the http request call within the method and fake a response. @@ -10944,8 +11045,9 @@ def test_create_saved_query_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SavedQuery.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SavedQuery.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -11033,8 +11135,9 @@ def test_create_saved_query_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SavedQuery.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SavedQuery.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -11137,35 +11240,6 @@ def test_create_saved_query_rest_bad_request( # send a request that will satisfy transcoding request_init = {"parent": "sample1/sample2"} - request_init["saved_query"] = { - "name": "name_value", - "description": "description_value", - "create_time": {"seconds": 751, "nanos": 543}, - "creator": "creator_value", - "last_update_time": {}, - "last_updater": "last_updater_value", - "labels": {}, - "content": { - "iam_policy_analysis_query": { - "scope": "scope_value", - "resource_selector": {"full_resource_name": "full_resource_name_value"}, - "identity_selector": {"identity": "identity_value"}, - "access_selector": { - "roles": ["roles_value1", "roles_value2"], - "permissions": ["permissions_value1", "permissions_value2"], - }, - "options": { - "expand_groups": True, - "expand_roles": True, - "expand_resources": True, - "output_resource_edges": True, - "output_group_edges": True, - "analyze_service_account_impersonation": True, - }, - "condition_context": {"access_time": {}}, - } - }, - } request = request_type(**request_init) # Mock the http request call within the method and fake a BadRequest error. @@ -11205,8 +11279,9 @@ def test_create_saved_query_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SavedQuery.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SavedQuery.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -11274,8 +11349,9 @@ def test_get_saved_query_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SavedQuery.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SavedQuery.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -11353,8 +11429,9 @@ def test_get_saved_query_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SavedQuery.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SavedQuery.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -11479,8 +11556,9 @@ def test_get_saved_query_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SavedQuery.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SavedQuery.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -11543,8 +11621,9 @@ def test_list_saved_queries_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListSavedQueriesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListSavedQueriesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -11627,8 +11706,9 @@ def test_list_saved_queries_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListSavedQueriesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListSavedQueriesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -11762,8 +11842,9 @@ def test_list_saved_queries_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListSavedQueriesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListSavedQueriesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -11900,6 +11981,70 @@ def test_update_saved_query_rest(request_type): } }, } + # The version of a generated dependency at test runtime may differ from the version used during generation. + # Delete any fields which are not present in the current runtime dependency + # See https://github.com/googleapis/gapic-generator-python/issues/1748 + + # Determine if the message type is proto-plus or protobuf + test_field = asset_service.UpdateSavedQueryRequest.meta.fields["saved_query"] + + def get_message_fields(field): + # Given a field which is a message (composite type), return a list with + # all the fields of the message. + # If the field is not a composite type, return an empty list. + message_fields = [] + + if hasattr(field, "message") and field.message: + is_field_type_proto_plus_type = not hasattr(field.message, "DESCRIPTOR") + + if is_field_type_proto_plus_type: + message_fields = field.message.meta.fields.values() + else: + message_fields = field.message.DESCRIPTOR.fields + return message_fields + + runtime_nested_fields = [ + (field.name, nested_field.name) + for field in get_message_fields(test_field) + for nested_field in get_message_fields(field) + ] + + subfields_not_in_runtime = [] + + # For each item in the sample request, create a list of sub fields which are not present at runtime + for field, value in request_init["saved_query"].items(): + result = None + is_repeated = False + # For repeated fields + if isinstance(value, list) and len(value): + is_repeated = True + result = value[0] + # For fields where the type is another message + if isinstance(value, dict): + result = value + + if result and hasattr(result, "keys"): + for subfield in result.keys(): + if (field, subfield) not in runtime_nested_fields: + subfields_not_in_runtime.append( + { + "field": field, + "subfield": subfield, + "is_repeated": is_repeated, + } + ) + + # Remove fields from the sample request which are not present in the runtime version of the dependency + for subfield_to_delete in subfields_not_in_runtime: + field = subfield_to_delete.get("field") + field_repeated = subfield_to_delete.get("is_repeated") + subfield = subfield_to_delete.get("subfield") + if subfield: + if field_repeated: + for i in range(0, len(request_init["saved_query"][field])): + del request_init["saved_query"][field][i][subfield] + else: + del request_init["saved_query"][field][subfield] request = request_type(**request_init) # Mock the http request call within the method and fake a response. @@ -11915,8 +12060,9 @@ def test_update_saved_query_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SavedQuery.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SavedQuery.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -11992,8 +12138,9 @@ def test_update_saved_query_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SavedQuery.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SavedQuery.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -12089,35 +12236,6 @@ def test_update_saved_query_rest_bad_request( # send a request that will satisfy transcoding request_init = {"saved_query": {"name": "sample1/sample2/savedQueries/sample3"}} - request_init["saved_query"] = { - "name": "sample1/sample2/savedQueries/sample3", - "description": "description_value", - "create_time": {"seconds": 751, "nanos": 543}, - "creator": "creator_value", - "last_update_time": {}, - "last_updater": "last_updater_value", - "labels": {}, - "content": { - "iam_policy_analysis_query": { - "scope": "scope_value", - "resource_selector": {"full_resource_name": "full_resource_name_value"}, - "identity_selector": {"identity": "identity_value"}, - "access_selector": { - "roles": ["roles_value1", "roles_value2"], - "permissions": ["permissions_value1", "permissions_value2"], - }, - "options": { - "expand_groups": True, - "expand_roles": True, - "expand_resources": True, - "output_resource_edges": True, - "output_group_edges": True, - "analyze_service_account_impersonation": True, - }, - "condition_context": {"access_time": {}}, - } - }, - } request = request_type(**request_init) # Mock the http request call within the method and fake a BadRequest error. @@ -12158,8 +12276,9 @@ def test_update_saved_query_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SavedQuery.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SavedQuery.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -12473,10 +12592,11 @@ def test_batch_get_effective_iam_policies_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.BatchGetEffectiveIamPoliciesResponse.pb( + # Convert return value to protobuf type + return_value = asset_service.BatchGetEffectiveIamPoliciesResponse.pb( return_value ) - json_return_value = json_format.MessageToJson(pb_return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -12559,10 +12679,11 @@ def test_batch_get_effective_iam_policies_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.BatchGetEffectiveIamPoliciesResponse.pb( + # Convert return value to protobuf type + return_value = asset_service.BatchGetEffectiveIamPoliciesResponse.pb( return_value ) - json_return_value = json_format.MessageToJson(pb_return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -12716,8 +12837,9 @@ def test_analyze_org_policies_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.AnalyzeOrgPoliciesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.AnalyzeOrgPoliciesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -12808,8 +12930,9 @@ def test_analyze_org_policies_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.AnalyzeOrgPoliciesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.AnalyzeOrgPoliciesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -12957,8 +13080,9 @@ def test_analyze_org_policies_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.AnalyzeOrgPoliciesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.AnalyzeOrgPoliciesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -13083,10 +13207,11 @@ def test_analyze_org_policy_governed_containers_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.AnalyzeOrgPolicyGovernedContainersResponse.pb( + # Convert return value to protobuf type + return_value = asset_service.AnalyzeOrgPolicyGovernedContainersResponse.pb( return_value ) - json_return_value = json_format.MessageToJson(pb_return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -13181,12 +13306,11 @@ def test_analyze_org_policy_governed_containers_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = ( - asset_service.AnalyzeOrgPolicyGovernedContainersResponse.pb( - return_value - ) + # Convert return value to protobuf type + return_value = asset_service.AnalyzeOrgPolicyGovernedContainersResponse.pb( + return_value ) - json_return_value = json_format.MessageToJson(pb_return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -13341,10 +13465,11 @@ def test_analyze_org_policy_governed_containers_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.AnalyzeOrgPolicyGovernedContainersResponse.pb( + # Convert return value to protobuf type + return_value = asset_service.AnalyzeOrgPolicyGovernedContainersResponse.pb( return_value ) - json_return_value = json_format.MessageToJson(pb_return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -13479,10 +13604,11 @@ def test_analyze_org_policy_governed_assets_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.AnalyzeOrgPolicyGovernedAssetsResponse.pb( + # Convert return value to protobuf type + return_value = asset_service.AnalyzeOrgPolicyGovernedAssetsResponse.pb( return_value ) - json_return_value = json_format.MessageToJson(pb_return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -13573,10 +13699,11 @@ def test_analyze_org_policy_governed_assets_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.AnalyzeOrgPolicyGovernedAssetsResponse.pb( + # Convert return value to protobuf type + return_value = asset_service.AnalyzeOrgPolicyGovernedAssetsResponse.pb( return_value ) - json_return_value = json_format.MessageToJson(pb_return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -13730,10 +13857,11 @@ def test_analyze_org_policy_governed_assets_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.AnalyzeOrgPolicyGovernedAssetsResponse.pb( + # Convert return value to protobuf type + return_value = asset_service.AnalyzeOrgPolicyGovernedAssetsResponse.pb( return_value ) - json_return_value = json_format.MessageToJson(pb_return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value diff --git a/tests/unit/gapic/asset_v1p1beta1/__init__.py b/tests/unit/gapic/asset_v1p1beta1/__init__.py index e8e1c384..89a37dc9 100644 --- a/tests/unit/gapic/asset_v1p1beta1/__init__.py +++ b/tests/unit/gapic/asset_v1p1beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/asset_v1p1beta1/test_asset_service.py b/tests/unit/gapic/asset_v1p1beta1/test_asset_service.py index 76943e24..404c6040 100644 --- a/tests/unit/gapic/asset_v1p1beta1/test_asset_service.py +++ b/tests/unit/gapic/asset_v1p1beta1/test_asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ from google.cloud.asset_v1p1beta1.services.asset_service import transports from google.cloud.asset_v1p1beta1.types import asset_service from google.cloud.asset_v1p1beta1.types import assets -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account import google.auth @@ -1148,9 +1148,11 @@ async def test_search_all_resources_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.search_all_resources(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -1601,9 +1603,11 @@ async def test_search_all_iam_policies_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.search_all_iam_policies(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -1636,8 +1640,9 @@ def test_search_all_resources_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SearchAllResourcesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SearchAllResourcesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -1722,8 +1727,9 @@ def test_search_all_resources_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SearchAllResourcesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SearchAllResourcesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -1861,8 +1867,9 @@ def test_search_all_resources_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SearchAllResourcesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SearchAllResourcesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -1985,8 +1992,9 @@ def test_search_all_iam_policies_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SearchAllIamPoliciesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SearchAllIamPoliciesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -2069,10 +2077,9 @@ def test_search_all_iam_policies_rest_required_fields( response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SearchAllIamPoliciesResponse.pb( - return_value - ) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SearchAllIamPoliciesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -2207,8 +2214,9 @@ def test_search_all_iam_policies_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.SearchAllIamPoliciesResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.SearchAllIamPoliciesResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value diff --git a/tests/unit/gapic/asset_v1p2beta1/__init__.py b/tests/unit/gapic/asset_v1p2beta1/__init__.py index e8e1c384..89a37dc9 100644 --- a/tests/unit/gapic/asset_v1p2beta1/__init__.py +++ b/tests/unit/gapic/asset_v1p2beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/asset_v1p2beta1/test_asset_service.py b/tests/unit/gapic/asset_v1p2beta1/test_asset_service.py index c30bb75a..7434e47b 100644 --- a/tests/unit/gapic/asset_v1p2beta1/test_asset_service.py +++ b/tests/unit/gapic/asset_v1p2beta1/test_asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -1887,8 +1887,9 @@ def test_create_feed_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -1969,8 +1970,9 @@ def test_create_feed_rest_required_fields(request_type=asset_service.CreateFeedR response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -2102,8 +2104,9 @@ def test_create_feed_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -2169,8 +2172,9 @@ def test_get_feed_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -2246,8 +2250,9 @@ def test_get_feed_rest_required_fields(request_type=asset_service.GetFeedRequest response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -2368,8 +2373,9 @@ def test_get_feed_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -2430,8 +2436,9 @@ def test_list_feeds_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListFeedsResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListFeedsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -2503,8 +2510,9 @@ def test_list_feeds_rest_required_fields(request_type=asset_service.ListFeedsReq response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListFeedsResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListFeedsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -2627,8 +2635,9 @@ def test_list_feeds_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListFeedsResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListFeedsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -2694,8 +2703,9 @@ def test_update_feed_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -2767,8 +2777,9 @@ def test_update_feed_rest_required_fields(request_type=asset_service.UpdateFeedR response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -2899,8 +2910,9 @@ def test_update_feed_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.Feed.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.Feed.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value diff --git a/tests/unit/gapic/asset_v1p5beta1/__init__.py b/tests/unit/gapic/asset_v1p5beta1/__init__.py index e8e1c384..89a37dc9 100644 --- a/tests/unit/gapic/asset_v1p5beta1/__init__.py +++ b/tests/unit/gapic/asset_v1p5beta1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/asset_v1p5beta1/test_asset_service.py b/tests/unit/gapic/asset_v1p5beta1/test_asset_service.py index ff1cdc7f..81a432c4 100644 --- a/tests/unit/gapic/asset_v1p5beta1/test_asset_service.py +++ b/tests/unit/gapic/asset_v1p5beta1/test_asset_service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ from google.cloud.asset_v1p5beta1.services.asset_service import transports from google.cloud.asset_v1p5beta1.types import asset_service from google.cloud.asset_v1p5beta1.types import assets -from google.longrunning import operations_pb2 +from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account from google.protobuf import timestamp_pb2 # type: ignore import google.auth @@ -1106,9 +1106,11 @@ async def test_list_assets_async_pages(): RuntimeError, ) pages = [] - async for page_ in ( + # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` + # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 + async for page_ in ( # pragma: no branch await client.list_assets(request={}) - ).pages: # pragma: no branch + ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -1141,8 +1143,9 @@ def test_list_assets_rest(request_type): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListAssetsResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListAssetsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -1225,8 +1228,9 @@ def test_list_assets_rest_required_fields(request_type=asset_service.ListAssetsR response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListAssetsResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListAssetsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value @@ -1362,8 +1366,9 @@ def test_list_assets_rest_flattened(): # Wrap the value into a proper Response obj response_value = Response() response_value.status_code = 200 - pb_return_value = asset_service.ListAssetsResponse.pb(return_value) - json_return_value = json_format.MessageToJson(pb_return_value) + # Convert return value to protobuf type + return_value = asset_service.ListAssetsResponse.pb(return_value) + json_return_value = json_format.MessageToJson(return_value) response_value._content = json_return_value.encode("UTF-8") req.return_value = response_value