diff --git a/.coveragerc b/.coveragerc index 3655af7f..554452e0 100644 --- a/.coveragerc +++ b/.coveragerc @@ -10,8 +10,3 @@ exclude_lines = pragma: NO COVER # Ignore debug-only repr def __repr__ - # Ignore pkg_resources exceptions. - # This is added at the module level as a safeguard for if someone - # generates the code and tries to run it without pip installing. This - # makes it virtually impossible to test properly. - except pkg_resources.DistributionNotFound diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 3815c983..fccaa8e8 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:7a40313731a7cb1454eef6b33d3446ebb121836738dc3ab3d2d3ded5268c35b6 + digest: sha256:3bf87e47c2173d7eed42714589dc4da2c07c3268610f1e47f8e1a30decbfc7f1 diff --git a/.github/release-please.yml b/.github/release-please.yml index 6def37a8..e9a4f008 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,5 +1,6 @@ releaseType: python handleGHRelease: true +manifest: true # NOTE: this section is generated by synthtool.languages.python # See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py branches: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7092a139..e97d89e4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.9" - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel @@ -28,7 +28,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.9" - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d2aee5b7..16d5a9e9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.8" - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 87ade4d5..23000c05 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -41,7 +41,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.8" - name: Install coverage run: | python -m pip install --upgrade setuptools pip wheel diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile index 238b87b9..f8137d0a 100644 --- a/.kokoro/docker/docs/Dockerfile +++ b/.kokoro/docker/docs/Dockerfile @@ -60,16 +60,16 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && rm -f /var/cache/apt/archives/*.deb -###################### Install python 3.8.11 +###################### Install python 3.9.13 -# Download python 3.8.11 -RUN wget https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz +# Download python 3.9.13 +RUN wget https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tgz # Extract files -RUN tar -xvf Python-3.8.11.tgz +RUN tar -xvf Python-3.9.13.tgz -# Install python 3.8.11 -RUN ./Python-3.8.11/configure --enable-optimizations +# Install python 3.9.13 +RUN ./Python-3.9.13/configure --enable-optimizations RUN make altinstall ###################### Install pip diff --git a/.kokoro/requirements.in b/.kokoro/requirements.in index 7718391a..cbd7e77f 100644 --- a/.kokoro/requirements.in +++ b/.kokoro/requirements.in @@ -5,4 +5,6 @@ typing-extensions twine wheel setuptools -nox \ No newline at end of file +nox +charset-normalizer<3 +click<8.1.0 diff --git a/.kokoro/requirements.txt b/.kokoro/requirements.txt index d15994ba..05dc4672 100644 --- a/.kokoro/requirements.txt +++ b/.kokoro/requirements.txt @@ -20,9 +20,9 @@ cachetools==5.2.0 \ --hash=sha256:6a94c6402995a99c3970cc7e4884bb60b4a8639938157eeed436098bf9831757 \ --hash=sha256:f9f17d2aec496a9aa6b76f53e3b614c965223c061982d434d160f930c698a9db # via google-auth -certifi==2022.6.15 \ - --hash=sha256:84c85a9078b11105f04f3036a9482ae10e4621616db313fe045dd24743a0820d \ - --hash=sha256:fe86415d55e84719d75f8b69414f6438ac3547d2078ab91b67e779ef69378412 +certifi==2022.12.7 \ + --hash=sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3 \ + --hash=sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18 # via requests cffi==1.15.1 \ --hash=sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5 \ @@ -93,11 +93,14 @@ cffi==1.15.1 \ charset-normalizer==2.1.1 \ --hash=sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845 \ --hash=sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f - # via requests + # via + # -r requirements.in + # requests click==8.0.4 \ --hash=sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1 \ --hash=sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb # via + # -r requirements.in # gcp-docuploader # gcp-releasetool colorlog==6.7.0 \ @@ -110,29 +113,33 @@ commonmark==0.9.1 \ --hash=sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60 \ --hash=sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9 # via rich -cryptography==37.0.4 \ - --hash=sha256:190f82f3e87033821828f60787cfa42bff98404483577b591429ed99bed39d59 \ - --hash=sha256:2be53f9f5505673eeda5f2736bea736c40f051a739bfae2f92d18aed1eb54596 \ - --hash=sha256:30788e070800fec9bbcf9faa71ea6d8068f5136f60029759fd8c3efec3c9dcb3 \ - --hash=sha256:3d41b965b3380f10e4611dbae366f6dc3cefc7c9ac4e8842a806b9672ae9add5 \ - --hash=sha256:4c590ec31550a724ef893c50f9a97a0c14e9c851c85621c5650d699a7b88f7ab \ - --hash=sha256:549153378611c0cca1042f20fd9c5030d37a72f634c9326e225c9f666d472884 \ - --hash=sha256:63f9c17c0e2474ccbebc9302ce2f07b55b3b3fcb211ded18a42d5764f5c10a82 \ - --hash=sha256:6bc95ed67b6741b2607298f9ea4932ff157e570ef456ef7ff0ef4884a134cc4b \ - --hash=sha256:7099a8d55cd49b737ffc99c17de504f2257e3787e02abe6d1a6d136574873441 \ - --hash=sha256:75976c217f10d48a8b5a8de3d70c454c249e4b91851f6838a4e48b8f41eb71aa \ - --hash=sha256:7bc997818309f56c0038a33b8da5c0bfbb3f1f067f315f9abd6fc07ad359398d \ - --hash=sha256:80f49023dd13ba35f7c34072fa17f604d2f19bf0989f292cedf7ab5770b87a0b \ - --hash=sha256:91ce48d35f4e3d3f1d83e29ef4a9267246e6a3be51864a5b7d2247d5086fa99a \ - --hash=sha256:a958c52505c8adf0d3822703078580d2c0456dd1d27fabfb6f76fe63d2971cd6 \ - --hash=sha256:b62439d7cd1222f3da897e9a9fe53bbf5c104fff4d60893ad1355d4c14a24157 \ - --hash=sha256:b7f8dd0d4c1f21759695c05a5ec8536c12f31611541f8904083f3dc582604280 \ - --hash=sha256:d204833f3c8a33bbe11eda63a54b1aad7aa7456ed769a982f21ec599ba5fa282 \ - --hash=sha256:e007f052ed10cc316df59bc90fbb7ff7950d7e2919c9757fd42a2b8ecf8a5f67 \ - --hash=sha256:f2dcb0b3b63afb6df7fd94ec6fbddac81b5492513f7b0436210d390c14d46ee8 \ - --hash=sha256:f721d1885ecae9078c3f6bbe8a88bc0786b6e749bf32ccec1ef2b18929a05046 \ - --hash=sha256:f7a6de3e98771e183645181b3627e2563dcde3ce94a9e42a3f427d2255190327 \ - --hash=sha256:f8c0a6e9e1dd3eb0414ba320f85da6b0dcbd543126e30fcc546e7372a7fbf3b9 +cryptography==38.0.3 \ + --hash=sha256:068147f32fa662c81aebab95c74679b401b12b57494872886eb5c1139250ec5d \ + --hash=sha256:06fc3cc7b6f6cca87bd56ec80a580c88f1da5306f505876a71c8cfa7050257dd \ + --hash=sha256:25c1d1f19729fb09d42e06b4bf9895212292cb27bb50229f5aa64d039ab29146 \ + --hash=sha256:402852a0aea73833d982cabb6d0c3bb582c15483d29fb7085ef2c42bfa7e38d7 \ + --hash=sha256:4e269dcd9b102c5a3d72be3c45d8ce20377b8076a43cbed6f660a1afe365e436 \ + --hash=sha256:5419a127426084933076132d317911e3c6eb77568a1ce23c3ac1e12d111e61e0 \ + --hash=sha256:554bec92ee7d1e9d10ded2f7e92a5d70c1f74ba9524947c0ba0c850c7b011828 \ + --hash=sha256:5e89468fbd2fcd733b5899333bc54d0d06c80e04cd23d8c6f3e0542358c6060b \ + --hash=sha256:65535bc550b70bd6271984d9863a37741352b4aad6fb1b3344a54e6950249b55 \ + --hash=sha256:6ab9516b85bebe7aa83f309bacc5f44a61eeb90d0b4ec125d2d003ce41932d36 \ + --hash=sha256:6addc3b6d593cd980989261dc1cce38263c76954d758c3c94de51f1e010c9a50 \ + --hash=sha256:728f2694fa743a996d7784a6194da430f197d5c58e2f4e278612b359f455e4a2 \ + --hash=sha256:785e4056b5a8b28f05a533fab69febf5004458e20dad7e2e13a3120d8ecec75a \ + --hash=sha256:78cf5eefac2b52c10398a42765bfa981ce2372cbc0457e6bf9658f41ec3c41d8 \ + --hash=sha256:7f836217000342d448e1c9a342e9163149e45d5b5eca76a30e84503a5a96cab0 \ + --hash=sha256:8d41a46251bf0634e21fac50ffd643216ccecfaf3701a063257fe0b2be1b6548 \ + --hash=sha256:984fe150f350a3c91e84de405fe49e688aa6092b3525f407a18b9646f6612320 \ + --hash=sha256:9b24bcff7853ed18a63cfb0c2b008936a9554af24af2fb146e16d8e1aed75748 \ + --hash=sha256:b1b35d9d3a65542ed2e9d90115dfd16bbc027b3f07ee3304fc83580f26e43249 \ + --hash=sha256:b1b52c9e5f8aa2b802d48bd693190341fae201ea51c7a167d69fc48b60e8a959 \ + --hash=sha256:bbf203f1a814007ce24bd4d51362991d5cb90ba0c177a9c08825f2cc304d871f \ + --hash=sha256:be243c7e2bfcf6cc4cb350c0d5cdf15ca6383bbcb2a8ef51d3c9411a9d4386f0 \ + --hash=sha256:bfbe6ee19615b07a98b1d2287d6a6073f734735b49ee45b11324d85efc4d5cbd \ + --hash=sha256:c46837ea467ed1efea562bbeb543994c2d1f6e800785bd5a2c98bc096f5cb220 \ + --hash=sha256:dfb4f4dd568de1b6af9f4cda334adf7d72cf5bc052516e1b2608b683375dd95c \ + --hash=sha256:ed7b00096790213e09eb11c97cc6e2b757f15f3d2f85833cd2d3ec3fe37c1722 # via # gcp-releasetool # secretstorage @@ -148,23 +155,23 @@ filelock==3.8.0 \ --hash=sha256:55447caa666f2198c5b6b13a26d2084d26fa5b115c00d065664b2124680c4edc \ --hash=sha256:617eb4e5eedc82fc5f47b6d61e4d11cb837c56cb4544e39081099fa17ad109d4 # via virtualenv -gcp-docuploader==0.6.3 \ - --hash=sha256:ba8c9d76b3bbac54b0311c503a373b00edc2dc02d6d54ea9507045adb8e870f7 \ - --hash=sha256:c0f5aaa82ce1854a386197e4e359b120ad6d4e57ae2c812fce42219a3288026b +gcp-docuploader==0.6.4 \ + --hash=sha256:01486419e24633af78fd0167db74a2763974765ee8078ca6eb6964d0ebd388af \ + --hash=sha256:70861190c123d907b3b067da896265ead2eeb9263969d6955c9e0bb091b5ccbf # via -r requirements.in -gcp-releasetool==1.8.7 \ - --hash=sha256:3d2a67c9db39322194afb3b427e9cb0476ce8f2a04033695f0aeb63979fc2b37 \ - --hash=sha256:5e4d28f66e90780d77f3ecf1e9155852b0c3b13cbccb08ab07e66b2357c8da8d +gcp-releasetool==1.10.0 \ + --hash=sha256:72a38ca91b59c24f7e699e9227c90cbe4dd71b789383cb0164b088abae294c83 \ + --hash=sha256:8c7c99320208383d4bb2b808c6880eb7a81424afe7cdba3c8d84b25f4f0e097d # via -r requirements.in -google-api-core==2.8.2 \ - --hash=sha256:06f7244c640322b508b125903bb5701bebabce8832f85aba9335ec00b3d02edc \ - --hash=sha256:93c6a91ccac79079ac6bbf8b74ee75db970cc899278b97d53bc012f35908cf50 +google-api-core==2.10.2 \ + --hash=sha256:10c06f7739fe57781f87523375e8e1a3a4674bf6392cd6131a3222182b971320 \ + --hash=sha256:34f24bd1d5f72a8c4519773d99ca6bf080a6c4e041b4e9f024fe230191dda62e # via # google-cloud-core # google-cloud-storage -google-auth==2.11.0 \ - --hash=sha256:be62acaae38d0049c21ca90f27a23847245c9f161ff54ede13af2cb6afecbac9 \ - --hash=sha256:ed65ecf9f681832298e29328e1ef0a3676e3732b2e56f41532d45f70a22de0fb +google-auth==2.14.1 \ + --hash=sha256:ccaa901f31ad5cbb562615eb8b664b3dd0bf5404a67618e642307f00613eda4d \ + --hash=sha256:f5d8701633bebc12e0deea4df8abd8aff31c28b355360597f7f2ee60f2e4d016 # via # gcp-releasetool # google-api-core @@ -174,76 +181,102 @@ google-cloud-core==2.3.2 \ --hash=sha256:8417acf6466be2fa85123441696c4badda48db314c607cf1e5d543fa8bdc22fe \ --hash=sha256:b9529ee7047fd8d4bf4a2182de619154240df17fbe60ead399078c1ae152af9a # via google-cloud-storage -google-cloud-storage==2.5.0 \ - --hash=sha256:19a26c66c317ce542cea0830b7e787e8dac2588b6bfa4d3fd3b871ba16305ab0 \ - --hash=sha256:382f34b91de2212e3c2e7b40ec079d27ee2e3dbbae99b75b1bcd8c63063ce235 +google-cloud-storage==2.6.0 \ + --hash=sha256:104ca28ae61243b637f2f01455cc8a05e8f15a2a18ced96cb587241cdd3820f5 \ + --hash=sha256:4ad0415ff61abdd8bb2ae81c1f8f7ec7d91a1011613f2db87c614c550f97bfe9 # via gcp-docuploader -google-crc32c==1.3.0 \ - --hash=sha256:04e7c220798a72fd0f08242bc8d7a05986b2a08a0573396187fd32c1dcdd58b3 \ - --hash=sha256:05340b60bf05b574159e9bd940152a47d38af3fb43803ffe71f11d704b7696a6 \ - --hash=sha256:12674a4c3b56b706153a358eaa1018c4137a5a04635b92b4652440d3d7386206 \ - --hash=sha256:127f9cc3ac41b6a859bd9dc4321097b1a4f6aa7fdf71b4f9227b9e3ebffb4422 \ - --hash=sha256:13af315c3a0eec8bb8b8d80b8b128cb3fcd17d7e4edafc39647846345a3f003a \ - --hash=sha256:1926fd8de0acb9d15ee757175ce7242e235482a783cd4ec711cc999fc103c24e \ - --hash=sha256:226f2f9b8e128a6ca6a9af9b9e8384f7b53a801907425c9a292553a3a7218ce0 \ - --hash=sha256:276de6273eb074a35bc598f8efbc00c7869c5cf2e29c90748fccc8c898c244df \ - --hash=sha256:318f73f5484b5671f0c7f5f63741ab020a599504ed81d209b5c7129ee4667407 \ - --hash=sha256:3bbce1be3687bbfebe29abdb7631b83e6b25da3f4e1856a1611eb21854b689ea \ - --hash=sha256:42ae4781333e331a1743445931b08ebdad73e188fd554259e772556fc4937c48 \ - --hash=sha256:58be56ae0529c664cc04a9c76e68bb92b091e0194d6e3c50bea7e0f266f73713 \ - --hash=sha256:5da2c81575cc3ccf05d9830f9e8d3c70954819ca9a63828210498c0774fda1a3 \ - --hash=sha256:6311853aa2bba4064d0c28ca54e7b50c4d48e3de04f6770f6c60ebda1e975267 \ - --hash=sha256:650e2917660e696041ab3dcd7abac160b4121cd9a484c08406f24c5964099829 \ - --hash=sha256:6a4db36f9721fdf391646685ecffa404eb986cbe007a3289499020daf72e88a2 \ - --hash=sha256:779cbf1ce375b96111db98fca913c1f5ec11b1d870e529b1dc7354b2681a8c3a \ - --hash=sha256:7f6fe42536d9dcd3e2ffb9d3053f5d05221ae3bbcefbe472bdf2c71c793e3183 \ - --hash=sha256:891f712ce54e0d631370e1f4997b3f182f3368179198efc30d477c75d1f44942 \ - --hash=sha256:95c68a4b9b7828ba0428f8f7e3109c5d476ca44996ed9a5f8aac6269296e2d59 \ - --hash=sha256:96a8918a78d5d64e07c8ea4ed2bc44354e3f93f46a4866a40e8db934e4c0d74b \ - --hash=sha256:9c3cf890c3c0ecfe1510a452a165431b5831e24160c5fcf2071f0f85ca5a47cd \ - --hash=sha256:9f58099ad7affc0754ae42e6d87443299f15d739b0ce03c76f515153a5cda06c \ - --hash=sha256:a0b9e622c3b2b8d0ce32f77eba617ab0d6768b82836391e4f8f9e2074582bf02 \ - --hash=sha256:a7f9cbea4245ee36190f85fe1814e2d7b1e5f2186381b082f5d59f99b7f11328 \ - --hash=sha256:bab4aebd525218bab4ee615786c4581952eadc16b1ff031813a2fd51f0cc7b08 \ - --hash=sha256:c124b8c8779bf2d35d9b721e52d4adb41c9bfbde45e6a3f25f0820caa9aba73f \ - --hash=sha256:c9da0a39b53d2fab3e5467329ed50e951eb91386e9d0d5b12daf593973c3b168 \ - --hash=sha256:ca60076c388728d3b6ac3846842474f4250c91efbfe5afa872d3ffd69dd4b318 \ - --hash=sha256:cb6994fff247987c66a8a4e550ef374671c2b82e3c0d2115e689d21e511a652d \ - --hash=sha256:d1c1d6236feab51200272d79b3d3e0f12cf2cbb12b208c835b175a21efdb0a73 \ - --hash=sha256:dd7760a88a8d3d705ff562aa93f8445ead54f58fd482e4f9e2bafb7e177375d4 \ - --hash=sha256:dda4d8a3bb0b50f540f6ff4b6033f3a74e8bf0bd5320b70fab2c03e512a62812 \ - --hash=sha256:e0f1ff55dde0ebcfbef027edc21f71c205845585fffe30d4ec4979416613e9b3 \ - --hash=sha256:e7a539b9be7b9c00f11ef16b55486141bc2cdb0c54762f84e3c6fc091917436d \ - --hash=sha256:eb0b14523758e37802f27b7f8cd973f5f3d33be7613952c0df904b68c4842f0e \ - --hash=sha256:ed447680ff21c14aaceb6a9f99a5f639f583ccfe4ce1a5e1d48eb41c3d6b3217 \ - --hash=sha256:f52a4ad2568314ee713715b1e2d79ab55fab11e8b304fd1462ff5cccf4264b3e \ - --hash=sha256:fbd60c6aaa07c31d7754edbc2334aef50601b7f1ada67a96eb1eb57c7c72378f \ - --hash=sha256:fc28e0db232c62ca0c3600884933178f0825c99be4474cdd645e378a10588125 \ - --hash=sha256:fe31de3002e7b08eb20823b3735b97c86c5926dd0581c7710a680b418a8709d4 \ - --hash=sha256:fec221a051150eeddfdfcff162e6db92c65ecf46cb0f7bb1bf812a1520ec026b \ - --hash=sha256:ff71073ebf0e42258a42a0b34f2c09ec384977e7f6808999102eedd5b49920e3 +google-crc32c==1.5.0 \ + --hash=sha256:024894d9d3cfbc5943f8f230e23950cd4906b2fe004c72e29b209420a1e6b05a \ + --hash=sha256:02c65b9817512edc6a4ae7c7e987fea799d2e0ee40c53ec573a692bee24de876 \ + --hash=sha256:02ebb8bf46c13e36998aeaad1de9b48f4caf545e91d14041270d9dca767b780c \ + --hash=sha256:07eb3c611ce363c51a933bf6bd7f8e3878a51d124acfc89452a75120bc436289 \ + --hash=sha256:1034d91442ead5a95b5aaef90dbfaca8633b0247d1e41621d1e9f9db88c36298 \ + --hash=sha256:116a7c3c616dd14a3de8c64a965828b197e5f2d121fedd2f8c5585c547e87b02 \ + --hash=sha256:19e0a019d2c4dcc5e598cd4a4bc7b008546b0358bd322537c74ad47a5386884f \ + --hash=sha256:1c7abdac90433b09bad6c43a43af253e688c9cfc1c86d332aed13f9a7c7f65e2 \ + --hash=sha256:1e986b206dae4476f41bcec1faa057851f3889503a70e1bdb2378d406223994a \ + --hash=sha256:272d3892a1e1a2dbc39cc5cde96834c236d5327e2122d3aaa19f6614531bb6eb \ + --hash=sha256:278d2ed7c16cfc075c91378c4f47924c0625f5fc84b2d50d921b18b7975bd210 \ + --hash=sha256:2ad40e31093a4af319dadf503b2467ccdc8f67c72e4bcba97f8c10cb078207b5 \ + --hash=sha256:2e920d506ec85eb4ba50cd4228c2bec05642894d4c73c59b3a2fe20346bd00ee \ + --hash=sha256:3359fc442a743e870f4588fcf5dcbc1bf929df1fad8fb9905cd94e5edb02e84c \ + --hash=sha256:37933ec6e693e51a5b07505bd05de57eee12f3e8c32b07da7e73669398e6630a \ + --hash=sha256:398af5e3ba9cf768787eef45c803ff9614cc3e22a5b2f7d7ae116df8b11e3314 \ + --hash=sha256:3b747a674c20a67343cb61d43fdd9207ce5da6a99f629c6e2541aa0e89215bcd \ + --hash=sha256:461665ff58895f508e2866824a47bdee72497b091c730071f2b7575d5762ab65 \ + --hash=sha256:4c6fdd4fccbec90cc8a01fc00773fcd5fa28db683c116ee3cb35cd5da9ef6c37 \ + --hash=sha256:5829b792bf5822fd0a6f6eb34c5f81dd074f01d570ed7f36aa101d6fc7a0a6e4 \ + --hash=sha256:596d1f98fc70232fcb6590c439f43b350cb762fb5d61ce7b0e9db4539654cc13 \ + --hash=sha256:5ae44e10a8e3407dbe138984f21e536583f2bba1be9491239f942c2464ac0894 \ + --hash=sha256:635f5d4dd18758a1fbd1049a8e8d2fee4ffed124462d837d1a02a0e009c3ab31 \ + --hash=sha256:64e52e2b3970bd891309c113b54cf0e4384762c934d5ae56e283f9a0afcd953e \ + --hash=sha256:66741ef4ee08ea0b2cc3c86916ab66b6aef03768525627fd6a1b34968b4e3709 \ + --hash=sha256:67b741654b851abafb7bc625b6d1cdd520a379074e64b6a128e3b688c3c04740 \ + --hash=sha256:6ac08d24c1f16bd2bf5eca8eaf8304812f44af5cfe5062006ec676e7e1d50afc \ + --hash=sha256:6f998db4e71b645350b9ac28a2167e6632c239963ca9da411523bb439c5c514d \ + --hash=sha256:72218785ce41b9cfd2fc1d6a017dc1ff7acfc4c17d01053265c41a2c0cc39b8c \ + --hash=sha256:74dea7751d98034887dbd821b7aae3e1d36eda111d6ca36c206c44478035709c \ + --hash=sha256:759ce4851a4bb15ecabae28f4d2e18983c244eddd767f560165563bf9aefbc8d \ + --hash=sha256:77e2fd3057c9d78e225fa0a2160f96b64a824de17840351b26825b0848022906 \ + --hash=sha256:7c074fece789b5034b9b1404a1f8208fc2d4c6ce9decdd16e8220c5a793e6f61 \ + --hash=sha256:7c42c70cd1d362284289c6273adda4c6af8039a8ae12dc451dcd61cdabb8ab57 \ + --hash=sha256:7f57f14606cd1dd0f0de396e1e53824c371e9544a822648cd76c034d209b559c \ + --hash=sha256:83c681c526a3439b5cf94f7420471705bbf96262f49a6fe546a6db5f687a3d4a \ + --hash=sha256:8485b340a6a9e76c62a7dce3c98e5f102c9219f4cfbf896a00cf48caf078d438 \ + --hash=sha256:84e6e8cd997930fc66d5bb4fde61e2b62ba19d62b7abd7a69920406f9ecca946 \ + --hash=sha256:89284716bc6a5a415d4eaa11b1726d2d60a0cd12aadf5439828353662ede9dd7 \ + --hash=sha256:8b87e1a59c38f275c0e3676fc2ab6d59eccecfd460be267ac360cc31f7bcde96 \ + --hash=sha256:8f24ed114432de109aa9fd317278518a5af2d31ac2ea6b952b2f7782b43da091 \ + --hash=sha256:98cb4d057f285bd80d8778ebc4fde6b4d509ac3f331758fb1528b733215443ae \ + --hash=sha256:998679bf62b7fb599d2878aa3ed06b9ce688b8974893e7223c60db155f26bd8d \ + --hash=sha256:9ba053c5f50430a3fcfd36f75aff9caeba0440b2d076afdb79a318d6ca245f88 \ + --hash=sha256:9c99616c853bb585301df6de07ca2cadad344fd1ada6d62bb30aec05219c45d2 \ + --hash=sha256:a1fd716e7a01f8e717490fbe2e431d2905ab8aa598b9b12f8d10abebb36b04dd \ + --hash=sha256:a2355cba1f4ad8b6988a4ca3feed5bff33f6af2d7f134852cf279c2aebfde541 \ + --hash=sha256:b1f8133c9a275df5613a451e73f36c2aea4fe13c5c8997e22cf355ebd7bd0728 \ + --hash=sha256:b8667b48e7a7ef66afba2c81e1094ef526388d35b873966d8a9a447974ed9178 \ + --hash=sha256:ba1eb1843304b1e5537e1fca632fa894d6f6deca8d6389636ee5b4797affb968 \ + --hash=sha256:be82c3c8cfb15b30f36768797a640e800513793d6ae1724aaaafe5bf86f8f346 \ + --hash=sha256:c02ec1c5856179f171e032a31d6f8bf84e5a75c45c33b2e20a3de353b266ebd8 \ + --hash=sha256:c672d99a345849301784604bfeaeba4db0c7aae50b95be04dd651fd2a7310b93 \ + --hash=sha256:c6c777a480337ac14f38564ac88ae82d4cd238bf293f0a22295b66eb89ffced7 \ + --hash=sha256:cae0274952c079886567f3f4f685bcaf5708f0a23a5f5216fdab71f81a6c0273 \ + --hash=sha256:cd67cf24a553339d5062eff51013780a00d6f97a39ca062781d06b3a73b15462 \ + --hash=sha256:d3515f198eaa2f0ed49f8819d5732d70698c3fa37384146079b3799b97667a94 \ + --hash=sha256:d5280312b9af0976231f9e317c20e4a61cd2f9629b7bfea6a693d1878a264ebd \ + --hash=sha256:de06adc872bcd8c2a4e0dc51250e9e65ef2ca91be023b9d13ebd67c2ba552e1e \ + --hash=sha256:e1674e4307fa3024fc897ca774e9c7562c957af85df55efe2988ed9056dc4e57 \ + --hash=sha256:e2096eddb4e7c7bdae4bd69ad364e55e07b8316653234a56552d9c988bd2d61b \ + --hash=sha256:e560628513ed34759456a416bf86b54b2476c59144a9138165c9a1575801d0d9 \ + --hash=sha256:edfedb64740750e1a3b16152620220f51d58ff1b4abceb339ca92e934775c27a \ + --hash=sha256:f13cae8cc389a440def0c8c52057f37359014ccbc9dc1f0827936bcd367c6100 \ + --hash=sha256:f314013e7dcd5cf45ab1945d92e713eec788166262ae8deb2cfacd53def27325 \ + --hash=sha256:f583edb943cf2e09c60441b910d6a20b4d9d626c75a36c8fcac01a6c96c01183 \ + --hash=sha256:fd8536e902db7e365f49e7d9029283403974ccf29b13fc7028b97e2295b33556 \ + --hash=sha256:fe70e325aa68fa4b5edf7d1a4b6f691eb04bbccac0ace68e34820d283b5f80d4 # via google-resumable-media -google-resumable-media==2.3.3 \ - --hash=sha256:27c52620bd364d1c8116eaac4ea2afcbfb81ae9139fb3199652fcac1724bfb6c \ - --hash=sha256:5b52774ea7a829a8cdaa8bd2d4c3d4bc660c91b30857ab2668d0eb830f4ea8c5 +google-resumable-media==2.4.0 \ + --hash=sha256:2aa004c16d295c8f6c33b2b4788ba59d366677c0a25ae7382436cb30f776deaa \ + --hash=sha256:8d5518502f92b9ecc84ac46779bd4f09694ecb3ba38a3e7ca737a86d15cbca1f # via google-cloud-storage -googleapis-common-protos==1.56.4 \ - --hash=sha256:8eb2cbc91b69feaf23e32452a7ae60e791e09967d81d4fcc7fc388182d1bd394 \ - --hash=sha256:c25873c47279387cfdcbdafa36149887901d36202cb645a0e4f29686bf6e4417 +googleapis-common-protos==1.57.0 \ + --hash=sha256:27a849d6205838fb6cc3c1c21cb9800707a661bb21c6ce7fb13e99eb1f8a0c46 \ + --hash=sha256:a9f4a1d7f6d9809657b7f1316a1aa527f6664891531bcfcc13b6696e685f443c # via google-api-core -idna==3.3 \ - --hash=sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff \ - --hash=sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d +idna==3.4 \ + --hash=sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4 \ + --hash=sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2 # via requests -importlib-metadata==4.12.0 \ - --hash=sha256:637245b8bab2b6502fcbc752cc4b7a6f6243bb02b31c5c26156ad103d3d45670 \ - --hash=sha256:7401a975809ea1fdc658c3aa4f78cc2195a0e019c5cbc4c06122884e9ae80c23 +importlib-metadata==5.0.0 \ + --hash=sha256:da31db32b304314d044d3c12c79bd59e307889b287ad12ff387b3500835fc2ab \ + --hash=sha256:ddb0e35065e8938f867ed4928d0ae5bf2a53b7773871bfe6bcc7e4fcdc7dea43 # via # -r requirements.in + # keyring # twine -jaraco-classes==3.2.2 \ - --hash=sha256:6745f113b0b588239ceb49532aa09c3ebb947433ce311ef2f8e3ad64ebb74594 \ - --hash=sha256:e6ef6fd3fcf4579a7a019d87d1e56a883f4e4c35cfe925f86731abc58804e647 +jaraco-classes==3.2.3 \ + --hash=sha256:2353de3288bc6b82120752201c6b1c1a14b058267fa424ed5ce5984e3b922158 \ + --hash=sha256:89559fa5c1d3c34eff6f631ad80bb21f378dbcbb35dd161fd2c6b93f5be2f98a # via keyring jeepney==0.8.0 \ --hash=sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806 \ @@ -255,9 +288,9 @@ jinja2==3.1.2 \ --hash=sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 \ --hash=sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61 # via gcp-releasetool -keyring==23.9.0 \ - --hash=sha256:4c32a31174faaee48f43a7e2c7e9c3216ec5e95acf22a2bebfb4a1d05056ee44 \ - --hash=sha256:98f060ec95ada2ab910c195a2d4317be6ef87936a766b239c46aa3c7aac4f0db +keyring==23.11.0 \ + --hash=sha256:3dd30011d555f1345dec2c262f0153f2f0ca6bca041fb1dc4588349bb4c0ac1e \ + --hash=sha256:ad192263e2cdd5f12875dedc2da13534359a7e760e77f8d04b50968a821c2361 # via # gcp-releasetool # twine @@ -303,9 +336,9 @@ markupsafe==2.1.1 \ --hash=sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a \ --hash=sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7 # via jinja2 -more-itertools==8.14.0 \ - --hash=sha256:1bc4f91ee5b1b31ac7ceacc17c09befe6a40a503907baf9c839c229b5095cfd2 \ - --hash=sha256:c09443cd3d5438b8dafccd867a6bc1cb0894389e90cb53d227456b0b0bccb750 +more-itertools==9.0.0 \ + --hash=sha256:250e83d7e81d0c87ca6bd942e6aeab8cc9daa6096d12c5308f3f92fa5e5c1f41 \ + --hash=sha256:5a6257e40878ef0520b1803990e3e22303a41b5714006c32a3fd8304b26ea1ab # via jaraco-classes nox==2022.8.7 \ --hash=sha256:1b894940551dc5c389f9271d197ca5d655d40bdc6ccf93ed6880e4042760a34b \ @@ -321,34 +354,33 @@ pkginfo==1.8.3 \ --hash=sha256:848865108ec99d4901b2f7e84058b6e7660aae8ae10164e015a6dcf5b242a594 \ --hash=sha256:a84da4318dd86f870a9447a8c98340aa06216bfc6f2b7bdc4b8766984ae1867c # via twine -platformdirs==2.5.2 \ - --hash=sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788 \ - --hash=sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19 +platformdirs==2.5.4 \ + --hash=sha256:1006647646d80f16130f052404c6b901e80ee4ed6bef6792e1f238a8969106f7 \ + --hash=sha256:af0276409f9a02373d540bf8480021a048711d572745aef4b7842dad245eba10 # via virtualenv -protobuf==3.20.2 \ - --hash=sha256:03d76b7bd42ac4a6e109742a4edf81ffe26ffd87c5993126d894fe48a120396a \ - --hash=sha256:09e25909c4297d71d97612f04f41cea8fa8510096864f2835ad2f3b3df5a5559 \ - --hash=sha256:18e34a10ae10d458b027d7638a599c964b030c1739ebd035a1dfc0e22baa3bfe \ - --hash=sha256:291fb4307094bf5ccc29f424b42268640e00d5240bf0d9b86bf3079f7576474d \ - --hash=sha256:2c0b040d0b5d5d207936ca2d02f00f765906622c07d3fa19c23a16a8ca71873f \ - --hash=sha256:384164994727f274cc34b8abd41a9e7e0562801361ee77437099ff6dfedd024b \ - --hash=sha256:3cb608e5a0eb61b8e00fe641d9f0282cd0eedb603be372f91f163cbfbca0ded0 \ - --hash=sha256:5d9402bf27d11e37801d1743eada54372f986a372ec9679673bfcc5c60441151 \ - --hash=sha256:712dca319eee507a1e7df3591e639a2b112a2f4a62d40fe7832a16fd19151750 \ - --hash=sha256:7a5037af4e76c975b88c3becdf53922b5ffa3f2cddf657574a4920a3b33b80f3 \ - --hash=sha256:8228e56a865c27163d5d1d1771d94b98194aa6917bcfb6ce139cbfa8e3c27334 \ - --hash=sha256:84a1544252a933ef07bb0b5ef13afe7c36232a774affa673fc3636f7cee1db6c \ - --hash=sha256:84fe5953b18a383fd4495d375fe16e1e55e0a3afe7b4f7b4d01a3a0649fcda9d \ - --hash=sha256:9c673c8bfdf52f903081816b9e0e612186684f4eb4c17eeb729133022d6032e3 \ - --hash=sha256:9f876a69ca55aed879b43c295a328970306e8e80a263ec91cf6e9189243c613b \ - --hash=sha256:a9e5ae5a8e8985c67e8944c23035a0dff2c26b0f5070b2f55b217a1c33bbe8b1 \ - --hash=sha256:b4fdb29c5a7406e3f7ef176b2a7079baa68b5b854f364c21abe327bbeec01cdb \ - --hash=sha256:c184485e0dfba4dfd451c3bd348c2e685d6523543a0f91b9fd4ae90eb09e8422 \ - --hash=sha256:c9cdf251c582c16fd6a9f5e95836c90828d51b0069ad22f463761d27c6c19019 \ - --hash=sha256:e39cf61bb8582bda88cdfebc0db163b774e7e03364bbf9ce1ead13863e81e359 \ - --hash=sha256:e8fbc522303e09036c752a0afcc5c0603e917222d8bedc02813fd73b4b4ed804 \ - --hash=sha256:f34464ab1207114e73bba0794d1257c150a2b89b7a9faf504e00af7c9fd58978 \ - --hash=sha256:f52dabc96ca99ebd2169dadbe018824ebda08a795c7684a0b7d203a290f3adb0 +protobuf==3.20.3 \ + --hash=sha256:03038ac1cfbc41aa21f6afcbcd357281d7521b4157926f30ebecc8d4ea59dcb7 \ + --hash=sha256:28545383d61f55b57cf4df63eebd9827754fd2dc25f80c5253f9184235db242c \ + --hash=sha256:2e3427429c9cffebf259491be0af70189607f365c2f41c7c3764af6f337105f2 \ + --hash=sha256:398a9e0c3eaceb34ec1aee71894ca3299605fa8e761544934378bbc6c97de23b \ + --hash=sha256:44246bab5dd4b7fbd3c0c80b6f16686808fab0e4aca819ade6e8d294a29c7050 \ + --hash=sha256:447d43819997825d4e71bf5769d869b968ce96848b6479397e29fc24c4a5dfe9 \ + --hash=sha256:67a3598f0a2dcbc58d02dd1928544e7d88f764b47d4a286202913f0b2801c2e7 \ + --hash=sha256:74480f79a023f90dc6e18febbf7b8bac7508420f2006fabd512013c0c238f454 \ + --hash=sha256:819559cafa1a373b7096a482b504ae8a857c89593cf3a25af743ac9ecbd23480 \ + --hash=sha256:899dc660cd599d7352d6f10d83c95df430a38b410c1b66b407a6b29265d66469 \ + --hash=sha256:8c0c984a1b8fef4086329ff8dd19ac77576b384079247c770f29cc8ce3afa06c \ + --hash=sha256:9aae4406ea63d825636cc11ffb34ad3379335803216ee3a856787bcf5ccc751e \ + --hash=sha256:a7ca6d488aa8ff7f329d4c545b2dbad8ac31464f1d8b1c87ad1346717731e4db \ + --hash=sha256:b6cc7ba72a8850621bfec987cb72623e703b7fe2b9127a161ce61e61558ad905 \ + --hash=sha256:bf01b5720be110540be4286e791db73f84a2b721072a3711efff6c324cdf074b \ + --hash=sha256:c02ce36ec760252242a33967d51c289fd0e1c0e6e5cc9397e2279177716add86 \ + --hash=sha256:d9e4432ff660d67d775c66ac42a67cf2453c27cb4d738fc22cb53b5d84c135d4 \ + --hash=sha256:daa564862dd0d39c00f8086f88700fdbe8bc717e993a21e90711acfed02f2402 \ + --hash=sha256:de78575669dddf6099a8a0f46a27e82a1783c557ccc38ee620ed8cc96d3be7d7 \ + --hash=sha256:e64857f395505ebf3d2569935506ae0dfc4a15cb80dc25261176c784662cdcc4 \ + --hash=sha256:f4bd856d702e5b0d96a00ec6b307b0f51c1982c2bf9c0052cf9019e9a544ba99 \ + --hash=sha256:f4c42102bc82a51108e449cbb32b19b180022941c727bac0cfd50170341f16ee # via # gcp-docuploader # gcp-releasetool @@ -377,9 +409,9 @@ pygments==2.13.0 \ # via # readme-renderer # rich -pyjwt==2.4.0 \ - --hash=sha256:72d1d253f32dbd4f5c88eaf1fdc62f3a19f676ccbadb9dbc5d07e951b2b26daf \ - --hash=sha256:d42908208c699b3b973cbeb01a969ba6a96c821eefb1c5bfe4c390c01d67abba +pyjwt==2.6.0 \ + --hash=sha256:69285c7e31fc44f68a1feb309e948e0df53259d579295e6cfe2b1792329f05fd \ + --hash=sha256:d83c3d892a77bbb74d3e1a2cfa90afaadb60945205d1095d9221f04466f64c14 # via gcp-releasetool pyparsing==3.0.9 \ --hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \ @@ -392,9 +424,9 @@ python-dateutil==2.8.2 \ --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 # via gcp-releasetool -readme-renderer==37.0 \ - --hash=sha256:07b7ea234e03e58f77cc222e206e6abb8f4c0435becce5104794ee591f9301c5 \ - --hash=sha256:9fa416704703e509eeb900696751c908ddeb2011319d93700d8f18baff887a69 +readme-renderer==37.3 \ + --hash=sha256:cd653186dfc73055656f090f227f5cb22a046d7f71a841dfa305f55c9a513273 \ + --hash=sha256:f67a16caedfa71eef48a31b39708637a6f4664c4394801a7b0d6432d13907343 # via twine requests==2.28.1 \ --hash=sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983 \ @@ -405,17 +437,17 @@ requests==2.28.1 \ # google-cloud-storage # requests-toolbelt # twine -requests-toolbelt==0.9.1 \ - --hash=sha256:380606e1d10dc85c3bd47bf5a6095f815ec007be7a8b69c878507068df059e6f \ - --hash=sha256:968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0 +requests-toolbelt==0.10.1 \ + --hash=sha256:18565aa58116d9951ac39baa288d3adb5b3ff975c4f25eee78555d89e8f247f7 \ + --hash=sha256:62e09f7ff5ccbda92772a29f394a49c3ad6cb181d568b1337626b2abb628a63d # via twine rfc3986==2.0.0 \ --hash=sha256:50b1502b60e289cb37883f3dfd34532b8873c7de9f49bb546641ce9cbd256ebd \ --hash=sha256:97aacf9dbd4bfd829baad6e6309fa6573aaf1be3f6fa735c8ab05e46cecb261c # via twine -rich==12.5.1 \ - --hash=sha256:2eb4e6894cde1e017976d2975ac210ef515d7548bc595ba20e195fb9628acdeb \ - --hash=sha256:63a5c5ce3673d3d5fbbf23cd87e11ab84b6b451436f1b7f19ec54b6bc36ed7ca +rich==12.6.0 \ + --hash=sha256:a4eb26484f2c82589bd9a17c73d32a010b1e29d89f1604cd9bf3a2097b81bb5e \ + --hash=sha256:ba3a3775974105c221d31141f2c116f4fd65c5ceb0698657a11e9f295ec93fd0 # via twine rsa==4.9 \ --hash=sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7 \ @@ -437,9 +469,9 @@ twine==4.0.1 \ --hash=sha256:42026c18e394eac3e06693ee52010baa5313e4811d5a11050e7d48436cf41b9e \ --hash=sha256:96b1cf12f7ae611a4a40b6ae8e9570215daff0611828f5fe1f37a16255ab24a0 # via -r requirements.in -typing-extensions==4.3.0 \ - --hash=sha256:25642c956049920a5aa49edcdd6ab1e06d7e5d467fc00e0506c44ac86fbfca02 \ - --hash=sha256:e6d2677a32f47fc7eb2795db1dd15c1f34eff616bcaf2cfb5e997f854fa1c4a6 +typing-extensions==4.4.0 \ + --hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \ + --hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e # via -r requirements.in urllib3==1.26.12 \ --hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \ @@ -447,25 +479,25 @@ urllib3==1.26.12 \ # via # requests # twine -virtualenv==20.16.4 \ - --hash=sha256:014f766e4134d0008dcaa1f95bafa0fb0f575795d07cae50b1bee514185d6782 \ - --hash=sha256:035ed57acce4ac35c82c9d8802202b0e71adac011a511ff650cbcf9635006a22 +virtualenv==20.16.7 \ + --hash=sha256:8691e3ff9387f743e00f6bb20f70121f5e4f596cae754531f2b3b3a1b1ac696e \ + --hash=sha256:efd66b00386fdb7dbe4822d172303f40cd05e50e01740b19ea42425cbe653e29 # via nox webencodings==0.5.1 \ --hash=sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78 \ --hash=sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923 # via bleach -wheel==0.37.1 \ - --hash=sha256:4bdcd7d840138086126cd09254dc6195fb4fc6f01c050a1d7236f2630db1d22a \ - --hash=sha256:e9a504e793efbca1b8e0e9cb979a249cf4a0a7b5b8c9e8b65a5e39d49529c1c4 +wheel==0.38.4 \ + --hash=sha256:965f5259b566725405b05e7cf774052044b1ed30119b5d586b2703aafe8719ac \ + --hash=sha256:b60533f3f5d530e971d6737ca6d58681ee434818fab630c83a734bb10c083ce8 # via -r requirements.in -zipp==3.8.1 \ - --hash=sha256:05b45f1ee8f807d0cc928485ca40a07cb491cf092ff587c0df9cb1fd154848d2 \ - --hash=sha256:47c40d7fe183a6f21403a199b3e4192cca5774656965b0a4988ad2f8feb5f009 +zipp==3.10.0 \ + --hash=sha256:4fcb6f278987a6605757302a6e40e896257570d11c51628968ccb2a47e80c6c1 \ + --hash=sha256:7a7262fd930bd3e36c50b9a64897aec3fafff3dfdeec9623ae22b40e93f99bb8 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: -setuptools==65.2.0 \ - --hash=sha256:7f4bc85450898a09f76ebf28b72fa25bc7111f6c7d665d514a60bba9c75ef2a9 \ - --hash=sha256:a3ca5857c89f82f5c9410e8508cb32f4872a3bafd4aa7ae122a24ca33bccc750 +setuptools==65.5.1 \ + --hash=sha256:d0b9a8433464d5800cbe05094acf5c6d52a91bfac9b52bcfc4d41382be5d5d31 \ + --hash=sha256:e197a19aa8ec9722928f2206f8de752def0e4c9fc6953527360d1c36d94ddb2f # via -r requirements.in diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 46d23716..5405cc8f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: rev: 22.3.0 hooks: - id: black -- repo: https://gitlab.com/pycqa/flake8 +- repo: https://github.com/pycqa/flake8 rev: 3.9.2 hooks: - id: flake8 diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..46e7a463 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.17.0" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index dd7b857b..14c8e4d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,33 @@ [1]: https://pypi.org/project/google-cloud-securitycenter/#history +## [1.17.0](https://github.com/googleapis/python-securitycenter/compare/v1.16.2...v1.17.0) (2022-12-15) + + +### Features + +* Add files field to finding's list of attributes ([63c76ad](https://github.com/googleapis/python-securitycenter/commit/63c76adae5a4f45e7b9f330bac21c934bd46bac2)) +* Add kernel_rootkit field to finding's list of attributes ([#413](https://github.com/googleapis/python-securitycenter/issues/413)) ([62c9cb8](https://github.com/googleapis/python-securitycenter/commit/62c9cb879066162b9f30879cfa63de63ff27c63d)) +* Add support for `google.cloud.securitycenter.__version__` ([63c76ad](https://github.com/googleapis/python-securitycenter/commit/63c76adae5a4f45e7b9f330bac21c934bd46bac2)) +* Add typing to proto.Message based class attributes ([63c76ad](https://github.com/googleapis/python-securitycenter/commit/63c76adae5a4f45e7b9f330bac21c934bd46bac2)) +* Add user_name field to the finding access ([#418](https://github.com/googleapis/python-securitycenter/issues/418)) ([ced00fd](https://github.com/googleapis/python-securitycenter/commit/ced00fdf89d33a078bce530f320b2601466eae8e)) +* Adding project/folder level parents to notification configs in SCC ([#403](https://github.com/googleapis/python-securitycenter/issues/403)) ([667729a](https://github.com/googleapis/python-securitycenter/commit/667729a0ef3b59269302d68f53cd52d1068cf4fa)) + + +### Bug Fixes + +* Add dict typing for client_options ([63c76ad](https://github.com/googleapis/python-securitycenter/commit/63c76adae5a4f45e7b9f330bac21c934bd46bac2)) +* **deps:** Require google-api-core >=1.34.0, >=2.11.0 ([fae54be](https://github.com/googleapis/python-securitycenter/commit/fae54bea80a45616dab340530b8cceacda58ce1c)) +* Drop usage of pkg_resources ([fae54be](https://github.com/googleapis/python-securitycenter/commit/fae54bea80a45616dab340530b8cceacda58ce1c)) +* Fix timeout default values ([fae54be](https://github.com/googleapis/python-securitycenter/commit/fae54bea80a45616dab340530b8cceacda58ce1c)) + + +### Documentation + +* **samples:** Snippetgen handling of repeated enum field ([63c76ad](https://github.com/googleapis/python-securitycenter/commit/63c76adae5a4f45e7b9f330bac21c934bd46bac2)) +* **samples:** Snippetgen should call await on the operation coroutine before calling result ([fae54be](https://github.com/googleapis/python-securitycenter/commit/fae54bea80a45616dab340530b8cceacda58ce1c)) +* **samples:** Update samples to include new parent levels (folder and project) ([#405](https://github.com/googleapis/python-securitycenter/issues/405)) ([5960173](https://github.com/googleapis/python-securitycenter/commit/596017339116c243c5f42d9942fd4a37afd9207c)) + ## [1.16.2](https://github.com/googleapis/python-securitycenter/compare/v1.16.1...v1.16.2) (2022-10-07) diff --git a/docs/securitycenter_v1/types.rst b/docs/securitycenter_v1/types.rst index 460aec08..f7497757 100644 --- a/docs/securitycenter_v1/types.rst +++ b/docs/securitycenter_v1/types.rst @@ -3,5 +3,4 @@ Types for Google Cloud Securitycenter v1 API .. automodule:: google.cloud.securitycenter_v1.types :members: - :undoc-members: :show-inheritance: diff --git a/docs/securitycenter_v1beta1/types.rst b/docs/securitycenter_v1beta1/types.rst index 44bb4fec..0bbeba06 100644 --- a/docs/securitycenter_v1beta1/types.rst +++ b/docs/securitycenter_v1beta1/types.rst @@ -3,5 +3,4 @@ Types for Google Cloud Securitycenter v1beta1 API .. automodule:: google.cloud.securitycenter_v1beta1.types :members: - :undoc-members: :show-inheritance: diff --git a/docs/securitycenter_v1p1beta1/types.rst b/docs/securitycenter_v1p1beta1/types.rst index 1facc905..a68ac5c6 100644 --- a/docs/securitycenter_v1p1beta1/types.rst +++ b/docs/securitycenter_v1p1beta1/types.rst @@ -3,5 +3,4 @@ Types for Google Cloud Securitycenter v1p1beta1 API .. automodule:: google.cloud.securitycenter_v1p1beta1.types :members: - :undoc-members: :show-inheritance: diff --git a/google/cloud/securitycenter/__init__.py b/google/cloud/securitycenter/__init__.py index e039095f..0605464d 100644 --- a/google/cloud/securitycenter/__init__.py +++ b/google/cloud/securitycenter/__init__.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.cloud.securitycenter import gapic_version as package_version + +__version__ = package_version.__version__ + from google.cloud.securitycenter_v1.services.security_center.async_client import ( SecurityCenterAsyncClient, @@ -42,6 +46,7 @@ from google.cloud.securitycenter_v1.types.folder import Folder from google.cloud.securitycenter_v1.types.iam_binding import IamBinding from google.cloud.securitycenter_v1.types.indicator import Indicator +from google.cloud.securitycenter_v1.types.kernel_rootkit import KernelRootkit from google.cloud.securitycenter_v1.types.kubernetes import Kubernetes from google.cloud.securitycenter_v1.types.label import Label from google.cloud.securitycenter_v1.types.mitre_attack import MitreAttack @@ -134,6 +139,7 @@ "Folder", "IamBinding", "Indicator", + "KernelRootkit", "Kubernetes", "Label", "MitreAttack", diff --git a/google/cloud/securitycenter/gapic_version.py b/google/cloud/securitycenter/gapic_version.py new file mode 100644 index 00000000..cb72862e --- /dev/null +++ b/google/cloud/securitycenter/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "1.17.0" # {x-release-please-version} diff --git a/google/cloud/securitycenter_v1/__init__.py b/google/cloud/securitycenter_v1/__init__.py index 84a3c5a6..0152ba9b 100644 --- a/google/cloud/securitycenter_v1/__init__.py +++ b/google/cloud/securitycenter_v1/__init__.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.cloud.securitycenter import gapic_version as package_version + +__version__ = package_version.__version__ + from .services.security_center import SecurityCenterAsyncClient, SecurityCenterClient from .types.access import Access, Geolocation, ServiceAccountDelegationInfo @@ -30,6 +34,7 @@ from .types.folder import Folder from .types.iam_binding import IamBinding from .types.indicator import Indicator +from .types.kernel_rootkit import KernelRootkit from .types.kubernetes import Kubernetes from .types.label import Label from .types.mitre_attack import MitreAttack @@ -132,6 +137,7 @@ "GroupResult", "IamBinding", "Indicator", + "KernelRootkit", "Kubernetes", "Label", "ListAssetsRequest", diff --git a/google/cloud/securitycenter_v1/gapic_version.py b/google/cloud/securitycenter_v1/gapic_version.py new file mode 100644 index 00000000..cb72862e --- /dev/null +++ b/google/cloud/securitycenter_v1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "1.17.0" # {x-release-please-version} diff --git a/google/cloud/securitycenter_v1/services/security_center/async_client.py b/google/cloud/securitycenter_v1/services/security_center/async_client.py index 1092ec28..974482c5 100644 --- a/google/cloud/securitycenter_v1/services/security_center/async_client.py +++ b/google/cloud/securitycenter_v1/services/security_center/async_client.py @@ -16,7 +16,17 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 @@ -24,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.securitycenter_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -52,6 +63,7 @@ from google.cloud.securitycenter_v1.types import ( iam_binding, indicator, + kernel_rootkit, kubernetes, mitre_attack, ) @@ -64,6 +76,7 @@ organization_settings as gcs_organization_settings, ) from google.cloud.securitycenter_v1.types import security_marks as gcs_security_marks +from google.cloud.securitycenter_v1.types import file from google.cloud.securitycenter_v1.types import finding from google.cloud.securitycenter_v1.types import finding as gcs_finding from google.cloud.securitycenter_v1.types import mute_config @@ -233,9 +246,9 @@ def transport(self) -> SecurityCenterTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, SecurityCenterTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the security center client. @@ -279,11 +292,13 @@ def __init__( async def bulk_mute_findings( self, - request: Union[securitycenter_service.BulkMuteFindingsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.BulkMuteFindingsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Kicks off an LRO to bulk mute findings for a parent @@ -316,13 +331,13 @@ async def sample_bulk_mute_findings(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.BulkMuteFindingsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.BulkMuteFindingsRequest, dict]]): The request object. Request message for bulk findings update. Note: @@ -408,12 +423,14 @@ async def sample_bulk_mute_findings(): async def create_source( self, - request: Union[securitycenter_service.CreateSourceRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateSourceRequest, dict] + ] = None, *, - parent: str = None, - source: gcs_source.Source = None, + parent: Optional[str] = None, + source: Optional[gcs_source.Source] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_source.Source: r"""Creates a source. @@ -445,7 +462,7 @@ async def sample_create_source(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.CreateSourceRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.CreateSourceRequest, dict]]): The request object. Request message for creating a source. parent (:class:`str`): @@ -525,13 +542,15 @@ async def sample_create_source(): async def create_finding( self, - request: Union[securitycenter_service.CreateFindingRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateFindingRequest, dict] + ] = None, *, - parent: str = None, - finding_id: str = None, - finding: gcs_finding.Finding = None, + parent: Optional[str] = None, + finding_id: Optional[str] = None, + finding: Optional[gcs_finding.Finding] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_finding.Finding: r"""Creates a finding. The corresponding source must @@ -565,7 +584,7 @@ async def sample_create_finding(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.CreateFindingRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.CreateFindingRequest, dict]]): The request object. Request message for creating a finding. parent (:class:`str`): @@ -661,13 +680,15 @@ async def sample_create_finding(): async def create_mute_config( self, - request: Union[securitycenter_service.CreateMuteConfigRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateMuteConfigRequest, dict] + ] = None, *, - parent: str = None, - mute_config: gcs_mute_config.MuteConfig = None, - mute_config_id: str = None, + parent: Optional[str] = None, + mute_config: Optional[gcs_mute_config.MuteConfig] = None, + mute_config_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_mute_config.MuteConfig: r"""Creates a mute config. @@ -704,7 +725,7 @@ async def sample_create_mute_config(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.CreateMuteConfigRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.CreateMuteConfigRequest, dict]]): The request object. Request message for creating a mute config. parent (:class:`str`): @@ -794,15 +815,17 @@ async def sample_create_mute_config(): async def create_notification_config( self, - request: Union[ - securitycenter_service.CreateNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.CreateNotificationConfigRequest, dict] ] = None, *, - parent: str = None, - config_id: str = None, - notification_config: gcs_notification_config.NotificationConfig = None, + parent: Optional[str] = None, + config_id: Optional[str] = None, + notification_config: Optional[ + gcs_notification_config.NotificationConfig + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_notification_config.NotificationConfig: r"""Creates a notification config. @@ -835,12 +858,13 @@ async def sample_create_notification_config(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.CreateNotificationConfigRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.CreateNotificationConfigRequest, dict]]): The request object. Request message for creating a notification config. parent (:class:`str`): Required. Resource name of the new notification config's - parent. Its format is "organizations/[organization_id]". + parent. Its format is "organizations/[organization_id]", + "folders/[folder_id]", or "projects/[project_id]". This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -849,9 +873,9 @@ async def sample_create_notification_config(): Required. Unique identifier provided by the client within the parent scope. It must be - between 1 and 128 characters, and - contains alphanumeric characters, - underscores or hyphens only. + between 1 and 128 characters and contain + alphanumeric characters, underscores, or + hyphens only. This corresponds to the ``config_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -929,11 +953,13 @@ async def sample_create_notification_config(): async def delete_mute_config( self, - request: Union[securitycenter_service.DeleteMuteConfigRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.DeleteMuteConfigRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes an existing mute config. @@ -962,7 +988,7 @@ async def sample_delete_mute_config(): await client.delete_mute_config(request=request) Args: - request (Union[google.cloud.securitycenter_v1.types.DeleteMuteConfigRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.DeleteMuteConfigRequest, dict]]): The request object. Request message for deleting a mute config. name (:class:`str`): @@ -1021,13 +1047,13 @@ async def sample_delete_mute_config(): async def delete_notification_config( self, - request: Union[ - securitycenter_service.DeleteNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.DeleteNotificationConfigRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a notification config. @@ -1056,13 +1082,16 @@ async def sample_delete_notification_config(): await client.delete_notification_config(request=request) Args: - request (Union[google.cloud.securitycenter_v1.types.DeleteNotificationConfigRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.DeleteNotificationConfigRequest, dict]]): The request object. Request message for deleting a notification config. name (:class:`str`): Required. Name of the notification config to delete. Its format is - "organizations/[organization_id]/notificationConfigs/[config_id]". + "organizations/[organization_id]/notificationConfigs/[config_id]", + "folders/[folder_id]/notificationConfigs/[config_id]", + or + "projects/[project_id]/notificationConfigs/[config_id]". This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1114,14 +1143,16 @@ async def sample_delete_notification_config(): async def get_big_query_export( self, - request: Union[securitycenter_service.GetBigQueryExportRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GetBigQueryExportRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> bigquery_export.BigQueryExport: - r"""Gets a big query export. + r"""Gets a BigQuery export. .. code-block:: python @@ -1150,11 +1181,11 @@ async def sample_get_big_query_export(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.GetBigQueryExportRequest, dict]): - The request object. Request message for retrieving a big - query export. + request (Optional[Union[google.cloud.securitycenter_v1.types.GetBigQueryExportRequest, dict]]): + The request object. Request message for retrieving a + BigQuery export. name (:class:`str`): - Required. Name of the big query export to retrieve. Its + Required. Name of the BigQuery export to retrieve. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or @@ -1219,11 +1250,11 @@ async def sample_get_big_query_export(): async def get_iam_policy( self, - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the access control policy on the specified @@ -1257,7 +1288,7 @@ async def sample_get_iam_policy(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): + request (Optional[Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]]): The request object. Request message for `GetIamPolicy` method. resource (:class:`str`): @@ -1396,11 +1427,13 @@ async def sample_get_iam_policy(): async def get_mute_config( self, - request: Union[securitycenter_service.GetMuteConfigRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GetMuteConfigRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> mute_config.MuteConfig: r"""Gets a mute config. @@ -1432,7 +1465,7 @@ async def sample_get_mute_config(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.GetMuteConfigRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.GetMuteConfigRequest, dict]]): The request object. Request message for retrieving a mute config. name (:class:`str`): @@ -1502,13 +1535,13 @@ async def sample_get_mute_config(): async def get_notification_config( self, - request: Union[ - securitycenter_service.GetNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.GetNotificationConfigRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> notification_config.NotificationConfig: r"""Gets a notification config. @@ -1540,13 +1573,16 @@ async def sample_get_notification_config(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.GetNotificationConfigRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.GetNotificationConfigRequest, dict]]): The request object. Request message for getting a notification config. name (:class:`str`): Required. Name of the notification config to get. Its format is - "organizations/[organization_id]/notificationConfigs/[config_id]". + "organizations/[organization_id]/notificationConfigs/[config_id]", + "folders/[folder_id]/notificationConfigs/[config_id]", + or + "projects/[project_id]/notificationConfigs/[config_id]". This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1621,13 +1657,13 @@ async def sample_get_notification_config(): async def get_organization_settings( self, - request: Union[ - securitycenter_service.GetOrganizationSettingsRequest, dict + request: Optional[ + Union[securitycenter_service.GetOrganizationSettingsRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> organization_settings.OrganizationSettings: r"""Gets the settings for an organization. @@ -1659,7 +1695,7 @@ async def sample_get_organization_settings(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.GetOrganizationSettingsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.GetOrganizationSettingsRequest, dict]]): The request object. Request message for getting organization settings. name (:class:`str`): @@ -1737,11 +1773,11 @@ async def sample_get_organization_settings(): async def get_source( self, - request: Union[securitycenter_service.GetSourceRequest, dict] = None, + request: Optional[Union[securitycenter_service.GetSourceRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> source.Source: r"""Gets a source. @@ -1773,7 +1809,7 @@ async def sample_get_source(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.GetSourceRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.GetSourceRequest, dict]]): The request object. Request message for getting a source. name (:class:`str`): @@ -1854,10 +1890,12 @@ async def sample_get_source(): async def group_assets( self, - request: Union[securitycenter_service.GroupAssetsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GroupAssetsRequest, dict] + ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.GroupAssetsAsyncPager: r"""Filters an organization's assets and groups them by @@ -1892,7 +1930,7 @@ async def sample_group_assets(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.GroupAssetsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.GroupAssetsRequest, dict]]): The request object. Request message for grouping by assets. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1959,12 +1997,14 @@ async def sample_group_assets(): async def group_findings( self, - request: Union[securitycenter_service.GroupFindingsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GroupFindingsRequest, dict] + ] = None, *, - parent: str = None, - group_by: str = None, + parent: Optional[str] = None, + group_by: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.GroupFindingsAsyncPager: r"""Filters an organization or source's findings and groups them by @@ -2004,7 +2044,7 @@ async def sample_group_findings(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.GroupFindingsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.GroupFindingsRequest, dict]]): The request object. Request message for grouping by findings. parent (:class:`str`): @@ -2122,10 +2162,10 @@ async def sample_group_findings(): async def list_assets( self, - request: Union[securitycenter_service.ListAssetsRequest, dict] = None, + request: Optional[Union[securitycenter_service.ListAssetsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListAssetsAsyncPager: r"""Lists an organization's assets. @@ -2158,7 +2198,7 @@ async def sample_list_assets(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.ListAssetsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.ListAssetsRequest, dict]]): The request object. Request message for listing assets. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -2223,10 +2263,12 @@ async def sample_list_assets(): async def list_findings( self, - request: Union[securitycenter_service.ListFindingsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListFindingsRequest, dict] + ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFindingsAsyncPager: r"""Lists an organization or source's findings. @@ -2262,7 +2304,7 @@ async def sample_list_findings(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.ListFindingsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.ListFindingsRequest, dict]]): The request object. Request message for listing findings. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -2329,11 +2371,13 @@ async def sample_list_findings(): async def list_mute_configs( self, - request: Union[securitycenter_service.ListMuteConfigsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListMuteConfigsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListMuteConfigsAsyncPager: r"""Lists mute configs. @@ -2366,7 +2410,7 @@ async def sample_list_mute_configs(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.ListMuteConfigsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.ListMuteConfigsRequest, dict]]): The request object. Request message for listing mute configs at a given scope e.g. organization, folder or project. @@ -2447,13 +2491,13 @@ async def sample_list_mute_configs(): async def list_notification_configs( self, - request: Union[ - securitycenter_service.ListNotificationConfigsRequest, dict + request: Optional[ + Union[securitycenter_service.ListNotificationConfigsRequest, dict] ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListNotificationConfigsAsyncPager: r"""Lists notification configs. @@ -2486,13 +2530,14 @@ async def sample_list_notification_configs(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.ListNotificationConfigsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.ListNotificationConfigsRequest, dict]]): The request object. Request message for listing notification configs. parent (:class:`str`): - Required. Name of the organization to list notification - configs. Its format is - "organizations/[organization_id]". + Required. The name of the parent in which to list the + notification configurations. Its format is + "organizations/[organization_id]", + "folders/[folder_id]", or "projects/[project_id]". This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2575,11 +2620,13 @@ async def sample_list_notification_configs(): async def list_sources( self, - request: Union[securitycenter_service.ListSourcesRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListSourcesRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListSourcesAsyncPager: r"""Lists all sources belonging to an organization. @@ -2612,7 +2659,7 @@ async def sample_list_sources(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.ListSourcesRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.ListSourcesRequest, dict]]): The request object. Request message for listing sources. parent (:class:`str`): Required. Resource name of the parent of sources to @@ -2700,11 +2747,13 @@ async def sample_list_sources(): async def run_asset_discovery( self, - request: Union[securitycenter_service.RunAssetDiscoveryRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.RunAssetDiscoveryRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Runs asset discovery. The discovery is tracked with a @@ -2739,13 +2788,13 @@ async def sample_run_asset_discovery(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.RunAssetDiscoveryRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.RunAssetDiscoveryRequest, dict]]): The request object. Request message for running asset discovery for an organization. parent (:class:`str`): @@ -2823,13 +2872,15 @@ async def sample_run_asset_discovery(): async def set_finding_state( self, - request: Union[securitycenter_service.SetFindingStateRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.SetFindingStateRequest, dict] + ] = None, *, - name: str = None, - state: finding.Finding.State = None, - start_time: timestamp_pb2.Timestamp = None, + name: Optional[str] = None, + state: Optional[finding.Finding.State] = None, + start_time: Optional[timestamp_pb2.Timestamp] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> finding.Finding: r"""Updates the state of a finding. @@ -2862,15 +2913,16 @@ async def sample_set_finding_state(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.SetFindingStateRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.SetFindingStateRequest, dict]]): The request object. Request message for updating a finding's state. name (:class:`str`): - Required. The relative resource name of the finding. - See: - https://cloud.google.com/apis/design/resource_names#relative_resource_name - Example: - "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + Required. The `relative resource + name `__ + of the finding. Example: + "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + "projects/{project_id}/sources/{source_id}/findings/{finding_id}". This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -2956,12 +3008,12 @@ async def sample_set_finding_state(): async def set_mute( self, - request: Union[securitycenter_service.SetMuteRequest, dict] = None, + request: Optional[Union[securitycenter_service.SetMuteRequest, dict]] = None, *, - name: str = None, - mute: finding.Finding.Mute = None, + name: Optional[str] = None, + mute: Optional[finding.Finding.Mute] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> finding.Finding: r"""Updates the mute state of a finding. @@ -2994,17 +3046,16 @@ async def sample_set_mute(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.SetMuteRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.SetMuteRequest, dict]]): The request object. Request message for updating a finding's mute status. name (:class:`str`): - Required. The relative resource name of the finding. - See: - https://cloud.google.com/apis/design/resource_names#relative_resource_name - Example: - "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", - "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", - "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + Required. The `relative resource + name `__ + of the finding. Example: + "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + "projects/{project_id}/sources/{source_id}/findings/{finding_id}". This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -3081,11 +3132,11 @@ async def sample_set_mute(): async def set_iam_policy( self, - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the access control policy on the specified @@ -3119,7 +3170,7 @@ async def sample_set_iam_policy(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): + request (Optional[Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]]): The request object. Request message for `SetIamPolicy` method. resource (:class:`str`): @@ -3248,12 +3299,12 @@ async def sample_set_iam_policy(): async def test_iam_permissions( self, - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, - resource: str = None, - permissions: Sequence[str] = None, + resource: Optional[str] = None, + permissions: Optional[MutableSequence[str]] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns the permissions that a caller has on the @@ -3288,7 +3339,7 @@ async def sample_test_iam_permissions(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): + request (Optional[Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]]): The request object. Request message for `TestIamPermissions` method. resource (:class:`str`): @@ -3300,7 +3351,7 @@ async def sample_test_iam_permissions(): This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - permissions (:class:`Sequence[str]`): + permissions (:class:`MutableSequence[str]`): The set of permissions to check for the ``resource``. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see `IAM @@ -3376,12 +3427,14 @@ async def sample_test_iam_permissions(): async def update_external_system( self, - request: Union[securitycenter_service.UpdateExternalSystemRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateExternalSystemRequest, dict] + ] = None, *, - external_system: gcs_external_system.ExternalSystem = None, - update_mask: field_mask_pb2.FieldMask = None, + external_system: Optional[gcs_external_system.ExternalSystem] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_external_system.ExternalSystem: r"""Updates external system. This is for a given finding. @@ -3412,7 +3465,7 @@ async def sample_update_external_system(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.UpdateExternalSystemRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.UpdateExternalSystemRequest, dict]]): The request object. Request message for updating a ExternalSystem resource. external_system (:class:`google.cloud.securitycenter_v1.types.ExternalSystem`): @@ -3491,11 +3544,13 @@ async def sample_update_external_system(): async def update_finding( self, - request: Union[securitycenter_service.UpdateFindingRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateFindingRequest, dict] + ] = None, *, - finding: gcs_finding.Finding = None, + finding: Optional[gcs_finding.Finding] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_finding.Finding: r"""Creates or updates a finding. The corresponding @@ -3527,7 +3582,7 @@ async def sample_update_finding(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.UpdateFindingRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.UpdateFindingRequest, dict]]): The request object. Request message for updating or creating a finding. finding (:class:`google.cloud.securitycenter_v1.types.Finding`): @@ -3607,12 +3662,14 @@ async def sample_update_finding(): async def update_mute_config( self, - request: Union[securitycenter_service.UpdateMuteConfigRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateMuteConfigRequest, dict] + ] = None, *, - mute_config: gcs_mute_config.MuteConfig = None, - update_mask: field_mask_pb2.FieldMask = None, + mute_config: Optional[gcs_mute_config.MuteConfig] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_mute_config.MuteConfig: r"""Updates a mute config. @@ -3647,7 +3704,7 @@ async def sample_update_mute_config(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.UpdateMuteConfigRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.UpdateMuteConfigRequest, dict]]): The request object. Request message for updating a mute config. mute_config (:class:`google.cloud.securitycenter_v1.types.MuteConfig`): @@ -3726,14 +3783,16 @@ async def sample_update_mute_config(): async def update_notification_config( self, - request: Union[ - securitycenter_service.UpdateNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.UpdateNotificationConfigRequest, dict] ] = None, *, - notification_config: gcs_notification_config.NotificationConfig = None, - update_mask: field_mask_pb2.FieldMask = None, + notification_config: Optional[ + gcs_notification_config.NotificationConfig + ] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_notification_config.NotificationConfig: r"""Updates a notification config. The following update fields are @@ -3765,7 +3824,7 @@ async def sample_update_notification_config(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.UpdateNotificationConfigRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.UpdateNotificationConfigRequest, dict]]): The request object. Request message for updating a notification config. notification_config (:class:`google.cloud.securitycenter_v1.types.NotificationConfig`): @@ -3848,13 +3907,15 @@ async def sample_update_notification_config(): async def update_organization_settings( self, - request: Union[ - securitycenter_service.UpdateOrganizationSettingsRequest, dict + request: Optional[ + Union[securitycenter_service.UpdateOrganizationSettingsRequest, dict] ] = None, *, - organization_settings: gcs_organization_settings.OrganizationSettings = None, + organization_settings: Optional[ + gcs_organization_settings.OrganizationSettings + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_organization_settings.OrganizationSettings: r"""Updates an organization's settings. @@ -3885,7 +3946,7 @@ async def sample_update_organization_settings(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.UpdateOrganizationSettingsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.UpdateOrganizationSettingsRequest, dict]]): The request object. Request message for updating an organization's settings. organization_settings (:class:`google.cloud.securitycenter_v1.types.OrganizationSettings`): @@ -3954,11 +4015,13 @@ async def sample_update_organization_settings(): async def update_source( self, - request: Union[securitycenter_service.UpdateSourceRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateSourceRequest, dict] + ] = None, *, - source: gcs_source.Source = None, + source: Optional[gcs_source.Source] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_source.Source: r"""Updates a source. @@ -3989,7 +4052,7 @@ async def sample_update_source(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.UpdateSourceRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.UpdateSourceRequest, dict]]): The request object. Request message for updating a source. source (:class:`google.cloud.securitycenter_v1.types.Source`): @@ -4061,11 +4124,13 @@ async def sample_update_source(): async def update_security_marks( self, - request: Union[securitycenter_service.UpdateSecurityMarksRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateSecurityMarksRequest, dict] + ] = None, *, - security_marks: gcs_security_marks.SecurityMarks = None, + security_marks: Optional[gcs_security_marks.SecurityMarks] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_security_marks.SecurityMarks: r"""Updates security marks. @@ -4096,7 +4161,7 @@ async def sample_update_security_marks(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.UpdateSecurityMarksRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.UpdateSecurityMarksRequest, dict]]): The request object. Request message for updating a SecurityMarks resource. security_marks (:class:`google.cloud.securitycenter_v1.types.SecurityMarks`): @@ -4170,16 +4235,18 @@ async def sample_update_security_marks(): async def create_big_query_export( self, - request: Union[securitycenter_service.CreateBigQueryExportRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateBigQueryExportRequest, dict] + ] = None, *, - parent: str = None, - big_query_export: bigquery_export.BigQueryExport = None, - big_query_export_id: str = None, + parent: Optional[str] = None, + big_query_export: Optional[bigquery_export.BigQueryExport] = None, + big_query_export_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> bigquery_export.BigQueryExport: - r"""Creates a big query export. + r"""Creates a BigQuery export. .. code-block:: python @@ -4209,19 +4276,20 @@ async def sample_create_big_query_export(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.CreateBigQueryExportRequest, dict]): - The request object. Request message for creating a big - query export. + request (Optional[Union[google.cloud.securitycenter_v1.types.CreateBigQueryExportRequest, dict]]): + The request object. Request message for creating a + BigQuery export. parent (:class:`str`): - Required. Resource name of the new big query export's - parent. Its format is "organizations/[organization_id]", + Required. The name of the parent resource of the new + BigQuery export. Its format is + "organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]". This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. big_query_export (:class:`google.cloud.securitycenter_v1.types.BigQueryExport`): - Required. The big query export being + Required. The BigQuery export being created. This corresponds to the ``big_query_export`` field @@ -4298,14 +4366,16 @@ async def sample_create_big_query_export(): async def delete_big_query_export( self, - request: Union[securitycenter_service.DeleteBigQueryExportRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.DeleteBigQueryExportRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: - r"""Deletes an existing big query export. + r"""Deletes an existing BigQuery export. .. code-block:: python @@ -4331,11 +4401,11 @@ async def sample_delete_big_query_export(): await client.delete_big_query_export(request=request) Args: - request (Union[google.cloud.securitycenter_v1.types.DeleteBigQueryExportRequest, dict]): - The request object. Request message for deleting a big - query export. + request (Optional[Union[google.cloud.securitycenter_v1.types.DeleteBigQueryExportRequest, dict]]): + The request object. Request message for deleting a + BigQuery export. name (:class:`str`): - Required. Name of the big query export to delete. Its + Required. The name of the BigQuery export to delete. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or @@ -4391,12 +4461,14 @@ async def sample_delete_big_query_export(): async def update_big_query_export( self, - request: Union[securitycenter_service.UpdateBigQueryExportRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateBigQueryExportRequest, dict] + ] = None, *, - big_query_export: bigquery_export.BigQueryExport = None, - update_mask: field_mask_pb2.FieldMask = None, + big_query_export: Optional[bigquery_export.BigQueryExport] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> bigquery_export.BigQueryExport: r"""Updates a BigQuery export. @@ -4427,7 +4499,7 @@ async def sample_update_big_query_export(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.UpdateBigQueryExportRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1.types.UpdateBigQueryExportRequest, dict]]): The request object. Request message for updating a BigQuery export. big_query_export (:class:`google.cloud.securitycenter_v1.types.BigQueryExport`): @@ -4505,11 +4577,13 @@ async def sample_update_big_query_export(): async def list_big_query_exports( self, - request: Union[securitycenter_service.ListBigQueryExportsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListBigQueryExportsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListBigQueryExportsAsyncPager: r"""Lists BigQuery exports. Note that when requesting @@ -4547,10 +4621,10 @@ async def sample_list_big_query_exports(): print(response) Args: - request (Union[google.cloud.securitycenter_v1.types.ListBigQueryExportsRequest, dict]): - The request object. Request message for listing - BigQuery exports at a given scope e.g. organization, - folder or project. + request (Optional[Union[google.cloud.securitycenter_v1.types.ListBigQueryExportsRequest, dict]]): + The request object. Request message for listing BigQuery + exports at a given scope e.g. organization, folder or + project. parent (:class:`str`): Required. The parent, which owns the collection of BigQuery exports. Its format is @@ -4633,14 +4707,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-securitycenter", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SecurityCenterAsyncClient",) diff --git a/google/cloud/securitycenter_v1/services/security_center/client.py b/google/cloud/securitycenter_v1/services/security_center/client.py index 1e403d9f..f12c2753 100644 --- a/google/cloud/securitycenter_v1/services/security_center/client.py +++ b/google/cloud/securitycenter_v1/services/security_center/client.py @@ -16,7 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -27,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.securitycenter_v1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -55,6 +67,7 @@ from google.cloud.securitycenter_v1.types import ( iam_binding, indicator, + kernel_rootkit, kubernetes, mitre_attack, ) @@ -67,6 +80,7 @@ organization_settings as gcs_organization_settings, ) from google.cloud.securitycenter_v1.types import security_marks as gcs_security_marks +from google.cloud.securitycenter_v1.types import file from google.cloud.securitycenter_v1.types import finding from google.cloud.securitycenter_v1.types import finding as gcs_finding from google.cloud.securitycenter_v1.types import mute_config @@ -100,7 +114,7 @@ class SecurityCenterClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[SecurityCenterTransport]: """Returns an appropriate transport class. @@ -553,8 +567,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, SecurityCenterTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, SecurityCenterTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the security center client. @@ -568,7 +582,7 @@ def __init__( transport (Union[str, SecurityCenterTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -598,6 +612,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -650,11 +665,13 @@ def __init__( def bulk_mute_findings( self, - request: Union[securitycenter_service.BulkMuteFindingsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.BulkMuteFindingsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Kicks off an LRO to bulk mute findings for a parent @@ -779,12 +796,14 @@ def sample_bulk_mute_findings(): def create_source( self, - request: Union[securitycenter_service.CreateSourceRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateSourceRequest, dict] + ] = None, *, - parent: str = None, - source: gcs_source.Source = None, + parent: Optional[str] = None, + source: Optional[gcs_source.Source] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_source.Source: r"""Creates a source. @@ -896,13 +915,15 @@ def sample_create_source(): def create_finding( self, - request: Union[securitycenter_service.CreateFindingRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateFindingRequest, dict] + ] = None, *, - parent: str = None, - finding_id: str = None, - finding: gcs_finding.Finding = None, + parent: Optional[str] = None, + finding_id: Optional[str] = None, + finding: Optional[gcs_finding.Finding] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_finding.Finding: r"""Creates a finding. The corresponding source must @@ -1032,13 +1053,15 @@ def sample_create_finding(): def create_mute_config( self, - request: Union[securitycenter_service.CreateMuteConfigRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateMuteConfigRequest, dict] + ] = None, *, - parent: str = None, - mute_config: gcs_mute_config.MuteConfig = None, - mute_config_id: str = None, + parent: Optional[str] = None, + mute_config: Optional[gcs_mute_config.MuteConfig] = None, + mute_config_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_mute_config.MuteConfig: r"""Creates a mute config. @@ -1165,15 +1188,17 @@ def sample_create_mute_config(): def create_notification_config( self, - request: Union[ - securitycenter_service.CreateNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.CreateNotificationConfigRequest, dict] ] = None, *, - parent: str = None, - config_id: str = None, - notification_config: gcs_notification_config.NotificationConfig = None, + parent: Optional[str] = None, + config_id: Optional[str] = None, + notification_config: Optional[ + gcs_notification_config.NotificationConfig + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_notification_config.NotificationConfig: r"""Creates a notification config. @@ -1211,7 +1236,8 @@ def sample_create_notification_config(): notification config. parent (str): Required. Resource name of the new notification config's - parent. Its format is "organizations/[organization_id]". + parent. Its format is "organizations/[organization_id]", + "folders/[folder_id]", or "projects/[project_id]". This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -1220,9 +1246,9 @@ def sample_create_notification_config(): Required. Unique identifier provided by the client within the parent scope. It must be - between 1 and 128 characters, and - contains alphanumeric characters, - underscores or hyphens only. + between 1 and 128 characters and contain + alphanumeric characters, underscores, or + hyphens only. This corresponds to the ``config_id`` field on the ``request`` instance; if ``request`` is provided, this @@ -1304,11 +1330,13 @@ def sample_create_notification_config(): def delete_mute_config( self, - request: Union[securitycenter_service.DeleteMuteConfigRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.DeleteMuteConfigRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes an existing mute config. @@ -1396,13 +1424,13 @@ def sample_delete_mute_config(): def delete_notification_config( self, - request: Union[ - securitycenter_service.DeleteNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.DeleteNotificationConfigRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a notification config. @@ -1437,7 +1465,10 @@ def sample_delete_notification_config(): name (str): Required. Name of the notification config to delete. Its format is - "organizations/[organization_id]/notificationConfigs/[config_id]". + "organizations/[organization_id]/notificationConfigs/[config_id]", + "folders/[folder_id]/notificationConfigs/[config_id]", + or + "projects/[project_id]/notificationConfigs/[config_id]". This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1493,14 +1524,16 @@ def sample_delete_notification_config(): def get_big_query_export( self, - request: Union[securitycenter_service.GetBigQueryExportRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GetBigQueryExportRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> bigquery_export.BigQueryExport: - r"""Gets a big query export. + r"""Gets a BigQuery export. .. code-block:: python @@ -1530,10 +1563,10 @@ def sample_get_big_query_export(): Args: request (Union[google.cloud.securitycenter_v1.types.GetBigQueryExportRequest, dict]): - The request object. Request message for retrieving a big - query export. + The request object. Request message for retrieving a + BigQuery export. name (str): - Required. Name of the big query export to retrieve. Its + Required. Name of the BigQuery export to retrieve. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or @@ -1598,11 +1631,11 @@ def sample_get_big_query_export(): def get_iam_policy( self, - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the access control policy on the specified @@ -1762,11 +1795,13 @@ def sample_get_iam_policy(): def get_mute_config( self, - request: Union[securitycenter_service.GetMuteConfigRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GetMuteConfigRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> mute_config.MuteConfig: r"""Gets a mute config. @@ -1868,13 +1903,13 @@ def sample_get_mute_config(): def get_notification_config( self, - request: Union[ - securitycenter_service.GetNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.GetNotificationConfigRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> notification_config.NotificationConfig: r"""Gets a notification config. @@ -1912,7 +1947,10 @@ def sample_get_notification_config(): name (str): Required. Name of the notification config to get. Its format is - "organizations/[organization_id]/notificationConfigs/[config_id]". + "organizations/[organization_id]/notificationConfigs/[config_id]", + "folders/[folder_id]/notificationConfigs/[config_id]", + or + "projects/[project_id]/notificationConfigs/[config_id]". This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -1977,13 +2015,13 @@ def sample_get_notification_config(): def get_organization_settings( self, - request: Union[ - securitycenter_service.GetOrganizationSettingsRequest, dict + request: Optional[ + Union[securitycenter_service.GetOrganizationSettingsRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> organization_settings.OrganizationSettings: r"""Gets the settings for an organization. @@ -2087,11 +2125,11 @@ def sample_get_organization_settings(): def get_source( self, - request: Union[securitycenter_service.GetSourceRequest, dict] = None, + request: Optional[Union[securitycenter_service.GetSourceRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> source.Source: r"""Gets a source. @@ -2194,10 +2232,12 @@ def sample_get_source(): def group_assets( self, - request: Union[securitycenter_service.GroupAssetsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GroupAssetsRequest, dict] + ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.GroupAssetsPager: r"""Filters an organization's assets and groups them by @@ -2290,12 +2330,14 @@ def sample_group_assets(): def group_findings( self, - request: Union[securitycenter_service.GroupFindingsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GroupFindingsRequest, dict] + ] = None, *, - parent: str = None, - group_by: str = None, + parent: Optional[str] = None, + group_by: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.GroupFindingsPager: r"""Filters an organization or source's findings and groups them by @@ -2443,10 +2485,10 @@ def sample_group_findings(): def list_assets( self, - request: Union[securitycenter_service.ListAssetsRequest, dict] = None, + request: Optional[Union[securitycenter_service.ListAssetsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListAssetsPager: r"""Lists an organization's assets. @@ -2535,10 +2577,12 @@ def sample_list_assets(): def list_findings( self, - request: Union[securitycenter_service.ListFindingsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListFindingsRequest, dict] + ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFindingsPager: r"""Lists an organization or source's findings. @@ -2632,11 +2676,13 @@ def sample_list_findings(): def list_mute_configs( self, - request: Union[securitycenter_service.ListMuteConfigsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListMuteConfigsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListMuteConfigsPager: r"""Lists mute configs. @@ -2750,13 +2796,13 @@ def sample_list_mute_configs(): def list_notification_configs( self, - request: Union[ - securitycenter_service.ListNotificationConfigsRequest, dict + request: Optional[ + Union[securitycenter_service.ListNotificationConfigsRequest, dict] ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListNotificationConfigsPager: r"""Lists notification configs. @@ -2793,9 +2839,10 @@ def sample_list_notification_configs(): The request object. Request message for listing notification configs. parent (str): - Required. Name of the organization to list notification - configs. Its format is - "organizations/[organization_id]". + Required. The name of the parent in which to list the + notification configurations. Its format is + "organizations/[organization_id]", + "folders/[folder_id]", or "projects/[project_id]". This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -2872,11 +2919,13 @@ def sample_list_notification_configs(): def list_sources( self, - request: Union[securitycenter_service.ListSourcesRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListSourcesRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListSourcesPager: r"""Lists all sources belonging to an organization. @@ -2987,11 +3036,13 @@ def sample_list_sources(): def run_asset_discovery( self, - request: Union[securitycenter_service.RunAssetDiscoveryRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.RunAssetDiscoveryRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Runs asset discovery. The discovery is tracked with a @@ -3110,13 +3161,15 @@ def sample_run_asset_discovery(): def set_finding_state( self, - request: Union[securitycenter_service.SetFindingStateRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.SetFindingStateRequest, dict] + ] = None, *, - name: str = None, - state: finding.Finding.State = None, - start_time: timestamp_pb2.Timestamp = None, + name: Optional[str] = None, + state: Optional[finding.Finding.State] = None, + start_time: Optional[timestamp_pb2.Timestamp] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> finding.Finding: r"""Updates the state of a finding. @@ -3153,11 +3206,12 @@ def sample_set_finding_state(): The request object. Request message for updating a finding's state. name (str): - Required. The relative resource name of the finding. - See: - https://cloud.google.com/apis/design/resource_names#relative_resource_name - Example: - "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + Required. The `relative resource + name `__ + of the finding. Example: + "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + "projects/{project_id}/sources/{source_id}/findings/{finding_id}". This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -3243,12 +3297,12 @@ def sample_set_finding_state(): def set_mute( self, - request: Union[securitycenter_service.SetMuteRequest, dict] = None, + request: Optional[Union[securitycenter_service.SetMuteRequest, dict]] = None, *, - name: str = None, - mute: finding.Finding.Mute = None, + name: Optional[str] = None, + mute: Optional[finding.Finding.Mute] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> finding.Finding: r"""Updates the mute state of a finding. @@ -3285,13 +3339,12 @@ def sample_set_mute(): The request object. Request message for updating a finding's mute status. name (str): - Required. The relative resource name of the finding. - See: - https://cloud.google.com/apis/design/resource_names#relative_resource_name - Example: - "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", - "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", - "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + Required. The `relative resource + name `__ + of the finding. Example: + "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + "projects/{project_id}/sources/{source_id}/findings/{finding_id}". This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this @@ -3368,11 +3421,11 @@ def sample_set_mute(): def set_iam_policy( self, - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the access control policy on the specified @@ -3532,12 +3585,12 @@ def sample_set_iam_policy(): def test_iam_permissions( self, - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, - resource: str = None, - permissions: Sequence[str] = None, + resource: Optional[str] = None, + permissions: Optional[MutableSequence[str]] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns the permissions that a caller has on the @@ -3584,7 +3637,7 @@ def sample_test_iam_permissions(): This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - permissions (Sequence[str]): + permissions (MutableSequence[str]): The set of permissions to check for the ``resource``. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see `IAM @@ -3648,12 +3701,14 @@ def sample_test_iam_permissions(): def update_external_system( self, - request: Union[securitycenter_service.UpdateExternalSystemRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateExternalSystemRequest, dict] + ] = None, *, - external_system: gcs_external_system.ExternalSystem = None, - update_mask: field_mask_pb2.FieldMask = None, + external_system: Optional[gcs_external_system.ExternalSystem] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_external_system.ExternalSystem: r"""Updates external system. This is for a given finding. @@ -3763,11 +3818,13 @@ def sample_update_external_system(): def update_finding( self, - request: Union[securitycenter_service.UpdateFindingRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateFindingRequest, dict] + ] = None, *, - finding: gcs_finding.Finding = None, + finding: Optional[gcs_finding.Finding] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_finding.Finding: r"""Creates or updates a finding. The corresponding @@ -3879,12 +3936,14 @@ def sample_update_finding(): def update_mute_config( self, - request: Union[securitycenter_service.UpdateMuteConfigRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateMuteConfigRequest, dict] + ] = None, *, - mute_config: gcs_mute_config.MuteConfig = None, - update_mask: field_mask_pb2.FieldMask = None, + mute_config: Optional[gcs_mute_config.MuteConfig] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_mute_config.MuteConfig: r"""Updates a mute config. @@ -3998,14 +4057,16 @@ def sample_update_mute_config(): def update_notification_config( self, - request: Union[ - securitycenter_service.UpdateNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.UpdateNotificationConfigRequest, dict] ] = None, *, - notification_config: gcs_notification_config.NotificationConfig = None, - update_mask: field_mask_pb2.FieldMask = None, + notification_config: Optional[ + gcs_notification_config.NotificationConfig + ] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_notification_config.NotificationConfig: r"""Updates a notification config. The following update fields are @@ -4124,13 +4185,15 @@ def sample_update_notification_config(): def update_organization_settings( self, - request: Union[ - securitycenter_service.UpdateOrganizationSettingsRequest, dict + request: Optional[ + Union[securitycenter_service.UpdateOrganizationSettingsRequest, dict] ] = None, *, - organization_settings: gcs_organization_settings.OrganizationSettings = None, + organization_settings: Optional[ + gcs_organization_settings.OrganizationSettings + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_organization_settings.OrganizationSettings: r"""Updates an organization's settings. @@ -4234,11 +4297,13 @@ def sample_update_organization_settings(): def update_source( self, - request: Union[securitycenter_service.UpdateSourceRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateSourceRequest, dict] + ] = None, *, - source: gcs_source.Source = None, + source: Optional[gcs_source.Source] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_source.Source: r"""Updates a source. @@ -4341,11 +4406,13 @@ def sample_update_source(): def update_security_marks( self, - request: Union[securitycenter_service.UpdateSecurityMarksRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateSecurityMarksRequest, dict] + ] = None, *, - security_marks: gcs_security_marks.SecurityMarks = None, + security_marks: Optional[gcs_security_marks.SecurityMarks] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_security_marks.SecurityMarks: r"""Updates security marks. @@ -4450,16 +4517,18 @@ def sample_update_security_marks(): def create_big_query_export( self, - request: Union[securitycenter_service.CreateBigQueryExportRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateBigQueryExportRequest, dict] + ] = None, *, - parent: str = None, - big_query_export: bigquery_export.BigQueryExport = None, - big_query_export_id: str = None, + parent: Optional[str] = None, + big_query_export: Optional[bigquery_export.BigQueryExport] = None, + big_query_export_id: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> bigquery_export.BigQueryExport: - r"""Creates a big query export. + r"""Creates a BigQuery export. .. code-block:: python @@ -4490,18 +4559,19 @@ def sample_create_big_query_export(): Args: request (Union[google.cloud.securitycenter_v1.types.CreateBigQueryExportRequest, dict]): - The request object. Request message for creating a big - query export. + The request object. Request message for creating a + BigQuery export. parent (str): - Required. Resource name of the new big query export's - parent. Its format is "organizations/[organization_id]", + Required. The name of the parent resource of the new + BigQuery export. Its format is + "organizations/[organization_id]", "folders/[folder_id]", or "projects/[project_id]". This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. big_query_export (google.cloud.securitycenter_v1.types.BigQueryExport): - Required. The big query export being + Required. The BigQuery export being created. This corresponds to the ``big_query_export`` field @@ -4578,14 +4648,16 @@ def sample_create_big_query_export(): def delete_big_query_export( self, - request: Union[securitycenter_service.DeleteBigQueryExportRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.DeleteBigQueryExportRequest, dict] + ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: - r"""Deletes an existing big query export. + r"""Deletes an existing BigQuery export. .. code-block:: python @@ -4612,10 +4684,10 @@ def sample_delete_big_query_export(): Args: request (Union[google.cloud.securitycenter_v1.types.DeleteBigQueryExportRequest, dict]): - The request object. Request message for deleting a big - query export. + The request object. Request message for deleting a + BigQuery export. name (str): - Required. Name of the big query export to delete. Its + Required. The name of the BigQuery export to delete. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or @@ -4671,12 +4743,14 @@ def sample_delete_big_query_export(): def update_big_query_export( self, - request: Union[securitycenter_service.UpdateBigQueryExportRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateBigQueryExportRequest, dict] + ] = None, *, - big_query_export: bigquery_export.BigQueryExport = None, - update_mask: field_mask_pb2.FieldMask = None, + big_query_export: Optional[bigquery_export.BigQueryExport] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> bigquery_export.BigQueryExport: r"""Updates a BigQuery export. @@ -4785,11 +4859,13 @@ def sample_update_big_query_export(): def list_big_query_exports( self, - request: Union[securitycenter_service.ListBigQueryExportsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListBigQueryExportsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListBigQueryExportsPager: r"""Lists BigQuery exports. Note that when requesting @@ -4828,9 +4904,9 @@ def sample_list_big_query_exports(): Args: request (Union[google.cloud.securitycenter_v1.types.ListBigQueryExportsRequest, dict]): - The request object. Request message for listing - BigQuery exports at a given scope e.g. organization, - folder or project. + The request object. Request message for listing BigQuery + exports at a given scope e.g. organization, folder or + project. parent (str): Required. The parent, which owns the collection of BigQuery exports. Its format is @@ -4920,14 +4996,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-securitycenter", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SecurityCenterClient",) diff --git a/google/cloud/securitycenter_v1/services/security_center/transports/base.py b/google/cloud/securitycenter_v1/services/security_center/transports/base.py index abd748d0..9c8ae781 100644 --- a/google/cloud/securitycenter_v1/services/security_center/transports/base.py +++ b/google/cloud/securitycenter_v1/services/security_center/transports/base.py @@ -27,8 +27,8 @@ from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.securitycenter_v1 import gapic_version as package_version from google.cloud.securitycenter_v1.types import external_system as gcs_external_system from google.cloud.securitycenter_v1.types import ( notification_config as gcs_notification_config, @@ -48,14 +48,9 @@ from google.cloud.securitycenter_v1.types import source from google.cloud.securitycenter_v1.types import source as gcs_source -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-securitycenter", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class SecurityCenterTransport(abc.ABC): @@ -69,7 +64,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/securitycenter_v1/services/security_center/transports/grpc.py b/google/cloud/securitycenter_v1/services/security_center/transports/grpc.py index 7926759d..180962c2 100644 --- a/google/cloud/securitycenter_v1/services/security_center/transports/grpc.py +++ b/google/cloud/securitycenter_v1/services/security_center/transports/grpc.py @@ -67,14 +67,14 @@ def __init__( self, *, host: str = "securitycenter.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -202,8 +202,8 @@ def __init__( def create_channel( cls, host: str = "securitycenter.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, @@ -468,7 +468,7 @@ def get_big_query_export( ]: r"""Return a callable for the get big query export method over gRPC. - Gets a big query export. + Gets a BigQuery export. Returns: Callable[[~.GetBigQueryExportRequest], @@ -1189,7 +1189,7 @@ def create_big_query_export( ]: r"""Return a callable for the create big query export method over gRPC. - Creates a big query export. + Creates a BigQuery export. Returns: Callable[[~.CreateBigQueryExportRequest], @@ -1217,7 +1217,7 @@ def delete_big_query_export( ]: r"""Return a callable for the delete big query export method over gRPC. - Deletes an existing big query export. + Deletes an existing BigQuery export. Returns: Callable[[~.DeleteBigQueryExportRequest], diff --git a/google/cloud/securitycenter_v1/services/security_center/transports/grpc_asyncio.py b/google/cloud/securitycenter_v1/services/security_center/transports/grpc_asyncio.py index 6cb585c4..5997a063 100644 --- a/google/cloud/securitycenter_v1/services/security_center/transports/grpc_asyncio.py +++ b/google/cloud/securitycenter_v1/services/security_center/transports/grpc_asyncio.py @@ -69,7 +69,7 @@ class SecurityCenterGrpcAsyncIOTransport(SecurityCenterTransport): def create_channel( cls, host: str = "securitycenter.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -112,15 +112,15 @@ def __init__( self, *, host: str = "securitycenter.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, @@ -482,7 +482,7 @@ def get_big_query_export( ]: r"""Return a callable for the get big query export method over gRPC. - Gets a big query export. + Gets a BigQuery export. Returns: Callable[[~.GetBigQueryExportRequest], @@ -1211,7 +1211,7 @@ def create_big_query_export( ]: r"""Return a callable for the create big query export method over gRPC. - Creates a big query export. + Creates a BigQuery export. Returns: Callable[[~.CreateBigQueryExportRequest], @@ -1239,7 +1239,7 @@ def delete_big_query_export( ]: r"""Return a callable for the delete big query export method over gRPC. - Deletes an existing big query export. + Deletes an existing BigQuery export. Returns: Callable[[~.DeleteBigQueryExportRequest], diff --git a/google/cloud/securitycenter_v1/types/__init__.py b/google/cloud/securitycenter_v1/types/__init__.py index 3c6a6227..5d902c0f 100644 --- a/google/cloud/securitycenter_v1/types/__init__.py +++ b/google/cloud/securitycenter_v1/types/__init__.py @@ -28,6 +28,7 @@ from .folder import Folder from .iam_binding import IamBinding from .indicator import Indicator +from .kernel_rootkit import KernelRootkit from .kubernetes import Kubernetes from .label import Label from .mitre_attack import MitreAttack @@ -107,6 +108,7 @@ "Folder", "IamBinding", "Indicator", + "KernelRootkit", "Kubernetes", "Label", "MitreAttack", diff --git a/google/cloud/securitycenter_v1/types/access.py b/google/cloud/securitycenter_v1/types/access.py index b97f08a2..32b07313 100644 --- a/google/cloud/securitycenter_v1/types/access.py +++ b/google/cloud/securitycenter_v1/types/access.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -46,9 +48,9 @@ class Access(proto.Message): The caller IP's geolocation, which identifies where the call came from. user_agent_family (str): - What kind of user agent is associated, e.g. - operating system shells, embedded or stand-alone - applications, etc. + What kind of user agent is associated, for + example operating system shells, embedded or + stand-alone applications, etc. service_name (str): This is the API service that the service account made a call to, e.g. @@ -73,7 +75,7 @@ class Access(proto.Message): name. For example: "//iam.googleapis.com/projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}". - service_account_delegation_info (Sequence[google.cloud.securitycenter_v1.types.ServiceAccountDelegationInfo]): + service_account_delegation_info (MutableSequence[google.cloud.securitycenter_v1.types.ServiceAccountDelegationInfo]): Identity delegation history of an authenticated service account that makes the request. It contains information on the real @@ -82,46 +84,63 @@ class Access(proto.Message): authorities are present, they are guaranteed to be sorted based on the original ordering of the identity delegation events. + user_name (str): + A string that represents the username of a + user, user account, or other entity involved in + the access event. What the entity is and what + its role in the access event is depends on the + finding that this field appears in. The entity + is likely not an IAM principal, but could be a + user that is logged into an operating system, if + the finding is VM-related, or a user that is + logged into some type of application that is + involved in the access event. """ - principal_email = proto.Field( + principal_email: str = proto.Field( proto.STRING, number=1, ) - caller_ip = proto.Field( + caller_ip: str = proto.Field( proto.STRING, number=2, ) - caller_ip_geo = proto.Field( + caller_ip_geo: "Geolocation" = proto.Field( proto.MESSAGE, number=3, message="Geolocation", ) - user_agent_family = proto.Field( + user_agent_family: str = proto.Field( proto.STRING, number=4, ) - service_name = proto.Field( + service_name: str = proto.Field( proto.STRING, number=5, ) - method_name = proto.Field( + method_name: str = proto.Field( proto.STRING, number=6, ) - principal_subject = proto.Field( + principal_subject: str = proto.Field( proto.STRING, number=7, ) - service_account_key_name = proto.Field( + service_account_key_name: str = proto.Field( proto.STRING, number=8, ) - service_account_delegation_info = proto.RepeatedField( + service_account_delegation_info: MutableSequence[ + "ServiceAccountDelegationInfo" + ] = proto.RepeatedField( proto.MESSAGE, number=9, message="ServiceAccountDelegationInfo", ) + user_name: str = proto.Field( + proto.STRING, + number=11, + ) class ServiceAccountDelegationInfo(proto.Message): @@ -143,11 +162,11 @@ class ServiceAccountDelegationInfo(proto.Message): ``serviceAccount:{identity pool name}[{subject}]`` """ - principal_email = proto.Field( + principal_email: str = proto.Field( proto.STRING, number=1, ) - principal_subject = proto.Field( + principal_subject: str = proto.Field( proto.STRING, number=2, ) @@ -161,7 +180,7 @@ class Geolocation(proto.Message): A CLDR. """ - region_code = proto.Field( + region_code: str = proto.Field( proto.STRING, number=1, ) diff --git a/google/cloud/securitycenter_v1/types/asset.py b/google/cloud/securitycenter_v1/types/asset.py index 488e2fde..32b73399 100644 --- a/google/cloud/securitycenter_v1/types/asset.py +++ b/google/cloud/securitycenter_v1/types/asset.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import struct_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -48,7 +50,7 @@ class Asset(proto.Message): Security Command Center managed properties. These properties are managed by Security Command Center and cannot be modified by the user. - resource_properties (Mapping[str, google.protobuf.struct_pb2.Value]): + resource_properties (MutableMapping[str, google.protobuf.struct_pb2.Value]): Resource managed properties. These properties are managed and defined by the Google Cloud resource and cannot be modified by the user. @@ -103,7 +105,7 @@ class SecurityCenterProperties(proto.Message): The full resource name of the project the resource belongs to. See: https://cloud.google.com/apis/design/resource_names#full_resource_name - resource_owners (Sequence[str]): + resource_owners (MutableSequence[str]): Owners of the Google Cloud resource. resource_display_name (str): The user defined display name for this @@ -114,46 +116,46 @@ class SecurityCenterProperties(proto.Message): resource_project_display_name (str): The user defined display name for the project of this resource. - folders (Sequence[google.cloud.securitycenter_v1.types.Folder]): + folders (MutableSequence[google.cloud.securitycenter_v1.types.Folder]): Contains a Folder message for each folder in the assets ancestry. The first folder is the deepest nested folder, and the last folder is the folder directly under the Organization. """ - resource_name = proto.Field( + resource_name: str = proto.Field( proto.STRING, number=1, ) - resource_type = proto.Field( + resource_type: str = proto.Field( proto.STRING, number=2, ) - resource_parent = proto.Field( + resource_parent: str = proto.Field( proto.STRING, number=3, ) - resource_project = proto.Field( + resource_project: str = proto.Field( proto.STRING, number=4, ) - resource_owners = proto.RepeatedField( + resource_owners: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=5, ) - resource_display_name = proto.Field( + resource_display_name: str = proto.Field( proto.STRING, number=6, ) - resource_parent_display_name = proto.Field( + resource_parent_display_name: str = proto.Field( proto.STRING, number=7, ) - resource_project_display_name = proto.Field( + resource_project_display_name: str = proto.Field( proto.STRING, number=8, ) - folders = proto.RepeatedField( + folders: MutableSequence[folder.Folder] = proto.RepeatedField( proto.MESSAGE, number=10, message=folder.Folder, @@ -173,47 +175,47 @@ class IamPolicy(proto.Message): for format details. """ - policy_blob = proto.Field( + policy_blob: str = proto.Field( proto.STRING, number=1, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - security_center_properties = proto.Field( + security_center_properties: SecurityCenterProperties = proto.Field( proto.MESSAGE, number=2, message=SecurityCenterProperties, ) - resource_properties = proto.MapField( + resource_properties: MutableMapping[str, struct_pb2.Value] = proto.MapField( proto.STRING, proto.MESSAGE, number=7, message=struct_pb2.Value, ) - security_marks = proto.Field( + security_marks: gcs_security_marks.SecurityMarks = proto.Field( proto.MESSAGE, number=8, message=gcs_security_marks.SecurityMarks, ) - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=9, message=timestamp_pb2.Timestamp, ) - update_time = proto.Field( + update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=10, message=timestamp_pb2.Timestamp, ) - iam_policy = proto.Field( + iam_policy: IamPolicy = proto.Field( proto.MESSAGE, number=11, message=IamPolicy, ) - canonical_name = proto.Field( + canonical_name: str = proto.Field( proto.STRING, number=13, ) diff --git a/google/cloud/securitycenter_v1/types/bigquery_export.py b/google/cloud/securitycenter_v1/types/bigquery_export.py index 61054f89..50408626 100644 --- a/google/cloud/securitycenter_v1/types/bigquery_export.py +++ b/google/cloud/securitycenter_v1/types/bigquery_export.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -90,37 +92,37 @@ class BigQueryExport(proto.Message): big query dataset. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=2, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=3, ) - dataset = proto.Field( + dataset: str = proto.Field( proto.STRING, number=4, ) - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, ) - update_time = proto.Field( + update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp, ) - most_recent_editor = proto.Field( + most_recent_editor: str = proto.Field( proto.STRING, number=7, ) - principal = proto.Field( + principal: str = proto.Field( proto.STRING, number=8, ) diff --git a/google/cloud/securitycenter_v1/types/compliance.py b/google/cloud/securitycenter_v1/types/compliance.py index b096b6fa..57f30a71 100644 --- a/google/cloud/securitycenter_v1/types/compliance.py +++ b/google/cloud/securitycenter_v1/types/compliance.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -33,20 +35,20 @@ class Compliance(proto.Message): benchmarks e.g. "cis", "pci", "owasp", etc. version (str): Version of the standard/benchmark e.g. 1.1 - ids (Sequence[str]): + ids (MutableSequence[str]): Policies within the standard/benchmark e.g. A.12.4.1 """ - standard = proto.Field( + standard: str = proto.Field( proto.STRING, number=1, ) - version = proto.Field( + version: str = proto.Field( proto.STRING, number=2, ) - ids = proto.RepeatedField( + ids: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) diff --git a/google/cloud/securitycenter_v1/types/connection.py b/google/cloud/securitycenter_v1/types/connection.py index 0e7288c8..bbcd0fbd 100644 --- a/google/cloud/securitycenter_v1/types/connection.py +++ b/google/cloud/securitycenter_v1/types/connection.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -52,23 +54,23 @@ class Protocol(proto.Enum): GRE = 47 ESP = 50 - destination_ip = proto.Field( + destination_ip: str = proto.Field( proto.STRING, number=1, ) - destination_port = proto.Field( + destination_port: int = proto.Field( proto.INT32, number=2, ) - source_ip = proto.Field( + source_ip: str = proto.Field( proto.STRING, number=3, ) - source_port = proto.Field( + source_port: int = proto.Field( proto.INT32, number=4, ) - protocol = proto.Field( + protocol: Protocol = proto.Field( proto.ENUM, number=5, enum=Protocol, diff --git a/google/cloud/securitycenter_v1/types/contact_details.py b/google/cloud/securitycenter_v1/types/contact_details.py index d74a54e6..5d00cffd 100644 --- a/google/cloud/securitycenter_v1/types/contact_details.py +++ b/google/cloud/securitycenter_v1/types/contact_details.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -28,11 +30,11 @@ class ContactDetails(proto.Message): r"""The details pertaining to specific contacts Attributes: - contacts (Sequence[google.cloud.securitycenter_v1.types.Contact]): + contacts (MutableSequence[google.cloud.securitycenter_v1.types.Contact]): A list of contacts """ - contacts = proto.RepeatedField( + contacts: MutableSequence["Contact"] = proto.RepeatedField( proto.MESSAGE, number=1, message="Contact", @@ -47,7 +49,7 @@ class Contact(proto.Message): An email address e.g. "person123@company.com". """ - email = proto.Field( + email: str = proto.Field( proto.STRING, number=1, ) diff --git a/google/cloud/securitycenter_v1/types/container.py b/google/cloud/securitycenter_v1/types/container.py index d0fee0ce..bc5d1ad2 100644 --- a/google/cloud/securitycenter_v1/types/container.py +++ b/google/cloud/securitycenter_v1/types/container.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.securitycenter_v1.types import label @@ -40,24 +42,24 @@ class Container(proto.Message): the container runtime. Uniquely identifies the container image launched using a container image digest. - labels (Sequence[google.cloud.securitycenter_v1.types.Label]): + labels (MutableSequence[google.cloud.securitycenter_v1.types.Label]): Container labels, as provided by the container runtime. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - uri = proto.Field( + uri: str = proto.Field( proto.STRING, number=2, ) - image_id = proto.Field( + image_id: str = proto.Field( proto.STRING, number=3, ) - labels = proto.RepeatedField( + labels: MutableSequence[label.Label] = proto.RepeatedField( proto.MESSAGE, number=4, message=label.Label, diff --git a/google/cloud/securitycenter_v1/types/database.py b/google/cloud/securitycenter_v1/types/database.py index dd1b825a..687f69a9 100644 --- a/google/cloud/securitycenter_v1/types/database.py +++ b/google/cloud/securitycenter_v1/types/database.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -48,28 +50,28 @@ class Database(proto.Message): query (str): The SQL statement associated with the relevant access. - grantees (Sequence[str]): + grantees (MutableSequence[str]): The target usernames/roles/groups of a SQL privilege grant (not an IAM policy change). """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - user_name = proto.Field( + user_name: str = proto.Field( proto.STRING, number=3, ) - query = proto.Field( + query: str = proto.Field( proto.STRING, number=4, ) - grantees = proto.RepeatedField( + grantees: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=5, ) diff --git a/google/cloud/securitycenter_v1/types/exfiltration.py b/google/cloud/securitycenter_v1/types/exfiltration.py index f7c4e71d..d98d5ef8 100644 --- a/google/cloud/securitycenter_v1/types/exfiltration.py +++ b/google/cloud/securitycenter_v1/types/exfiltration.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -31,23 +33,23 @@ class Exfiltration(proto.Message): destination the data was copied to. Attributes: - sources (Sequence[google.cloud.securitycenter_v1.types.ExfilResource]): + sources (MutableSequence[google.cloud.securitycenter_v1.types.ExfilResource]): If there are multiple sources, then the data is considered "joined" between them. For instance, BigQuery can join multiple tables, and each table would be considered a source. - targets (Sequence[google.cloud.securitycenter_v1.types.ExfilResource]): + targets (MutableSequence[google.cloud.securitycenter_v1.types.ExfilResource]): If there are multiple targets, each target would get a complete copy of the "joined" source data. """ - sources = proto.RepeatedField( + sources: MutableSequence["ExfilResource"] = proto.RepeatedField( proto.MESSAGE, number=1, message="ExfilResource", ) - targets = proto.RepeatedField( + targets: MutableSequence["ExfilResource"] = proto.RepeatedField( proto.MESSAGE, number=2, message="ExfilResource", @@ -61,7 +63,7 @@ class ExfilResource(proto.Message): name (str): Resource's URI (https://google.aip.dev/122#full-resource-names) - components (Sequence[str]): + components (MutableSequence[str]): Subcomponents of the asset that is exfiltrated - these could be URIs used during exfiltration, table names, databases, filenames, @@ -71,11 +73,11 @@ class ExfilResource(proto.Message): bucket. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - components = proto.RepeatedField( + components: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=2, ) diff --git a/google/cloud/securitycenter_v1/types/external_system.py b/google/cloud/securitycenter_v1/types/external_system.py index e1df21b2..0dc9880a 100644 --- a/google/cloud/securitycenter_v1/types/external_system.py +++ b/google/cloud/securitycenter_v1/types/external_system.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -29,11 +31,12 @@ class ExternalSystem(proto.Message): Attributes: name (str): - External System Name e.g. jira, demisto, etc. e.g.: - ``organizations/1234/sources/5678/findings/123456/externalSystems/jira`` - ``folders/1234/sources/5678/findings/123456/externalSystems/jira`` - ``projects/1234/sources/5678/findings/123456/externalSystems/jira`` - assignees (Sequence[str]): + Full resource name of the external system, + for example: + "organizations/1234/sources/5678/findings/123456/externalSystems/jira", + "folders/1234/sources/5678/findings/123456/externalSystems/jira", + "projects/1234/sources/5678/findings/123456/externalSystems/jira". + assignees (MutableSequence[str]): References primary/secondary etc assignees in the external system. external_uid (str): @@ -48,23 +51,23 @@ class ExternalSystem(proto.Message): external system. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - assignees = proto.RepeatedField( + assignees: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=2, ) - external_uid = proto.Field( + external_uid: str = proto.Field( proto.STRING, number=3, ) - status = proto.Field( + status: str = proto.Field( proto.STRING, number=4, ) - external_system_update_time = proto.Field( + external_system_update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, diff --git a/google/cloud/securitycenter_v1/types/file.py b/google/cloud/securitycenter_v1/types/file.py index 64d65725..41baadf2 100644 --- a/google/cloud/securitycenter_v1/types/file.py +++ b/google/cloud/securitycenter_v1/types/file.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -50,27 +52,27 @@ class File(proto.Message): Script Executed findings.) """ - path = proto.Field( + path: str = proto.Field( proto.STRING, number=1, ) - size = proto.Field( + size: int = proto.Field( proto.INT64, number=2, ) - sha256 = proto.Field( + sha256: str = proto.Field( proto.STRING, number=3, ) - hashed_size = proto.Field( + hashed_size: int = proto.Field( proto.INT64, number=4, ) - partially_hashed = proto.Field( + partially_hashed: bool = proto.Field( proto.BOOL, number=5, ) - contents = proto.Field( + contents: str = proto.Field( proto.STRING, number=6, ) diff --git a/google/cloud/securitycenter_v1/types/finding.py b/google/cloud/securitycenter_v1/types/finding.py index d28e7425..c8594d2a 100644 --- a/google/cloud/securitycenter_v1/types/finding.py +++ b/google/cloud/securitycenter_v1/types/finding.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import struct_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -23,13 +25,14 @@ contact_details, container, ) +from google.cloud.securitycenter_v1.types import external_system, file, iam_binding from google.cloud.securitycenter_v1.types import exfiltration as gcs_exfiltration +from google.cloud.securitycenter_v1.types import kernel_rootkit as gcs_kernel_rootkit from google.cloud.securitycenter_v1.types import mitre_attack as gcs_mitre_attack from google.cloud.securitycenter_v1.types import security_marks as gcs_security_marks from google.cloud.securitycenter_v1.types import vulnerability as gcs_vulnerability from google.cloud.securitycenter_v1.types import access as gcs_access from google.cloud.securitycenter_v1.types import database as gcs_database -from google.cloud.securitycenter_v1.types import external_system, iam_binding from google.cloud.securitycenter_v1.types import indicator as gcs_indicator from google.cloud.securitycenter_v1.types import kubernetes as gcs_kubernetes from google.cloud.securitycenter_v1.types import process @@ -81,7 +84,7 @@ class Finding(proto.Message): additional information about the finding can be found. This field is guaranteed to be either empty or a well formed URL. - source_properties (Mapping[str, google.protobuf.struct_pb2.Value]): + source_properties (MutableMapping[str, google.protobuf.struct_pb2.Value]): Source specific properties. These properties are managed by the source that writes the finding. The key names in the source_properties map must be between 1 and 255 characters, @@ -131,14 +134,14 @@ class Finding(proto.Message): high confidence, indicates a computer intrusion. Reference: https://en.wikipedia.org/wiki/Indicator_of_compromise vulnerability (google.cloud.securitycenter_v1.types.Vulnerability): - Represents vulnerability specific fields like - cve, cvss scores etc. CVE stands for Common + Represents vulnerability-specific fields like + CVE and CVS scores. CVE stands for Common Vulnerabilities and Exposures (https://cve.mitre.org/about/) mute_update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The most recent time this finding was muted or unmuted. - external_systems (Mapping[str, google.cloud.securitycenter_v1.types.ExternalSystem]): + external_systems (MutableMapping[str, google.cloud.securitycenter_v1.types.ExternalSystem]): Output only. Third party SIEM/SOAR fields within SCC, contains external system information and external system finding fields. @@ -149,7 +152,7 @@ class Finding(proto.Message): Access details associated to the Finding, such as more information on the caller, which method was accessed, from where, etc. - connections (Sequence[google.cloud.securitycenter_v1.types.Connection]): + connections (MutableSequence[google.cloud.securitycenter_v1.types.Connection]): Contains information about the IP connection associated with the finding. mute_initiator (str): @@ -158,10 +161,10 @@ class Finding(proto.Message): muted the finding, user who muted the finding, etc. Unlike other attributes of a finding, a finding provider shouldn't set the value of mute. - processes (Sequence[google.cloud.securitycenter_v1.types.Process]): + processes (MutableSequence[google.cloud.securitycenter_v1.types.Process]): Represents operating system processes associated with the Finding. - contacts (Mapping[str, google.cloud.securitycenter_v1.types.ContactDetails]): + contacts (MutableMapping[str, google.cloud.securitycenter_v1.types.ContactDetails]): Output only. Map containing the points of contact for the given finding. The key represents the type of contact, while the value contains a list of all the contacts that pertain. @@ -182,7 +185,7 @@ class Finding(proto.Message): ] } } - compliances (Sequence[google.cloud.securitycenter_v1.types.Compliance]): + compliances (MutableSequence[google.cloud.securitycenter_v1.types.Compliance]): Contains compliance information for security standards associated to the finding. parent_display_name (str): @@ -194,12 +197,12 @@ class Finding(proto.Message): exfiltration (google.cloud.securitycenter_v1.types.Exfiltration): Represents exfiltration associated with the Finding. - iam_bindings (Sequence[google.cloud.securitycenter_v1.types.IamBinding]): + iam_bindings (MutableSequence[google.cloud.securitycenter_v1.types.IamBinding]): Represents IAM bindings associated with the Finding. next_steps (str): Next steps associate to the finding. - containers (Sequence[google.cloud.securitycenter_v1.types.Container]): + containers (MutableSequence[google.cloud.securitycenter_v1.types.Container]): Containers associated with the finding. containers provides information for both Kubernetes and non-Kubernetes containers. @@ -208,6 +211,10 @@ class Finding(proto.Message): finding. database (google.cloud.securitycenter_v1.types.Database): Database associated with the finding. + files (MutableSequence[google.cloud.securitycenter_v1.types.File]): + File associated with the finding. + kernel_rootkit (google.cloud.securitycenter_v1.types.KernelRootkit): + Kernel Rootkit signature. """ class State(proto.Enum): @@ -240,164 +247,176 @@ class FindingClass(proto.Enum): OBSERVATION = 4 SCC_ERROR = 5 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=2, ) - resource_name = proto.Field( + resource_name: str = proto.Field( proto.STRING, number=3, ) - state = proto.Field( + state: State = proto.Field( proto.ENUM, number=4, enum=State, ) - category = proto.Field( + category: str = proto.Field( proto.STRING, number=5, ) - external_uri = proto.Field( + external_uri: str = proto.Field( proto.STRING, number=6, ) - source_properties = proto.MapField( + source_properties: MutableMapping[str, struct_pb2.Value] = proto.MapField( proto.STRING, proto.MESSAGE, number=7, message=struct_pb2.Value, ) - security_marks = proto.Field( + security_marks: gcs_security_marks.SecurityMarks = proto.Field( proto.MESSAGE, number=8, message=gcs_security_marks.SecurityMarks, ) - event_time = proto.Field( + event_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=9, message=timestamp_pb2.Timestamp, ) - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=10, message=timestamp_pb2.Timestamp, ) - severity = proto.Field( + severity: Severity = proto.Field( proto.ENUM, number=12, enum=Severity, ) - canonical_name = proto.Field( + canonical_name: str = proto.Field( proto.STRING, number=14, ) - mute = proto.Field( + mute: Mute = proto.Field( proto.ENUM, number=15, enum=Mute, ) - finding_class = proto.Field( + finding_class: FindingClass = proto.Field( proto.ENUM, number=17, enum=FindingClass, ) - indicator = proto.Field( + indicator: gcs_indicator.Indicator = proto.Field( proto.MESSAGE, number=18, message=gcs_indicator.Indicator, ) - vulnerability = proto.Field( + vulnerability: gcs_vulnerability.Vulnerability = proto.Field( proto.MESSAGE, number=20, message=gcs_vulnerability.Vulnerability, ) - mute_update_time = proto.Field( + mute_update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=21, message=timestamp_pb2.Timestamp, ) - external_systems = proto.MapField( + external_systems: MutableMapping[ + str, external_system.ExternalSystem + ] = proto.MapField( proto.STRING, proto.MESSAGE, number=22, message=external_system.ExternalSystem, ) - mitre_attack = proto.Field( + mitre_attack: gcs_mitre_attack.MitreAttack = proto.Field( proto.MESSAGE, number=25, message=gcs_mitre_attack.MitreAttack, ) - access = proto.Field( + access: gcs_access.Access = proto.Field( proto.MESSAGE, number=26, message=gcs_access.Access, ) - connections = proto.RepeatedField( + connections: MutableSequence[connection.Connection] = proto.RepeatedField( proto.MESSAGE, number=31, message=connection.Connection, ) - mute_initiator = proto.Field( + mute_initiator: str = proto.Field( proto.STRING, number=28, ) - processes = proto.RepeatedField( + processes: MutableSequence[process.Process] = proto.RepeatedField( proto.MESSAGE, number=30, message=process.Process, ) - contacts = proto.MapField( + contacts: MutableMapping[str, contact_details.ContactDetails] = proto.MapField( proto.STRING, proto.MESSAGE, number=33, message=contact_details.ContactDetails, ) - compliances = proto.RepeatedField( + compliances: MutableSequence[compliance.Compliance] = proto.RepeatedField( proto.MESSAGE, number=34, message=compliance.Compliance, ) - parent_display_name = proto.Field( + parent_display_name: str = proto.Field( proto.STRING, number=36, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=37, ) - exfiltration = proto.Field( + exfiltration: gcs_exfiltration.Exfiltration = proto.Field( proto.MESSAGE, number=38, message=gcs_exfiltration.Exfiltration, ) - iam_bindings = proto.RepeatedField( + iam_bindings: MutableSequence[iam_binding.IamBinding] = proto.RepeatedField( proto.MESSAGE, number=39, message=iam_binding.IamBinding, ) - next_steps = proto.Field( + next_steps: str = proto.Field( proto.STRING, number=40, ) - containers = proto.RepeatedField( + containers: MutableSequence[container.Container] = proto.RepeatedField( proto.MESSAGE, number=42, message=container.Container, ) - kubernetes = proto.Field( + kubernetes: gcs_kubernetes.Kubernetes = proto.Field( proto.MESSAGE, number=43, message=gcs_kubernetes.Kubernetes, ) - database = proto.Field( + database: gcs_database.Database = proto.Field( proto.MESSAGE, number=44, message=gcs_database.Database, ) + files: MutableSequence[file.File] = proto.RepeatedField( + proto.MESSAGE, + number=46, + message=file.File, + ) + kernel_rootkit: gcs_kernel_rootkit.KernelRootkit = proto.Field( + proto.MESSAGE, + number=50, + message=gcs_kernel_rootkit.KernelRootkit, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/securitycenter_v1/types/folder.py b/google/cloud/securitycenter_v1/types/folder.py index 0ee352fa..65023861 100644 --- a/google/cloud/securitycenter_v1/types/folder.py +++ b/google/cloud/securitycenter_v1/types/folder.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -36,11 +38,11 @@ class Folder(proto.Message): folder. """ - resource_folder = proto.Field( + resource_folder: str = proto.Field( proto.STRING, number=1, ) - resource_folder_display_name = proto.Field( + resource_folder_display_name: str = proto.Field( proto.STRING, number=2, ) diff --git a/google/cloud/securitycenter_v1/types/iam_binding.py b/google/cloud/securitycenter_v1/types/iam_binding.py index c0b9c158..1b51d083 100644 --- a/google/cloud/securitycenter_v1/types/iam_binding.py +++ b/google/cloud/securitycenter_v1/types/iam_binding.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -45,16 +47,16 @@ class Action(proto.Enum): ADD = 1 REMOVE = 2 - action = proto.Field( + action: Action = proto.Field( proto.ENUM, number=1, enum=Action, ) - role = proto.Field( + role: str = proto.Field( proto.STRING, number=2, ) - member = proto.Field( + member: str = proto.Field( proto.STRING, number=3, ) diff --git a/google/cloud/securitycenter_v1/types/indicator.py b/google/cloud/securitycenter_v1/types/indicator.py index 22420624..c6acc286 100644 --- a/google/cloud/securitycenter_v1/types/indicator.py +++ b/google/cloud/securitycenter_v1/types/indicator.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -31,16 +33,16 @@ class Indicator(proto.Message): https://en.wikipedia.org/wiki/Indicator_of_compromise Attributes: - ip_addresses (Sequence[str]): + ip_addresses (MutableSequence[str]): List of ip addresses associated to the Finding. - domains (Sequence[str]): + domains (MutableSequence[str]): List of domains associated to the Finding. - signatures (Sequence[google.cloud.securitycenter_v1.types.Indicator.ProcessSignature]): + signatures (MutableSequence[google.cloud.securitycenter_v1.types.Indicator.ProcessSignature]): The list of matched signatures indicating that the given process is present in the environment. - uris (Sequence[str]): + uris (MutableSequence[str]): The list of URIs associated to the Findings. """ @@ -73,7 +75,7 @@ class MemoryHashSignature(proto.Message): Attributes: binary_family (str): The binary family. - detections (Sequence[google.cloud.securitycenter_v1.types.Indicator.ProcessSignature.MemoryHashSignature.Detection]): + detections (MutableSequence[google.cloud.securitycenter_v1.types.Indicator.ProcessSignature.MemoryHashSignature.Detection]): The list of memory hash detections contributing to the binary family match. """ @@ -91,20 +93,22 @@ class Detection(proto.Message): signature that were matched. """ - binary = proto.Field( + binary: str = proto.Field( proto.STRING, number=2, ) - percent_pages_matched = proto.Field( + percent_pages_matched: float = proto.Field( proto.DOUBLE, number=3, ) - binary_family = proto.Field( + binary_family: str = proto.Field( proto.STRING, number=1, ) - detections = proto.RepeatedField( + detections: MutableSequence[ + "Indicator.ProcessSignature.MemoryHashSignature.Detection" + ] = proto.RepeatedField( proto.MESSAGE, number=4, message="Indicator.ProcessSignature.MemoryHashSignature.Detection", @@ -118,38 +122,42 @@ class YaraRuleSignature(proto.Message): The name of the YARA rule. """ - yara_rule = proto.Field( + yara_rule: str = proto.Field( proto.STRING, number=5, ) - memory_hash_signature = proto.Field( - proto.MESSAGE, - number=6, - oneof="signature", - message="Indicator.ProcessSignature.MemoryHashSignature", + memory_hash_signature: "Indicator.ProcessSignature.MemoryHashSignature" = ( + proto.Field( + proto.MESSAGE, + number=6, + oneof="signature", + message="Indicator.ProcessSignature.MemoryHashSignature", + ) ) - yara_rule_signature = proto.Field( - proto.MESSAGE, - number=7, - oneof="signature", - message="Indicator.ProcessSignature.YaraRuleSignature", + yara_rule_signature: "Indicator.ProcessSignature.YaraRuleSignature" = ( + proto.Field( + proto.MESSAGE, + number=7, + oneof="signature", + message="Indicator.ProcessSignature.YaraRuleSignature", + ) ) - ip_addresses = proto.RepeatedField( + ip_addresses: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - domains = proto.RepeatedField( + domains: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=2, ) - signatures = proto.RepeatedField( + signatures: MutableSequence[ProcessSignature] = proto.RepeatedField( proto.MESSAGE, number=3, message=ProcessSignature, ) - uris = proto.RepeatedField( + uris: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=4, ) diff --git a/google/cloud/securitycenter_v1/types/kernel_rootkit.py b/google/cloud/securitycenter_v1/types/kernel_rootkit.py new file mode 100644 index 00000000..a177766e --- /dev/null +++ b/google/cloud/securitycenter_v1/types/kernel_rootkit.py @@ -0,0 +1,104 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +__protobuf__ = proto.module( + package="google.cloud.securitycenter.v1", + manifest={ + "KernelRootkit", + }, +) + + +class KernelRootkit(proto.Message): + r"""Kernel mode rootkit signatures. + + Attributes: + name (str): + Rootkit name when available. + unexpected_code_modification (bool): + True if unexpected modifications of kernel + code memory are present. + unexpected_read_only_data_modification (bool): + True if unexpected modifications of kernel + read-only data memory are present. + unexpected_ftrace_handler (bool): + True if ``ftrace`` points are present with callbacks + pointing to regions that are not in the expected kernel or + module code range. + unexpected_kprobe_handler (bool): + True if ``kprobe`` points are present with callbacks + pointing to regions that are not in the expected kernel or + module code range. + unexpected_kernel_code_pages (bool): + True if kernel code pages that are not in the + expected kernel or module code regions are + present. + unexpected_system_call_handler (bool): + True if system call handlers that are are not + in the expected kernel or module code regions + are present. + unexpected_interrupt_handler (bool): + True if interrupt handlers that are are not + in the expected kernel or module code regions + are present. + unexpected_processes_in_runqueue (bool): + True if unexpected processes in the scheduler + run queue are present. Such processes are in the + run queue, but not in the process task list. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + unexpected_code_modification: bool = proto.Field( + proto.BOOL, + number=2, + ) + unexpected_read_only_data_modification: bool = proto.Field( + proto.BOOL, + number=3, + ) + unexpected_ftrace_handler: bool = proto.Field( + proto.BOOL, + number=4, + ) + unexpected_kprobe_handler: bool = proto.Field( + proto.BOOL, + number=5, + ) + unexpected_kernel_code_pages: bool = proto.Field( + proto.BOOL, + number=6, + ) + unexpected_system_call_handler: bool = proto.Field( + proto.BOOL, + number=7, + ) + unexpected_interrupt_handler: bool = proto.Field( + proto.BOOL, + number=8, + ) + unexpected_processes_in_runqueue: bool = proto.Field( + proto.BOOL, + number=9, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/securitycenter_v1/types/kubernetes.py b/google/cloud/securitycenter_v1/types/kubernetes.py index bda87b63..fb6df80f 100644 --- a/google/cloud/securitycenter_v1/types/kubernetes.py +++ b/google/cloud/securitycenter_v1/types/kubernetes.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.securitycenter_v1.types import container, label @@ -29,24 +31,24 @@ class Kubernetes(proto.Message): r"""Kubernetes related attributes. Attributes: - pods (Sequence[google.cloud.securitycenter_v1.types.Kubernetes.Pod]): + pods (MutableSequence[google.cloud.securitycenter_v1.types.Kubernetes.Pod]): Kubernetes Pods associated with the finding. This field will contain Pod records for each container that is owned by a Pod. - nodes (Sequence[google.cloud.securitycenter_v1.types.Kubernetes.Node]): + nodes (MutableSequence[google.cloud.securitycenter_v1.types.Kubernetes.Node]): Provides Kubernetes Node information. - node_pools (Sequence[google.cloud.securitycenter_v1.types.Kubernetes.NodePool]): + node_pools (MutableSequence[google.cloud.securitycenter_v1.types.Kubernetes.NodePool]): GKE Node Pools associated with the finding. This field will contain NodePool information for each Node, when it is available. - roles (Sequence[google.cloud.securitycenter_v1.types.Kubernetes.Role]): + roles (MutableSequence[google.cloud.securitycenter_v1.types.Kubernetes.Role]): Provides Kubernetes role information for findings that involve Roles or ClusterRoles. - bindings (Sequence[google.cloud.securitycenter_v1.types.Kubernetes.Binding]): + bindings (MutableSequence[google.cloud.securitycenter_v1.types.Kubernetes.Binding]): Provides Kubernetes role binding information for findings that involve RoleBindings or ClusterRoleBindings. - access_reviews (Sequence[google.cloud.securitycenter_v1.types.Kubernetes.AccessReview]): + access_reviews (MutableSequence[google.cloud.securitycenter_v1.types.Kubernetes.AccessReview]): Provides information on any Kubernetes access reviews (i.e. privilege checks) relevant to the finding. @@ -60,28 +62,28 @@ class Pod(proto.Message): Kubernetes Pod namespace. name (str): Kubernetes Pod name. - labels (Sequence[google.cloud.securitycenter_v1.types.Label]): + labels (MutableSequence[google.cloud.securitycenter_v1.types.Label]): Pod labels. For Kubernetes containers, these are applied to the container. - containers (Sequence[google.cloud.securitycenter_v1.types.Container]): + containers (MutableSequence[google.cloud.securitycenter_v1.types.Container]): Pod containers associated with this finding, if any. """ - ns = proto.Field( + ns: str = proto.Field( proto.STRING, number=1, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=2, ) - labels = proto.RepeatedField( + labels: MutableSequence[label.Label] = proto.RepeatedField( proto.MESSAGE, number=3, message=label.Label, ) - containers = proto.RepeatedField( + containers: MutableSequence[container.Container] = proto.RepeatedField( proto.MESSAGE, number=4, message=container.Container, @@ -96,7 +98,7 @@ class Node(proto.Message): running the cluster node. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -107,15 +109,15 @@ class NodePool(proto.Message): Attributes: name (str): Kubernetes Node pool name. - nodes (Sequence[google.cloud.securitycenter_v1.types.Kubernetes.Node]): + nodes (MutableSequence[google.cloud.securitycenter_v1.types.Kubernetes.Node]): Nodes associated with the finding. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - nodes = proto.RepeatedField( + nodes: MutableSequence["Kubernetes.Node"] = proto.RepeatedField( proto.MESSAGE, number=2, message="Kubernetes.Node", @@ -139,16 +141,16 @@ class Kind(proto.Enum): ROLE = 1 CLUSTER_ROLE = 2 - kind = proto.Field( + kind: "Kubernetes.Role.Kind" = proto.Field( proto.ENUM, number=1, enum="Kubernetes.Role.Kind", ) - ns = proto.Field( + ns: str = proto.Field( proto.STRING, number=2, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=3, ) @@ -164,25 +166,25 @@ class Binding(proto.Message): role (google.cloud.securitycenter_v1.types.Kubernetes.Role): The Role or ClusterRole referenced by the binding. - subjects (Sequence[google.cloud.securitycenter_v1.types.Kubernetes.Subject]): + subjects (MutableSequence[google.cloud.securitycenter_v1.types.Kubernetes.Subject]): Represents the subjects(s) bound to the role. Not always available for PATCH requests. """ - ns = proto.Field( + ns: str = proto.Field( proto.STRING, number=1, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=2, ) - role = proto.Field( + role: "Kubernetes.Role" = proto.Field( proto.MESSAGE, number=3, message="Kubernetes.Role", ) - subjects = proto.RepeatedField( + subjects: MutableSequence["Kubernetes.Subject"] = proto.RepeatedField( proto.MESSAGE, number=4, message="Kubernetes.Subject", @@ -207,16 +209,16 @@ class AuthType(proto.Enum): SERVICEACCOUNT = 2 GROUP = 3 - kind = proto.Field( + kind: "Kubernetes.Subject.AuthType" = proto.Field( proto.ENUM, number=1, enum="Kubernetes.Subject.AuthType", ) - ns = proto.Field( + ns: str = proto.Field( proto.STRING, number=2, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=3, ) @@ -248,61 +250,61 @@ class AccessReview(proto.Message): Version is the API Version of the Resource. "*" means all. """ - group = proto.Field( + group: str = proto.Field( proto.STRING, number=1, ) - ns = proto.Field( + ns: str = proto.Field( proto.STRING, number=2, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=3, ) - resource = proto.Field( + resource: str = proto.Field( proto.STRING, number=4, ) - subresource = proto.Field( + subresource: str = proto.Field( proto.STRING, number=5, ) - verb = proto.Field( + verb: str = proto.Field( proto.STRING, number=6, ) - version = proto.Field( + version: str = proto.Field( proto.STRING, number=7, ) - pods = proto.RepeatedField( + pods: MutableSequence[Pod] = proto.RepeatedField( proto.MESSAGE, number=1, message=Pod, ) - nodes = proto.RepeatedField( + nodes: MutableSequence[Node] = proto.RepeatedField( proto.MESSAGE, number=2, message=Node, ) - node_pools = proto.RepeatedField( + node_pools: MutableSequence[NodePool] = proto.RepeatedField( proto.MESSAGE, number=3, message=NodePool, ) - roles = proto.RepeatedField( + roles: MutableSequence[Role] = proto.RepeatedField( proto.MESSAGE, number=4, message=Role, ) - bindings = proto.RepeatedField( + bindings: MutableSequence[Binding] = proto.RepeatedField( proto.MESSAGE, number=5, message=Binding, ) - access_reviews = proto.RepeatedField( + access_reviews: MutableSequence[AccessReview] = proto.RepeatedField( proto.MESSAGE, number=6, message=AccessReview, diff --git a/google/cloud/securitycenter_v1/types/label.py b/google/cloud/securitycenter_v1/types/label.py index c3bfb3e5..84eb144f 100644 --- a/google/cloud/securitycenter_v1/types/label.py +++ b/google/cloud/securitycenter_v1/types/label.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -35,11 +37,11 @@ class Label(proto.Message): Label value. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - value = proto.Field( + value: str = proto.Field( proto.STRING, number=2, ) diff --git a/google/cloud/securitycenter_v1/types/mitre_attack.py b/google/cloud/securitycenter_v1/types/mitre_attack.py index 388560e5..26e3889e 100644 --- a/google/cloud/securitycenter_v1/types/mitre_attack.py +++ b/google/cloud/securitycenter_v1/types/mitre_attack.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -31,7 +33,7 @@ class MitreAttack(proto.Message): primary_tactic (google.cloud.securitycenter_v1.types.MitreAttack.Tactic): The MITRE ATT&CK tactic most closely represented by this finding, if any. - primary_techniques (Sequence[google.cloud.securitycenter_v1.types.MitreAttack.Technique]): + primary_techniques (MutableSequence[google.cloud.securitycenter_v1.types.MitreAttack.Technique]): The MITRE ATT&CK technique most closely represented by this finding, if any. primary_techniques is a repeated field because there are multiple levels of MITRE ATT&CK @@ -40,10 +42,10 @@ class MitreAttack(proto.Message): ``SCANNING_IP_BLOCKS``), both the sub-technique and its parent technique(s) will be listed (e.g. ``SCANNING_IP_BLOCKS``, ``ACTIVE_SCANNING``). - additional_tactics (Sequence[google.cloud.securitycenter_v1.types.MitreAttack.Tactic]): + additional_tactics (MutableSequence[google.cloud.securitycenter_v1.types.MitreAttack.Tactic]): Additional MITRE ATT&CK tactics related to this finding, if any. - additional_techniques (Sequence[google.cloud.securitycenter_v1.types.MitreAttack.Technique]): + additional_techniques (MutableSequence[google.cloud.securitycenter_v1.types.MitreAttack.Technique]): Additional MITRE ATT&CK techniques related to this finding, if any, along with any of their respective parent techniques. @@ -111,28 +113,29 @@ class Technique(proto.Enum): NETWORK_SERVICE_DISCOVERY = 32 ACCESS_TOKEN_MANIPULATION = 33 ABUSE_ELEVATION_CONTROL_MECHANISM = 34 + DEFAULT_ACCOUNTS = 35 - primary_tactic = proto.Field( + primary_tactic: Tactic = proto.Field( proto.ENUM, number=1, enum=Tactic, ) - primary_techniques = proto.RepeatedField( + primary_techniques: MutableSequence[Technique] = proto.RepeatedField( proto.ENUM, number=2, enum=Technique, ) - additional_tactics = proto.RepeatedField( + additional_tactics: MutableSequence[Tactic] = proto.RepeatedField( proto.ENUM, number=3, enum=Tactic, ) - additional_techniques = proto.RepeatedField( + additional_techniques: MutableSequence[Technique] = proto.RepeatedField( proto.ENUM, number=4, enum=Technique, ) - version = proto.Field( + version: str = proto.Field( proto.STRING, number=5, ) diff --git a/google/cloud/securitycenter_v1/types/mute_config.py b/google/cloud/securitycenter_v1/types/mute_config.py index b83948f7..2803055a 100644 --- a/google/cloud/securitycenter_v1/types/mute_config.py +++ b/google/cloud/securitycenter_v1/types/mute_config.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -79,33 +81,33 @@ class MuteConfig(proto.Message): config creation or update. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=4, ) - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, ) - update_time = proto.Field( + update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp, ) - most_recent_editor = proto.Field( + most_recent_editor: str = proto.Field( proto.STRING, number=7, ) diff --git a/google/cloud/securitycenter_v1/types/notification_config.py b/google/cloud/securitycenter_v1/types/notification_config.py index fd6c9196..fdc7e57b 100644 --- a/google/cloud/securitycenter_v1/types/notification_config.py +++ b/google/cloud/securitycenter_v1/types/notification_config.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -38,7 +40,10 @@ class NotificationConfig(proto.Message): The relative resource name of this notification config. See: https://cloud.google.com/apis/design/resource_names#relative_resource_name Example: - "organizations/{organization_id}/notificationConfigs/notify_public_bucket". + "organizations/{organization_id}/notificationConfigs/notify_public_bucket", + "folders/{folder_id}/notificationConfigs/notify_public_bucket", + or + "projects/{project_id}/notificationConfigs/notify_public_bucket". description (str): The description of the notification config (max of 1024 characters). @@ -87,28 +92,28 @@ class StreamingConfig(proto.Message): - boolean literals ``true`` and ``false`` without quotes. """ - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=1, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=2, ) - pubsub_topic = proto.Field( + pubsub_topic: str = proto.Field( proto.STRING, number=3, ) - service_account = proto.Field( + service_account: str = proto.Field( proto.STRING, number=4, ) - streaming_config = proto.Field( + streaming_config: StreamingConfig = proto.Field( proto.MESSAGE, number=5, oneof="notify_config", diff --git a/google/cloud/securitycenter_v1/types/notification_message.py b/google/cloud/securitycenter_v1/types/notification_message.py index 5fb7162e..6006459b 100644 --- a/google/cloud/securitycenter_v1/types/notification_message.py +++ b/google/cloud/securitycenter_v1/types/notification_message.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.securitycenter_v1.types import finding as gcs_finding @@ -45,17 +47,17 @@ class NotificationMessage(proto.Message): notification's Finding. """ - notification_config_name = proto.Field( + notification_config_name: str = proto.Field( proto.STRING, number=1, ) - finding = proto.Field( + finding: gcs_finding.Finding = proto.Field( proto.MESSAGE, number=2, oneof="event", message=gcs_finding.Finding, ) - resource = proto.Field( + resource: gcs_resource.Resource = proto.Field( proto.MESSAGE, number=3, message=gcs_resource.Resource, diff --git a/google/cloud/securitycenter_v1/types/organization_settings.py b/google/cloud/securitycenter_v1/types/organization_settings.py index bb5b8595..239dbd86 100644 --- a/google/cloud/securitycenter_v1/types/organization_settings.py +++ b/google/cloud/securitycenter_v1/types/organization_settings.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -47,13 +49,13 @@ class AssetDiscoveryConfig(proto.Message): r"""The configuration used for Asset Discovery runs. Attributes: - project_ids (Sequence[str]): + project_ids (MutableSequence[str]): The project ids to use for filtering asset discovery. inclusion_mode (google.cloud.securitycenter_v1.types.OrganizationSettings.AssetDiscoveryConfig.InclusionMode): The mode to use for filtering asset discovery. - folder_ids (Sequence[str]): + folder_ids (MutableSequence[str]): The folder ids to use for filtering asset discovery. It consists of only digits, e.g., 756619654966. @@ -73,29 +75,31 @@ class InclusionMode(proto.Enum): INCLUDE_ONLY = 1 EXCLUDE = 2 - project_ids = proto.RepeatedField( + project_ids: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - inclusion_mode = proto.Field( - proto.ENUM, - number=2, - enum="OrganizationSettings.AssetDiscoveryConfig.InclusionMode", + inclusion_mode: "OrganizationSettings.AssetDiscoveryConfig.InclusionMode" = ( + proto.Field( + proto.ENUM, + number=2, + enum="OrganizationSettings.AssetDiscoveryConfig.InclusionMode", + ) ) - folder_ids = proto.RepeatedField( + folder_ids: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - enable_asset_discovery = proto.Field( + enable_asset_discovery: bool = proto.Field( proto.BOOL, number=2, ) - asset_discovery_config = proto.Field( + asset_discovery_config: AssetDiscoveryConfig = proto.Field( proto.MESSAGE, number=3, message=AssetDiscoveryConfig, diff --git a/google/cloud/securitycenter_v1/types/process.py b/google/cloud/securitycenter_v1/types/process.py index 9d032747..8e2b2825 100644 --- a/google/cloud/securitycenter_v1/types/process.py +++ b/google/cloud/securitycenter_v1/types/process.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.securitycenter_v1.types import file @@ -36,7 +38,7 @@ class Process(proto.Message): changed with ``prctl(PR_SET_NAME)``. binary (google.cloud.securitycenter_v1.types.File): File information for the process executable. - libraries (Sequence[google.cloud.securitycenter_v1.types.File]): + libraries (MutableSequence[google.cloud.securitycenter_v1.types.File]): File information for libraries loaded by the process. script (google.cloud.securitycenter_v1.types.File): @@ -44,11 +46,11 @@ class Process(proto.Message): ``binary`` provides information about the interpreter while ``script`` provides information about the script file provided to the interpreter. - args (Sequence[str]): + args (MutableSequence[str]): Process arguments as JSON encoded strings. arguments_truncated (bool): True if ``args`` is incomplete. - env_variables (Sequence[google.cloud.securitycenter_v1.types.EnvironmentVariable]): + env_variables (MutableSequence[google.cloud.securitycenter_v1.types.EnvironmentVariable]): Process environment variables. env_variables_truncated (bool): True if ``env_variables`` is incomplete. @@ -58,47 +60,47 @@ class Process(proto.Message): The parent process id. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=12, ) - binary = proto.Field( + binary: file.File = proto.Field( proto.MESSAGE, number=3, message=file.File, ) - libraries = proto.RepeatedField( + libraries: MutableSequence[file.File] = proto.RepeatedField( proto.MESSAGE, number=4, message=file.File, ) - script = proto.Field( + script: file.File = proto.Field( proto.MESSAGE, number=5, message=file.File, ) - args = proto.RepeatedField( + args: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=6, ) - arguments_truncated = proto.Field( + arguments_truncated: bool = proto.Field( proto.BOOL, number=7, ) - env_variables = proto.RepeatedField( + env_variables: MutableSequence["EnvironmentVariable"] = proto.RepeatedField( proto.MESSAGE, number=8, message="EnvironmentVariable", ) - env_variables_truncated = proto.Field( + env_variables_truncated: bool = proto.Field( proto.BOOL, number=9, ) - pid = proto.Field( + pid: int = proto.Field( proto.INT64, number=10, ) - parent_pid = proto.Field( + parent_pid: int = proto.Field( proto.INT64, number=11, ) @@ -117,11 +119,11 @@ class EnvironmentVariable(proto.Message): string. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - val = proto.Field( + val: str = proto.Field( proto.STRING, number=2, ) diff --git a/google/cloud/securitycenter_v1/types/resource.py b/google/cloud/securitycenter_v1/types/resource.py index b06af743..418cafb2 100644 --- a/google/cloud/securitycenter_v1/types/resource.py +++ b/google/cloud/securitycenter_v1/types/resource.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.securitycenter_v1.types import folder @@ -45,7 +47,7 @@ class Resource(proto.Message): The full resource name of resource's parent. parent_display_name (str): The human readable name of resource's parent. - folders (Sequence[google.cloud.securitycenter_v1.types.Folder]): + folders (MutableSequence[google.cloud.securitycenter_v1.types.Folder]): Output only. Contains a Folder message for each folder in the assets ancestry. The first folder is the deepest nested folder, and the @@ -53,35 +55,35 @@ class Resource(proto.Message): Organization. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=8, ) - type_ = proto.Field( + type_: str = proto.Field( proto.STRING, number=6, ) - project = proto.Field( + project: str = proto.Field( proto.STRING, number=2, ) - project_display_name = proto.Field( + project_display_name: str = proto.Field( proto.STRING, number=3, ) - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=4, ) - parent_display_name = proto.Field( + parent_display_name: str = proto.Field( proto.STRING, number=5, ) - folders = proto.RepeatedField( + folders: MutableSequence[folder.Folder] = proto.RepeatedField( proto.MESSAGE, number=7, message=folder.Folder, diff --git a/google/cloud/securitycenter_v1/types/run_asset_discovery_response.py b/google/cloud/securitycenter_v1/types/run_asset_discovery_response.py index dc445b1b..a5ecb37d 100644 --- a/google/cloud/securitycenter_v1/types/run_asset_discovery_response.py +++ b/google/cloud/securitycenter_v1/types/run_asset_discovery_response.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import duration_pb2 # type: ignore import proto # type: ignore @@ -42,12 +44,12 @@ class State(proto.Enum): SUPERSEDED = 2 TERMINATED = 3 - state = proto.Field( + state: State = proto.Field( proto.ENUM, number=1, enum=State, ) - duration = proto.Field( + duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=2, message=duration_pb2.Duration, diff --git a/google/cloud/securitycenter_v1/types/security_marks.py b/google/cloud/securitycenter_v1/types/security_marks.py index 16064811..9dcb4879 100644 --- a/google/cloud/securitycenter_v1/types/security_marks.py +++ b/google/cloud/securitycenter_v1/types/security_marks.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -37,7 +39,7 @@ class SecurityMarks(proto.Message): Examples: "organizations/{organization_id}/assets/{asset_id}/securityMarks" "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". - marks (Mapping[str, str]): + marks (MutableMapping[str, str]): Mutable user specified security marks belonging to the parent resource. Constraints are as follows: @@ -57,16 +59,16 @@ class SecurityMarks(proto.Message): "projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks". """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - marks = proto.MapField( + marks: MutableMapping[str, str] = proto.MapField( proto.STRING, proto.STRING, number=2, ) - canonical_name = proto.Field( + canonical_name: str = proto.Field( proto.STRING, number=3, ) diff --git a/google/cloud/securitycenter_v1/types/securitycenter_service.py b/google/cloud/securitycenter_v1/types/securitycenter_service.py index 8dad87eb..f85c3384 100644 --- a/google/cloud/securitycenter_v1/types/securitycenter_service.py +++ b/google/cloud/securitycenter_v1/types/securitycenter_service.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import struct_pb2 # type: ignore @@ -125,15 +127,15 @@ class BulkMuteFindingsRequest(proto.Message): the filter. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - mute_annotation = proto.Field( + mute_annotation: str = proto.Field( proto.STRING, number=3, ) @@ -166,15 +168,15 @@ class CreateFindingRequest(proto.Message): fields on this resource. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - finding_id = proto.Field( + finding_id: str = proto.Field( proto.STRING, number=2, ) - finding = proto.Field( + finding: gcs_finding.Finding = proto.Field( proto.MESSAGE, number=3, message=gcs_finding.Finding, @@ -199,16 +201,16 @@ class CreateMuteConfigRequest(proto.Message): or a number, and a 63 character maximum. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - mute_config = proto.Field( + mute_config: gcs_mute_config.MuteConfig = proto.Field( proto.MESSAGE, number=2, message=gcs_mute_config.MuteConfig, ) - mute_config_id = proto.Field( + mute_config_id: str = proto.Field( proto.STRING, number=3, ) @@ -220,13 +222,14 @@ class CreateNotificationConfigRequest(proto.Message): Attributes: parent (str): Required. Resource name of the new notification config's - parent. Its format is "organizations/[organization_id]". + parent. Its format is "organizations/[organization_id]", + "folders/[folder_id]", or "projects/[project_id]". config_id (str): Required. Unique identifier provided by the client within the parent scope. It must be between 1 and 128 - characters, and contains alphanumeric - characters, underscores or hyphens only. + characters and contain alphanumeric characters, + underscores, or hyphens only. notification_config (google.cloud.securitycenter_v1.types.NotificationConfig): Required. The notification config being created. The name and the service account will @@ -234,15 +237,15 @@ class CreateNotificationConfigRequest(proto.Message): on this resource. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - config_id = proto.Field( + config_id: str = proto.Field( proto.STRING, number=2, ) - notification_config = proto.Field( + notification_config: gcs_notification_config.NotificationConfig = proto.Field( proto.MESSAGE, number=3, message=gcs_notification_config.NotificationConfig, @@ -262,11 +265,11 @@ class CreateSourceRequest(proto.Message): ignored. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - source = proto.Field( + source: gcs_source.Source = proto.Field( proto.MESSAGE, number=2, message=gcs_source.Source, @@ -284,7 +287,7 @@ class DeleteMuteConfigRequest(proto.Message): projects/{project}/muteConfigs/{config_id} """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -297,28 +300,30 @@ class DeleteNotificationConfigRequest(proto.Message): name (str): Required. Name of the notification config to delete. Its format is - "organizations/[organization_id]/notificationConfigs/[config_id]". + "organizations/[organization_id]/notificationConfigs/[config_id]", + "folders/[folder_id]/notificationConfigs/[config_id]", or + "projects/[project_id]/notificationConfigs/[config_id]". """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) class GetBigQueryExportRequest(proto.Message): - r"""Request message for retrieving a big query export. + r"""Request message for retrieving a BigQuery export. Attributes: name (str): - Required. Name of the big query export to retrieve. Its + Required. Name of the BigQuery export to retrieve. Its format is organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id} """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -335,7 +340,7 @@ class GetMuteConfigRequest(proto.Message): projects/{project}/muteConfigs/{config_id} """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -348,10 +353,12 @@ class GetNotificationConfigRequest(proto.Message): name (str): Required. Name of the notification config to get. Its format is - "organizations/[organization_id]/notificationConfigs/[config_id]". + "organizations/[organization_id]/notificationConfigs/[config_id]", + "folders/[folder_id]/notificationConfigs/[config_id]", or + "projects/[project_id]/notificationConfigs/[config_id]". """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -367,7 +374,7 @@ class GetOrganizationSettingsRequest(proto.Message): "organizations/[organization_id]/organizationSettings". """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -382,7 +389,7 @@ class GetSourceRequest(proto.Message): is "organizations/[organization_id]/source/[source_id]". """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -393,9 +400,9 @@ class GroupAssetsRequest(proto.Message): Attributes: parent (str): - Required. Name of the organization to groupBy. Its format is - "organizations/[organization_id], folders/[folder_id], or - projects/[project_id]". + Required. The name of the parent to group the assets by. Its + format is "organizations/[organization_id], + folders/[folder_id], or projects/[project_id]". filter (str): Expression that defines the filter to apply across assets. The expression is a list of zero or more restrictions @@ -548,33 +555,33 @@ class GroupAssetsRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - group_by = proto.Field( + group_by: str = proto.Field( proto.STRING, number=3, ) - compare_duration = proto.Field( + compare_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=4, message=duration_pb2.Duration, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=7, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=8, ) @@ -584,7 +591,7 @@ class GroupAssetsResponse(proto.Message): r"""Response message for grouping by assets. Attributes: - group_by_results (Sequence[google.cloud.securitycenter_v1.types.GroupResult]): + group_by_results (MutableSequence[google.cloud.securitycenter_v1.types.GroupResult]): Group results. There exists an element for each existing unique combination of property/values. The element contains a count @@ -604,21 +611,21 @@ class GroupAssetsResponse(proto.Message): def raw_page(self): return self - group_by_results = proto.RepeatedField( + group_by_results: MutableSequence["GroupResult"] = proto.RepeatedField( proto.MESSAGE, number=1, message="GroupResult", ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=3, ) - total_size = proto.Field( + total_size: int = proto.Field( proto.INT32, number=4, ) @@ -785,33 +792,33 @@ class GroupFindingsRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - group_by = proto.Field( + group_by: str = proto.Field( proto.STRING, number=3, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, ) - compare_duration = proto.Field( + compare_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=5, message=duration_pb2.Duration, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=7, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=8, ) @@ -821,7 +828,7 @@ class GroupFindingsResponse(proto.Message): r"""Response message for group by findings. Attributes: - group_by_results (Sequence[google.cloud.securitycenter_v1.types.GroupResult]): + group_by_results (MutableSequence[google.cloud.securitycenter_v1.types.GroupResult]): Group results. There exists an element for each existing unique combination of property/values. The element contains a count @@ -841,21 +848,21 @@ class GroupFindingsResponse(proto.Message): def raw_page(self): return self - group_by_results = proto.RepeatedField( + group_by_results: MutableSequence["GroupResult"] = proto.RepeatedField( proto.MESSAGE, number=1, message="GroupResult", ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=3, ) - total_size = proto.Field( + total_size: int = proto.Field( proto.INT32, number=4, ) @@ -866,7 +873,7 @@ class GroupResult(proto.Message): request. Attributes: - properties (Mapping[str, google.protobuf.struct_pb2.Value]): + properties (MutableMapping[str, google.protobuf.struct_pb2.Value]): Properties matching the groupBy fields in the request. count (int): @@ -874,13 +881,13 @@ class GroupResult(proto.Message): properties. """ - properties = proto.MapField( + properties: MutableMapping[str, struct_pb2.Value] = proto.MapField( proto.STRING, proto.MESSAGE, number=1, message=struct_pb2.Value, ) - count = proto.Field( + count: int = proto.Field( proto.INT64, number=2, ) @@ -910,15 +917,15 @@ class ListMuteConfigsRequest(proto.Message): page token. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -928,7 +935,7 @@ class ListMuteConfigsResponse(proto.Message): r"""Response message for listing mute configs. Attributes: - mute_configs (Sequence[google.cloud.securitycenter_v1.types.MuteConfig]): + mute_configs (MutableSequence[google.cloud.securitycenter_v1.types.MuteConfig]): The mute configs from the specified parent. next_page_token (str): A token, which can be sent as ``page_token`` to retrieve the @@ -940,12 +947,12 @@ class ListMuteConfigsResponse(proto.Message): def raw_page(self): return self - mute_configs = proto.RepeatedField( + mute_configs: MutableSequence[gcs_mute_config.MuteConfig] = proto.RepeatedField( proto.MESSAGE, number=1, message=gcs_mute_config.MuteConfig, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -956,8 +963,10 @@ class ListNotificationConfigsRequest(proto.Message): Attributes: parent (str): - Required. Name of the organization to list notification - configs. Its format is "organizations/[organization_id]". + Required. The name of the parent in which to list the + notification configurations. Its format is + "organizations/[organization_id]", "folders/[folder_id]", or + "projects/[project_id]". page_token (str): The value returned by the last ``ListNotificationConfigsResponse``; indicates that this is @@ -969,15 +978,15 @@ class ListNotificationConfigsRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=2, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=3, ) @@ -987,7 +996,7 @@ class ListNotificationConfigsResponse(proto.Message): r"""Response message for listing notification configs. Attributes: - notification_configs (Sequence[google.cloud.securitycenter_v1.types.NotificationConfig]): + notification_configs (MutableSequence[google.cloud.securitycenter_v1.types.NotificationConfig]): Notification configs belonging to the requested parent. next_page_token (str): @@ -999,12 +1008,14 @@ class ListNotificationConfigsResponse(proto.Message): def raw_page(self): return self - notification_configs = proto.RepeatedField( + notification_configs: MutableSequence[ + gcs_notification_config.NotificationConfig + ] = proto.RepeatedField( proto.MESSAGE, number=1, message=gcs_notification_config.NotificationConfig, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -1029,15 +1040,15 @@ class ListSourcesRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=2, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=7, ) @@ -1047,7 +1058,7 @@ class ListSourcesResponse(proto.Message): r"""Response message for listing sources. Attributes: - sources (Sequence[google.cloud.securitycenter_v1.types.Source]): + sources (MutableSequence[google.cloud.securitycenter_v1.types.Source]): Sources belonging to the requested parent. next_page_token (str): Token to retrieve the next page of results, @@ -1058,12 +1069,12 @@ class ListSourcesResponse(proto.Message): def raw_page(self): return self - sources = proto.RepeatedField( + sources: MutableSequence[gcs_source.Source] = proto.RepeatedField( proto.MESSAGE, number=1, message=gcs_source.Source, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -1074,8 +1085,8 @@ class ListAssetsRequest(proto.Message): Attributes: parent (str): - Required. Name of the organization assets should belong to. - Its format is "organizations/[organization_id], + Required. The name of the parent that the listed assets + belong to. Its format is "organizations/[organization_id], folders/[folder_id], or projects/[project_id]". filter (str): Expression that defines the filter to apply across assets. @@ -1230,38 +1241,38 @@ class ListAssetsRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - order_by = proto.Field( + order_by: str = proto.Field( proto.STRING, number=3, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, ) - compare_duration = proto.Field( + compare_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=5, message=duration_pb2.Duration, ) - field_mask = proto.Field( + field_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=7, message=field_mask_pb2.FieldMask, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=8, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=9, ) @@ -1271,7 +1282,7 @@ class ListAssetsResponse(proto.Message): r"""Response message for listing assets. Attributes: - list_assets_results (Sequence[google.cloud.securitycenter_v1.types.ListAssetsResponse.ListAssetsResult]): + list_assets_results (MutableSequence[google.cloud.securitycenter_v1.types.ListAssetsResponse.ListAssetsResult]): Assets matching the list request. read_time (google.protobuf.timestamp_pb2.Timestamp): Time used for executing the list request. @@ -1307,12 +1318,12 @@ class StateChange(proto.Enum): REMOVED = 2 ACTIVE = 3 - asset = proto.Field( + asset: gcs_asset.Asset = proto.Field( proto.MESSAGE, number=1, message=gcs_asset.Asset, ) - state_change = proto.Field( + state_change: "ListAssetsResponse.ListAssetsResult.StateChange" = proto.Field( proto.ENUM, number=2, enum="ListAssetsResponse.ListAssetsResult.StateChange", @@ -1322,21 +1333,21 @@ class StateChange(proto.Enum): def raw_page(self): return self - list_assets_results = proto.RepeatedField( + list_assets_results: MutableSequence[ListAssetsResult] = proto.RepeatedField( proto.MESSAGE, number=1, message=ListAssetsResult, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=3, ) - total_size = proto.Field( + total_size: int = proto.Field( proto.INT32, number=4, ) @@ -1504,38 +1515,38 @@ class ListFindingsRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - order_by = proto.Field( + order_by: str = proto.Field( proto.STRING, number=3, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, ) - compare_duration = proto.Field( + compare_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=5, message=duration_pb2.Duration, ) - field_mask = proto.Field( + field_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=7, message=field_mask_pb2.FieldMask, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=8, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=9, ) @@ -1545,7 +1556,7 @@ class ListFindingsResponse(proto.Message): r"""Response message for listing findings. Attributes: - list_findings_results (Sequence[google.cloud.securitycenter_v1.types.ListFindingsResponse.ListFindingsResult]): + list_findings_results (MutableSequence[google.cloud.securitycenter_v1.types.ListFindingsResponse.ListFindingsResult]): Findings matching the list request. read_time (google.protobuf.timestamp_pb2.Timestamp): Time used for executing the list request. @@ -1608,58 +1619,60 @@ class Resource(proto.Message): The full resource name of resource's parent. parent_display_name (str): The human readable name of resource's parent. - folders (Sequence[google.cloud.securitycenter_v1.types.Folder]): + folders (MutableSequence[google.cloud.securitycenter_v1.types.Folder]): Contains a Folder message for each folder in the assets ancestry. The first folder is the deepest nested folder, and the last folder is the folder directly under the Organization. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=8, ) - type_ = proto.Field( + type_: str = proto.Field( proto.STRING, number=6, ) - project_name = proto.Field( + project_name: str = proto.Field( proto.STRING, number=2, ) - project_display_name = proto.Field( + project_display_name: str = proto.Field( proto.STRING, number=3, ) - parent_name = proto.Field( + parent_name: str = proto.Field( proto.STRING, number=4, ) - parent_display_name = proto.Field( + parent_display_name: str = proto.Field( proto.STRING, number=5, ) - folders = proto.RepeatedField( + folders: MutableSequence[folder.Folder] = proto.RepeatedField( proto.MESSAGE, number=7, message=folder.Folder, ) - finding = proto.Field( + finding: gcs_finding.Finding = proto.Field( proto.MESSAGE, number=1, message=gcs_finding.Finding, ) - state_change = proto.Field( - proto.ENUM, - number=2, - enum="ListFindingsResponse.ListFindingsResult.StateChange", + state_change: "ListFindingsResponse.ListFindingsResult.StateChange" = ( + proto.Field( + proto.ENUM, + number=2, + enum="ListFindingsResponse.ListFindingsResult.StateChange", + ) ) - resource = proto.Field( + resource: "ListFindingsResponse.ListFindingsResult.Resource" = proto.Field( proto.MESSAGE, number=3, message="ListFindingsResponse.ListFindingsResult.Resource", @@ -1669,21 +1682,21 @@ class Resource(proto.Message): def raw_page(self): return self - list_findings_results = proto.RepeatedField( + list_findings_results: MutableSequence[ListFindingsResult] = proto.RepeatedField( proto.MESSAGE, number=1, message=ListFindingsResult, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=3, ) - total_size = proto.Field( + total_size: int = proto.Field( proto.INT32, number=4, ) @@ -1694,10 +1707,12 @@ class SetFindingStateRequest(proto.Message): Attributes: name (str): - Required. The relative resource name of the finding. See: - https://cloud.google.com/apis/design/resource_names#relative_resource_name - Example: - "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}". + Required. The `relative resource + name `__ + of the finding. Example: + "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + "projects/{project_id}/sources/{source_id}/findings/{finding_id}". state (google.cloud.securitycenter_v1.types.Finding.State): Required. The desired State of the finding. start_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1705,16 +1720,16 @@ class SetFindingStateRequest(proto.Message): takes effect. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - state = proto.Field( + state: gcs_finding.Finding.State = proto.Field( proto.ENUM, number=2, enum=gcs_finding.Finding.State, ) - start_time = proto.Field( + start_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, @@ -1726,21 +1741,21 @@ class SetMuteRequest(proto.Message): Attributes: name (str): - Required. The relative resource name of the finding. See: - https://cloud.google.com/apis/design/resource_names#relative_resource_name - Example: - "organizations/{organization_id}/sources/{source_id}/finding/{finding_id}", - "folders/{folder_id}/sources/{source_id}/finding/{finding_id}", - "projects/{project_id}/sources/{source_id}/finding/{finding_id}". + Required. The `relative resource + name `__ + of the finding. Example: + "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}", + "folders/{folder_id}/sources/{source_id}/findings/{finding_id}", + "projects/{project_id}/sources/{source_id}/findings/{finding_id}". mute (google.cloud.securitycenter_v1.types.Finding.Mute): Required. The desired state of the Mute. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - mute = proto.Field( + mute: gcs_finding.Finding.Mute = proto.Field( proto.ENUM, number=2, enum=gcs_finding.Finding.Mute, @@ -1757,7 +1772,7 @@ class RunAssetDiscoveryRequest(proto.Message): for. Its format is "organizations/[organization_id]". """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) @@ -1776,12 +1791,12 @@ class UpdateExternalSystemRequest(proto.Message): If empty all mutable fields will be updated. """ - external_system = proto.Field( + external_system: gcs_external_system.ExternalSystem = proto.Field( proto.MESSAGE, number=1, message=gcs_external_system.ExternalSystem, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -1810,12 +1825,12 @@ class UpdateFindingRequest(proto.Message): "source_properties." in the field mask. """ - finding = proto.Field( + finding: gcs_finding.Finding = proto.Field( proto.MESSAGE, number=1, message=gcs_finding.Finding, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -1833,12 +1848,12 @@ class UpdateMuteConfigRequest(proto.Message): If empty all mutable fields will be updated. """ - mute_config = proto.Field( + mute_config: gcs_mute_config.MuteConfig = proto.Field( proto.MESSAGE, number=1, message=gcs_mute_config.MuteConfig, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -1857,12 +1872,12 @@ class UpdateNotificationConfigRequest(proto.Message): If empty all mutable fields will be updated. """ - notification_config = proto.Field( + notification_config: gcs_notification_config.NotificationConfig = proto.Field( proto.MESSAGE, number=1, message=gcs_notification_config.NotificationConfig, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -1882,12 +1897,12 @@ class UpdateOrganizationSettingsRequest(proto.Message): If empty all mutable fields will be updated. """ - organization_settings = proto.Field( + organization_settings: gcs_organization_settings.OrganizationSettings = proto.Field( proto.MESSAGE, number=1, message=gcs_organization_settings.OrganizationSettings, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -1906,12 +1921,12 @@ class UpdateSourceRequest(proto.Message): If empty all mutable fields will be updated. """ - source = proto.Field( + source: gcs_source.Source = proto.Field( proto.MESSAGE, number=1, message=gcs_source.Source, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -1941,17 +1956,17 @@ class UpdateSecurityMarksRequest(proto.Message): the server time. """ - security_marks = proto.Field( + security_marks: gcs_security_marks.SecurityMarks = proto.Field( proto.MESSAGE, number=1, message=gcs_security_marks.SecurityMarks, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, ) - start_time = proto.Field( + start_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, @@ -1959,15 +1974,16 @@ class UpdateSecurityMarksRequest(proto.Message): class CreateBigQueryExportRequest(proto.Message): - r"""Request message for creating a big query export. + r"""Request message for creating a BigQuery export. Attributes: parent (str): - Required. Resource name of the new big query export's - parent. Its format is "organizations/[organization_id]", - "folders/[folder_id]", or "projects/[project_id]". + Required. The name of the parent resource of the new + BigQuery export. Its format is + "organizations/[organization_id]", "folders/[folder_id]", or + "projects/[project_id]". big_query_export (google.cloud.securitycenter_v1.types.BigQueryExport): - Required. The big query export being created. + Required. The BigQuery export being created. big_query_export_id (str): Required. Unique identifier provided by the client within the parent scope. It must consist @@ -1976,16 +1992,16 @@ class CreateBigQueryExportRequest(proto.Message): or a number, and a 63 character maximum. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - big_query_export = proto.Field( + big_query_export: bigquery_export.BigQueryExport = proto.Field( proto.MESSAGE, number=2, message=bigquery_export.BigQueryExport, ) - big_query_export_id = proto.Field( + big_query_export_id: str = proto.Field( proto.STRING, number=3, ) @@ -2002,12 +2018,12 @@ class UpdateBigQueryExportRequest(proto.Message): If empty all mutable fields will be updated. """ - big_query_export = proto.Field( + big_query_export: bigquery_export.BigQueryExport = proto.Field( proto.MESSAGE, number=1, message=bigquery_export.BigQueryExport, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -2015,8 +2031,8 @@ class UpdateBigQueryExportRequest(proto.Message): class ListBigQueryExportsRequest(proto.Message): - r"""Request message for listing BigQuery exports at a given - scope e.g. organization, folder or project. + r"""Request message for listing BigQuery exports at a given scope + e.g. organization, folder or project. Attributes: parent (str): @@ -2037,15 +2053,15 @@ class ListBigQueryExportsRequest(proto.Message): provided the page token. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -2055,7 +2071,7 @@ class ListBigQueryExportsResponse(proto.Message): r"""Response message for listing BigQuery exports. Attributes: - big_query_exports (Sequence[google.cloud.securitycenter_v1.types.BigQueryExport]): + big_query_exports (MutableSequence[google.cloud.securitycenter_v1.types.BigQueryExport]): The BigQuery exports from the specified parent. next_page_token (str): @@ -2068,29 +2084,32 @@ class ListBigQueryExportsResponse(proto.Message): def raw_page(self): return self - big_query_exports = proto.RepeatedField( + big_query_exports: MutableSequence[ + bigquery_export.BigQueryExport + ] = proto.RepeatedField( proto.MESSAGE, number=1, message=bigquery_export.BigQueryExport, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) class DeleteBigQueryExportRequest(proto.Message): - r"""Request message for deleting a big query export. + r"""Request message for deleting a BigQuery export. Attributes: name (str): - Required. Name of the big query export to delete. Its format - is organizations/{organization}/bigQueryExports/{export_id}, + Required. The name of the BigQuery export to delete. Its + format is + organizations/{organization}/bigQueryExports/{export_id}, folders/{folder}/bigQueryExports/{export_id}, or projects/{project}/bigQueryExports/{export_id} """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/google/cloud/securitycenter_v1/types/source.py b/google/cloud/securitycenter_v1/types/source.py index 4f311714..6892b78d 100644 --- a/google/cloud/securitycenter_v1/types/source.py +++ b/google/cloud/securitycenter_v1/types/source.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -61,19 +63,19 @@ class Source(proto.Message): the finding. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - canonical_name = proto.Field( + canonical_name: str = proto.Field( proto.STRING, number=14, ) diff --git a/google/cloud/securitycenter_v1/types/vulnerability.py b/google/cloud/securitycenter_v1/types/vulnerability.py index 7e7956f3..c99ac19b 100644 --- a/google/cloud/securitycenter_v1/types/vulnerability.py +++ b/google/cloud/securitycenter_v1/types/vulnerability.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -36,7 +38,7 @@ class Vulnerability(proto.Message): Exposures (https://cve.mitre.org/about/) """ - cve = proto.Field( + cve: "Cve" = proto.Field( proto.MESSAGE, number=1, message="Cve", @@ -51,7 +53,7 @@ class Cve(proto.Message): id (str): The unique identifier for the vulnerability. e.g. CVE-2021-34527 - references (Sequence[google.cloud.securitycenter_v1.types.Reference]): + references (MutableSequence[google.cloud.securitycenter_v1.types.Reference]): Additional information about the CVE. e.g. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527 @@ -64,21 +66,21 @@ class Cve(proto.Message): CVE. """ - id = proto.Field( + id: str = proto.Field( proto.STRING, number=1, ) - references = proto.RepeatedField( + references: MutableSequence["Reference"] = proto.RepeatedField( proto.MESSAGE, number=2, message="Reference", ) - cvssv3 = proto.Field( + cvssv3: "Cvssv3" = proto.Field( proto.MESSAGE, number=3, message="Cvssv3", ) - upstream_fix_available = proto.Field( + upstream_fix_available: bool = proto.Field( proto.BOOL, number=4, ) @@ -95,11 +97,11 @@ class Reference(proto.Message): https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527. """ - source = proto.Field( + source: str = proto.Field( proto.STRING, number=1, ) - uri = proto.Field( + uri: str = proto.Field( proto.STRING, number=2, ) @@ -207,46 +209,46 @@ class Impact(proto.Enum): IMPACT_LOW = 2 IMPACT_NONE = 3 - base_score = proto.Field( + base_score: float = proto.Field( proto.DOUBLE, number=1, ) - attack_vector = proto.Field( + attack_vector: AttackVector = proto.Field( proto.ENUM, number=5, enum=AttackVector, ) - attack_complexity = proto.Field( + attack_complexity: AttackComplexity = proto.Field( proto.ENUM, number=6, enum=AttackComplexity, ) - privileges_required = proto.Field( + privileges_required: PrivilegesRequired = proto.Field( proto.ENUM, number=7, enum=PrivilegesRequired, ) - user_interaction = proto.Field( + user_interaction: UserInteraction = proto.Field( proto.ENUM, number=8, enum=UserInteraction, ) - scope = proto.Field( + scope: Scope = proto.Field( proto.ENUM, number=9, enum=Scope, ) - confidentiality_impact = proto.Field( + confidentiality_impact: Impact = proto.Field( proto.ENUM, number=10, enum=Impact, ) - integrity_impact = proto.Field( + integrity_impact: Impact = proto.Field( proto.ENUM, number=11, enum=Impact, ) - availability_impact = proto.Field( + availability_impact: Impact = proto.Field( proto.ENUM, number=12, enum=Impact, diff --git a/google/cloud/securitycenter_v1beta1/__init__.py b/google/cloud/securitycenter_v1beta1/__init__.py index 289b1e24..418a532d 100644 --- a/google/cloud/securitycenter_v1beta1/__init__.py +++ b/google/cloud/securitycenter_v1beta1/__init__.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.cloud.securitycenter import gapic_version as package_version + +__version__ = package_version.__version__ + from .services.security_center import SecurityCenterAsyncClient, SecurityCenterClient from .types.asset import Asset diff --git a/google/cloud/securitycenter_v1beta1/gapic_version.py b/google/cloud/securitycenter_v1beta1/gapic_version.py new file mode 100644 index 00000000..cb72862e --- /dev/null +++ b/google/cloud/securitycenter_v1beta1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "1.17.0" # {x-release-please-version} diff --git a/google/cloud/securitycenter_v1beta1/services/security_center/async_client.py b/google/cloud/securitycenter_v1beta1/services/security_center/async_client.py index 4e05efe7..79fdee57 100644 --- a/google/cloud/securitycenter_v1beta1/services/security_center/async_client.py +++ b/google/cloud/securitycenter_v1beta1/services/security_center/async_client.py @@ -16,7 +16,17 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 @@ -24,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.securitycenter_v1beta1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -192,9 +203,9 @@ def transport(self) -> SecurityCenterTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, SecurityCenterTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the security center client. @@ -238,12 +249,14 @@ def __init__( async def create_source( self, - request: Union[securitycenter_service.CreateSourceRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateSourceRequest, dict] + ] = None, *, - parent: str = None, - source: gcs_source.Source = None, + parent: Optional[str] = None, + source: Optional[gcs_source.Source] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_source.Source: r"""Creates a source. @@ -275,7 +288,7 @@ async def sample_create_source(): print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.CreateSourceRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.CreateSourceRequest, dict]]): The request object. Request message for creating a source. parent (:class:`str`): @@ -355,13 +368,15 @@ async def sample_create_source(): async def create_finding( self, - request: Union[securitycenter_service.CreateFindingRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateFindingRequest, dict] + ] = None, *, - parent: str = None, - finding_id: str = None, - finding: gcs_finding.Finding = None, + parent: Optional[str] = None, + finding_id: Optional[str] = None, + finding: Optional[gcs_finding.Finding] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_finding.Finding: r"""Creates a finding. The corresponding source must @@ -395,7 +410,7 @@ async def sample_create_finding(): print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.CreateFindingRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.CreateFindingRequest, dict]]): The request object. Request message for creating a finding. parent (:class:`str`): @@ -491,11 +506,11 @@ async def sample_create_finding(): async def get_iam_policy( self, - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the access control policy on the specified @@ -529,7 +544,7 @@ async def sample_get_iam_policy(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): + request (Optional[Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]]): The request object. Request message for `GetIamPolicy` method. resource (:class:`str`): @@ -668,13 +683,13 @@ async def sample_get_iam_policy(): async def get_organization_settings( self, - request: Union[ - securitycenter_service.GetOrganizationSettingsRequest, dict + request: Optional[ + Union[securitycenter_service.GetOrganizationSettingsRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> organization_settings.OrganizationSettings: r"""Gets the settings for an organization. @@ -706,7 +721,7 @@ async def sample_get_organization_settings(): print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.GetOrganizationSettingsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.GetOrganizationSettingsRequest, dict]]): The request object. Request message for getting organization settings. name (:class:`str`): @@ -784,11 +799,11 @@ async def sample_get_organization_settings(): async def get_source( self, - request: Union[securitycenter_service.GetSourceRequest, dict] = None, + request: Optional[Union[securitycenter_service.GetSourceRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> source.Source: r"""Gets a source. @@ -820,7 +835,7 @@ async def sample_get_source(): print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.GetSourceRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.GetSourceRequest, dict]]): The request object. Request message for getting a source. name (:class:`str`): @@ -901,10 +916,12 @@ async def sample_get_source(): async def group_assets( self, - request: Union[securitycenter_service.GroupAssetsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GroupAssetsRequest, dict] + ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.GroupAssetsAsyncPager: r"""Filters an organization's assets and groups them by @@ -939,7 +956,7 @@ async def sample_group_assets(): print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.GroupAssetsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.GroupAssetsRequest, dict]]): The request object. Request message for grouping by assets. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1006,12 +1023,14 @@ async def sample_group_assets(): async def group_findings( self, - request: Union[securitycenter_service.GroupFindingsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GroupFindingsRequest, dict] + ] = None, *, - parent: str = None, - group_by: str = None, + parent: Optional[str] = None, + group_by: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.GroupFindingsAsyncPager: r"""Filters an organization or source's findings and groups them by @@ -1050,7 +1069,7 @@ async def sample_group_findings(): print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.GroupFindingsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.GroupFindingsRequest, dict]]): The request object. Request message for grouping by findings. parent (:class:`str`): @@ -1159,10 +1178,10 @@ async def sample_group_findings(): async def list_assets( self, - request: Union[securitycenter_service.ListAssetsRequest, dict] = None, + request: Optional[Union[securitycenter_service.ListAssetsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListAssetsAsyncPager: r"""Lists an organization's assets. @@ -1195,7 +1214,7 @@ async def sample_list_assets(): print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.ListAssetsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.ListAssetsRequest, dict]]): The request object. Request message for listing assets. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -1260,10 +1279,12 @@ async def sample_list_assets(): async def list_findings( self, - request: Union[securitycenter_service.ListFindingsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListFindingsRequest, dict] + ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFindingsAsyncPager: r"""Lists an organization or source's findings. @@ -1300,7 +1321,7 @@ async def sample_list_findings(): print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.ListFindingsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.ListFindingsRequest, dict]]): The request object. Request message for listing findings. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1367,11 +1388,13 @@ async def sample_list_findings(): async def list_sources( self, - request: Union[securitycenter_service.ListSourcesRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListSourcesRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListSourcesAsyncPager: r"""Lists all sources belonging to an organization. @@ -1404,7 +1427,7 @@ async def sample_list_sources(): print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.ListSourcesRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.ListSourcesRequest, dict]]): The request object. Request message for listing sources. parent (:class:`str`): Required. Resource name of the parent of sources to @@ -1491,11 +1514,13 @@ async def sample_list_sources(): async def run_asset_discovery( self, - request: Union[securitycenter_service.RunAssetDiscoveryRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.RunAssetDiscoveryRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Runs asset discovery. The discovery is tracked with a @@ -1530,13 +1555,13 @@ async def sample_run_asset_discovery(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.RunAssetDiscoveryRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.RunAssetDiscoveryRequest, dict]]): The request object. Request message for running asset discovery for an organization. parent (:class:`str`): @@ -1621,13 +1646,15 @@ async def sample_run_asset_discovery(): async def set_finding_state( self, - request: Union[securitycenter_service.SetFindingStateRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.SetFindingStateRequest, dict] + ] = None, *, - name: str = None, - state: finding.Finding.State = None, - start_time: timestamp_pb2.Timestamp = None, + name: Optional[str] = None, + state: Optional[finding.Finding.State] = None, + start_time: Optional[timestamp_pb2.Timestamp] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> finding.Finding: r"""Updates the state of a finding. @@ -1660,7 +1687,7 @@ async def sample_set_finding_state(): print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.SetFindingStateRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.SetFindingStateRequest, dict]]): The request object. Request message for updating a finding's state. name (:class:`str`): @@ -1754,11 +1781,11 @@ async def sample_set_finding_state(): async def set_iam_policy( self, - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the access control policy on the specified @@ -1792,7 +1819,7 @@ async def sample_set_iam_policy(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): + request (Optional[Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]]): The request object. Request message for `SetIamPolicy` method. resource (:class:`str`): @@ -1921,12 +1948,12 @@ async def sample_set_iam_policy(): async def test_iam_permissions( self, - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, - resource: str = None, - permissions: Sequence[str] = None, + resource: Optional[str] = None, + permissions: Optional[MutableSequence[str]] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns the permissions that a caller has on the @@ -1961,7 +1988,7 @@ async def sample_test_iam_permissions(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): + request (Optional[Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]]): The request object. Request message for `TestIamPermissions` method. resource (:class:`str`): @@ -1973,7 +2000,7 @@ async def sample_test_iam_permissions(): This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - permissions (:class:`Sequence[str]`): + permissions (:class:`MutableSequence[str]`): The set of permissions to check for the ``resource``. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see `IAM @@ -2049,11 +2076,13 @@ async def sample_test_iam_permissions(): async def update_finding( self, - request: Union[securitycenter_service.UpdateFindingRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateFindingRequest, dict] + ] = None, *, - finding: gcs_finding.Finding = None, + finding: Optional[gcs_finding.Finding] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_finding.Finding: r"""Creates or updates a finding. The corresponding @@ -2085,7 +2114,7 @@ async def sample_update_finding(): print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.UpdateFindingRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.UpdateFindingRequest, dict]]): The request object. Request message for updating or creating a finding. finding (:class:`google.cloud.securitycenter_v1beta1.types.Finding`): @@ -2165,13 +2194,15 @@ async def sample_update_finding(): async def update_organization_settings( self, - request: Union[ - securitycenter_service.UpdateOrganizationSettingsRequest, dict + request: Optional[ + Union[securitycenter_service.UpdateOrganizationSettingsRequest, dict] ] = None, *, - organization_settings: gcs_organization_settings.OrganizationSettings = None, + organization_settings: Optional[ + gcs_organization_settings.OrganizationSettings + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_organization_settings.OrganizationSettings: r"""Updates an organization's settings. @@ -2202,7 +2233,7 @@ async def sample_update_organization_settings(): print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.UpdateOrganizationSettingsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.UpdateOrganizationSettingsRequest, dict]]): The request object. Request message for updating an organization's settings. organization_settings (:class:`google.cloud.securitycenter_v1beta1.types.OrganizationSettings`): @@ -2271,11 +2302,13 @@ async def sample_update_organization_settings(): async def update_source( self, - request: Union[securitycenter_service.UpdateSourceRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateSourceRequest, dict] + ] = None, *, - source: gcs_source.Source = None, + source: Optional[gcs_source.Source] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_source.Source: r"""Updates a source. @@ -2306,7 +2339,7 @@ async def sample_update_source(): print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.UpdateSourceRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.UpdateSourceRequest, dict]]): The request object. Request message for updating a source. source (:class:`google.cloud.securitycenter_v1beta1.types.Source`): @@ -2378,11 +2411,13 @@ async def sample_update_source(): async def update_security_marks( self, - request: Union[securitycenter_service.UpdateSecurityMarksRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateSecurityMarksRequest, dict] + ] = None, *, - security_marks: gcs_security_marks.SecurityMarks = None, + security_marks: Optional[gcs_security_marks.SecurityMarks] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_security_marks.SecurityMarks: r"""Updates security marks. @@ -2413,7 +2448,7 @@ async def sample_update_security_marks(): print(response) Args: - request (Union[google.cloud.securitycenter_v1beta1.types.UpdateSecurityMarksRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1beta1.types.UpdateSecurityMarksRequest, dict]]): The request object. Request message for updating a SecurityMarks resource. security_marks (:class:`google.cloud.securitycenter_v1beta1.types.SecurityMarks`): @@ -2492,14 +2527,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-securitycenter", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SecurityCenterAsyncClient",) diff --git a/google/cloud/securitycenter_v1beta1/services/security_center/client.py b/google/cloud/securitycenter_v1beta1/services/security_center/client.py index 9ec30738..f589cfc7 100644 --- a/google/cloud/securitycenter_v1beta1/services/security_center/client.py +++ b/google/cloud/securitycenter_v1beta1/services/security_center/client.py @@ -16,7 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -27,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.securitycenter_v1beta1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -77,7 +89,7 @@ class SecurityCenterClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[SecurityCenterTransport]: """Returns an appropriate transport class. @@ -429,8 +441,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, SecurityCenterTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, SecurityCenterTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the security center client. @@ -444,7 +456,7 @@ def __init__( transport (Union[str, SecurityCenterTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -474,6 +486,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -526,12 +539,14 @@ def __init__( def create_source( self, - request: Union[securitycenter_service.CreateSourceRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateSourceRequest, dict] + ] = None, *, - parent: str = None, - source: gcs_source.Source = None, + parent: Optional[str] = None, + source: Optional[gcs_source.Source] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_source.Source: r"""Creates a source. @@ -643,13 +658,15 @@ def sample_create_source(): def create_finding( self, - request: Union[securitycenter_service.CreateFindingRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateFindingRequest, dict] + ] = None, *, - parent: str = None, - finding_id: str = None, - finding: gcs_finding.Finding = None, + parent: Optional[str] = None, + finding_id: Optional[str] = None, + finding: Optional[gcs_finding.Finding] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_finding.Finding: r"""Creates a finding. The corresponding source must @@ -779,11 +796,11 @@ def sample_create_finding(): def get_iam_policy( self, - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the access control policy on the specified @@ -943,13 +960,13 @@ def sample_get_iam_policy(): def get_organization_settings( self, - request: Union[ - securitycenter_service.GetOrganizationSettingsRequest, dict + request: Optional[ + Union[securitycenter_service.GetOrganizationSettingsRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> organization_settings.OrganizationSettings: r"""Gets the settings for an organization. @@ -1053,11 +1070,11 @@ def sample_get_organization_settings(): def get_source( self, - request: Union[securitycenter_service.GetSourceRequest, dict] = None, + request: Optional[Union[securitycenter_service.GetSourceRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> source.Source: r"""Gets a source. @@ -1160,10 +1177,12 @@ def sample_get_source(): def group_assets( self, - request: Union[securitycenter_service.GroupAssetsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GroupAssetsRequest, dict] + ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.GroupAssetsPager: r"""Filters an organization's assets and groups them by @@ -1256,12 +1275,14 @@ def sample_group_assets(): def group_findings( self, - request: Union[securitycenter_service.GroupFindingsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GroupFindingsRequest, dict] + ] = None, *, - parent: str = None, - group_by: str = None, + parent: Optional[str] = None, + group_by: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.GroupFindingsPager: r"""Filters an organization or source's findings and groups them by @@ -1399,10 +1420,10 @@ def sample_group_findings(): def list_assets( self, - request: Union[securitycenter_service.ListAssetsRequest, dict] = None, + request: Optional[Union[securitycenter_service.ListAssetsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListAssetsPager: r"""Lists an organization's assets. @@ -1491,10 +1512,12 @@ def sample_list_assets(): def list_findings( self, - request: Union[securitycenter_service.ListFindingsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListFindingsRequest, dict] + ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFindingsPager: r"""Lists an organization or source's findings. @@ -1589,11 +1612,13 @@ def sample_list_findings(): def list_sources( self, - request: Union[securitycenter_service.ListSourcesRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListSourcesRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListSourcesPager: r"""Lists all sources belonging to an organization. @@ -1703,11 +1728,13 @@ def sample_list_sources(): def run_asset_discovery( self, - request: Union[securitycenter_service.RunAssetDiscoveryRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.RunAssetDiscoveryRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Runs asset discovery. The discovery is tracked with a @@ -1833,13 +1860,15 @@ def sample_run_asset_discovery(): def set_finding_state( self, - request: Union[securitycenter_service.SetFindingStateRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.SetFindingStateRequest, dict] + ] = None, *, - name: str = None, - state: finding.Finding.State = None, - start_time: timestamp_pb2.Timestamp = None, + name: Optional[str] = None, + state: Optional[finding.Finding.State] = None, + start_time: Optional[timestamp_pb2.Timestamp] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> finding.Finding: r"""Updates the state of a finding. @@ -1966,11 +1995,11 @@ def sample_set_finding_state(): def set_iam_policy( self, - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the access control policy on the specified @@ -2130,12 +2159,12 @@ def sample_set_iam_policy(): def test_iam_permissions( self, - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, - resource: str = None, - permissions: Sequence[str] = None, + resource: Optional[str] = None, + permissions: Optional[MutableSequence[str]] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns the permissions that a caller has on the @@ -2182,7 +2211,7 @@ def sample_test_iam_permissions(): This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - permissions (Sequence[str]): + permissions (MutableSequence[str]): The set of permissions to check for the ``resource``. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see `IAM @@ -2246,11 +2275,13 @@ def sample_test_iam_permissions(): def update_finding( self, - request: Union[securitycenter_service.UpdateFindingRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateFindingRequest, dict] + ] = None, *, - finding: gcs_finding.Finding = None, + finding: Optional[gcs_finding.Finding] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_finding.Finding: r"""Creates or updates a finding. The corresponding @@ -2362,13 +2393,15 @@ def sample_update_finding(): def update_organization_settings( self, - request: Union[ - securitycenter_service.UpdateOrganizationSettingsRequest, dict + request: Optional[ + Union[securitycenter_service.UpdateOrganizationSettingsRequest, dict] ] = None, *, - organization_settings: gcs_organization_settings.OrganizationSettings = None, + organization_settings: Optional[ + gcs_organization_settings.OrganizationSettings + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_organization_settings.OrganizationSettings: r"""Updates an organization's settings. @@ -2472,11 +2505,13 @@ def sample_update_organization_settings(): def update_source( self, - request: Union[securitycenter_service.UpdateSourceRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateSourceRequest, dict] + ] = None, *, - source: gcs_source.Source = None, + source: Optional[gcs_source.Source] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_source.Source: r"""Updates a source. @@ -2579,11 +2614,13 @@ def sample_update_source(): def update_security_marks( self, - request: Union[securitycenter_service.UpdateSecurityMarksRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateSecurityMarksRequest, dict] + ] = None, *, - security_marks: gcs_security_marks.SecurityMarks = None, + security_marks: Optional[gcs_security_marks.SecurityMarks] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_security_marks.SecurityMarks: r"""Updates security marks. @@ -2700,14 +2737,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-securitycenter", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SecurityCenterClient",) diff --git a/google/cloud/securitycenter_v1beta1/services/security_center/transports/base.py b/google/cloud/securitycenter_v1beta1/services/security_center/transports/base.py index e558392b..e8dfb178 100644 --- a/google/cloud/securitycenter_v1beta1/services/security_center/transports/base.py +++ b/google/cloud/securitycenter_v1beta1/services/security_center/transports/base.py @@ -26,8 +26,8 @@ from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources +from google.cloud.securitycenter_v1beta1 import gapic_version as package_version from google.cloud.securitycenter_v1beta1.types import ( organization_settings as gcs_organization_settings, ) @@ -41,14 +41,9 @@ from google.cloud.securitycenter_v1beta1.types import source from google.cloud.securitycenter_v1beta1.types import source as gcs_source -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-securitycenter", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class SecurityCenterTransport(abc.ABC): @@ -62,7 +57,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc.py b/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc.py index 04151bdb..cf78e428 100644 --- a/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc.py +++ b/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc.py @@ -60,14 +60,14 @@ def __init__( self, *, host: str = "securitycenter.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -195,8 +195,8 @@ def __init__( def create_channel( cls, host: str = "securitycenter.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc_asyncio.py b/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc_asyncio.py index 2aef9562..6b032b57 100644 --- a/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc_asyncio.py +++ b/google/cloud/securitycenter_v1beta1/services/security_center/transports/grpc_asyncio.py @@ -62,7 +62,7 @@ class SecurityCenterGrpcAsyncIOTransport(SecurityCenterTransport): def create_channel( cls, host: str = "securitycenter.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -105,15 +105,15 @@ def __init__( self, *, host: str = "securitycenter.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/securitycenter_v1beta1/types/asset.py b/google/cloud/securitycenter_v1beta1/types/asset.py index f3d741d4..f935efdb 100644 --- a/google/cloud/securitycenter_v1beta1/types/asset.py +++ b/google/cloud/securitycenter_v1beta1/types/asset.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import struct_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -49,7 +51,7 @@ class Asset(proto.Message): Security Command Center managed properties. These properties are managed by Security Command Center and cannot be modified by the user. - resource_properties (Mapping[str, google.protobuf.struct_pb2.Value]): + resource_properties (MutableMapping[str, google.protobuf.struct_pb2.Value]): Resource managed properties. These properties are managed and defined by the Google Cloud resource and cannot be modified by the user. @@ -92,57 +94,57 @@ class SecurityCenterProperties(proto.Message): The full resource name of the project the resource belongs to. See: https://cloud.google.com/apis/design/resource_names#full_resource_name - resource_owners (Sequence[str]): + resource_owners (MutableSequence[str]): Owners of the Google Cloud resource. """ - resource_name = proto.Field( + resource_name: str = proto.Field( proto.STRING, number=1, ) - resource_type = proto.Field( + resource_type: str = proto.Field( proto.STRING, number=2, ) - resource_parent = proto.Field( + resource_parent: str = proto.Field( proto.STRING, number=3, ) - resource_project = proto.Field( + resource_project: str = proto.Field( proto.STRING, number=4, ) - resource_owners = proto.RepeatedField( + resource_owners: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=5, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - security_center_properties = proto.Field( + security_center_properties: SecurityCenterProperties = proto.Field( proto.MESSAGE, number=2, message=SecurityCenterProperties, ) - resource_properties = proto.MapField( + resource_properties: MutableMapping[str, struct_pb2.Value] = proto.MapField( proto.STRING, proto.MESSAGE, number=7, message=struct_pb2.Value, ) - security_marks = proto.Field( + security_marks: gcs_security_marks.SecurityMarks = proto.Field( proto.MESSAGE, number=8, message=gcs_security_marks.SecurityMarks, ) - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=9, message=timestamp_pb2.Timestamp, ) - update_time = proto.Field( + update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=10, message=timestamp_pb2.Timestamp, diff --git a/google/cloud/securitycenter_v1beta1/types/finding.py b/google/cloud/securitycenter_v1beta1/types/finding.py index d25738c6..c02aef73 100644 --- a/google/cloud/securitycenter_v1beta1/types/finding.py +++ b/google/cloud/securitycenter_v1beta1/types/finding.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import struct_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -68,7 +70,7 @@ class Finding(proto.Message): additional information about the finding can be found. This field is guaranteed to be either empty or a well formed URL. - source_properties (Mapping[str, google.protobuf.struct_pb2.Value]): + source_properties (MutableMapping[str, google.protobuf.struct_pb2.Value]): Source specific properties. These properties are managed by the source that writes the finding. The key names in the source_properties map must be between 1 and 255 characters, @@ -99,48 +101,48 @@ class State(proto.Enum): ACTIVE = 1 INACTIVE = 2 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=2, ) - resource_name = proto.Field( + resource_name: str = proto.Field( proto.STRING, number=3, ) - state = proto.Field( + state: State = proto.Field( proto.ENUM, number=4, enum=State, ) - category = proto.Field( + category: str = proto.Field( proto.STRING, number=5, ) - external_uri = proto.Field( + external_uri: str = proto.Field( proto.STRING, number=6, ) - source_properties = proto.MapField( + source_properties: MutableMapping[str, struct_pb2.Value] = proto.MapField( proto.STRING, proto.MESSAGE, number=7, message=struct_pb2.Value, ) - security_marks = proto.Field( + security_marks: gcs_security_marks.SecurityMarks = proto.Field( proto.MESSAGE, number=8, message=gcs_security_marks.SecurityMarks, ) - event_time = proto.Field( + event_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=9, message=timestamp_pb2.Timestamp, ) - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=10, message=timestamp_pb2.Timestamp, diff --git a/google/cloud/securitycenter_v1beta1/types/organization_settings.py b/google/cloud/securitycenter_v1beta1/types/organization_settings.py index 7b9892ce..2d94e528 100644 --- a/google/cloud/securitycenter_v1beta1/types/organization_settings.py +++ b/google/cloud/securitycenter_v1beta1/types/organization_settings.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -47,7 +49,7 @@ class AssetDiscoveryConfig(proto.Message): r"""The configuration used for Asset Discovery runs. Attributes: - project_ids (Sequence[str]): + project_ids (MutableSequence[str]): The project ids to use for filtering asset discovery. inclusion_mode (google.cloud.securitycenter_v1beta1.types.OrganizationSettings.AssetDiscoveryConfig.InclusionMode): @@ -69,25 +71,27 @@ class InclusionMode(proto.Enum): INCLUDE_ONLY = 1 EXCLUDE = 2 - project_ids = proto.RepeatedField( + project_ids: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - inclusion_mode = proto.Field( - proto.ENUM, - number=2, - enum="OrganizationSettings.AssetDiscoveryConfig.InclusionMode", + inclusion_mode: "OrganizationSettings.AssetDiscoveryConfig.InclusionMode" = ( + proto.Field( + proto.ENUM, + number=2, + enum="OrganizationSettings.AssetDiscoveryConfig.InclusionMode", + ) ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - enable_asset_discovery = proto.Field( + enable_asset_discovery: bool = proto.Field( proto.BOOL, number=2, ) - asset_discovery_config = proto.Field( + asset_discovery_config: AssetDiscoveryConfig = proto.Field( proto.MESSAGE, number=3, message=AssetDiscoveryConfig, diff --git a/google/cloud/securitycenter_v1beta1/types/run_asset_discovery_response.py b/google/cloud/securitycenter_v1beta1/types/run_asset_discovery_response.py index 336c36ed..6b81fa6c 100644 --- a/google/cloud/securitycenter_v1beta1/types/run_asset_discovery_response.py +++ b/google/cloud/securitycenter_v1beta1/types/run_asset_discovery_response.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import duration_pb2 # type: ignore import proto # type: ignore @@ -42,12 +44,12 @@ class State(proto.Enum): SUPERSEDED = 2 TERMINATED = 3 - state = proto.Field( + state: State = proto.Field( proto.ENUM, number=1, enum=State, ) - duration = proto.Field( + duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=2, message=duration_pb2.Duration, diff --git a/google/cloud/securitycenter_v1beta1/types/security_marks.py b/google/cloud/securitycenter_v1beta1/types/security_marks.py index 31cdf5ab..de3f34a8 100644 --- a/google/cloud/securitycenter_v1beta1/types/security_marks.py +++ b/google/cloud/securitycenter_v1beta1/types/security_marks.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -37,7 +39,7 @@ class SecurityMarks(proto.Message): Examples: "organizations/{organization_id}/assets/{asset_id}/securityMarks" "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". - marks (Mapping[str, str]): + marks (MutableMapping[str, str]): Mutable user specified security marks belonging to the parent resource. Constraints are as follows: @@ -49,11 +51,11 @@ class SecurityMarks(proto.Message): (inclusive) """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - marks = proto.MapField( + marks: MutableMapping[str, str] = proto.MapField( proto.STRING, proto.STRING, number=2, diff --git a/google/cloud/securitycenter_v1beta1/types/securitycenter_service.py b/google/cloud/securitycenter_v1beta1/types/securitycenter_service.py index 8ff5a7a0..6551cc47 100644 --- a/google/cloud/securitycenter_v1beta1/types/securitycenter_service.py +++ b/google/cloud/securitycenter_v1beta1/types/securitycenter_service.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import struct_pb2 # type: ignore @@ -77,15 +79,15 @@ class CreateFindingRequest(proto.Message): fields on this resource. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - finding_id = proto.Field( + finding_id: str = proto.Field( proto.STRING, number=2, ) - finding = proto.Field( + finding: gcs_finding.Finding = proto.Field( proto.MESSAGE, number=3, message=gcs_finding.Finding, @@ -105,11 +107,11 @@ class CreateSourceRequest(proto.Message): ignored. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - source = proto.Field( + source: gcs_source.Source = proto.Field( proto.MESSAGE, number=2, message=gcs_source.Source, @@ -126,7 +128,7 @@ class GetOrganizationSettingsRequest(proto.Message): "organizations/[organization_id]/organizationSettings". """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -141,7 +143,7 @@ class GetSourceRequest(proto.Message): is "organizations/[organization_id]/source/[source_id]". """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -245,33 +247,33 @@ class GroupAssetsRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - group_by = proto.Field( + group_by: str = proto.Field( proto.STRING, number=3, ) - compare_duration = proto.Field( + compare_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=4, message=duration_pb2.Duration, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=7, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=8, ) @@ -281,7 +283,7 @@ class GroupAssetsResponse(proto.Message): r"""Response message for grouping by assets. Attributes: - group_by_results (Sequence[google.cloud.securitycenter_v1beta1.types.GroupResult]): + group_by_results (MutableSequence[google.cloud.securitycenter_v1beta1.types.GroupResult]): Group results. There exists an element for each existing unique combination of property/values. The element contains a count @@ -298,17 +300,17 @@ class GroupAssetsResponse(proto.Message): def raw_page(self): return self - group_by_results = proto.RepeatedField( + group_by_results: MutableSequence["GroupResult"] = proto.RepeatedField( proto.MESSAGE, number=1, message="GroupResult", ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=3, ) @@ -381,28 +383,28 @@ class GroupFindingsRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - group_by = proto.Field( + group_by: str = proto.Field( proto.STRING, number=3, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=5, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=6, ) @@ -412,7 +414,7 @@ class GroupFindingsResponse(proto.Message): r"""Response message for group by findings. Attributes: - group_by_results (Sequence[google.cloud.securitycenter_v1beta1.types.GroupResult]): + group_by_results (MutableSequence[google.cloud.securitycenter_v1beta1.types.GroupResult]): Group results. There exists an element for each existing unique combination of property/values. The element contains a count @@ -429,17 +431,17 @@ class GroupFindingsResponse(proto.Message): def raw_page(self): return self - group_by_results = proto.RepeatedField( + group_by_results: MutableSequence["GroupResult"] = proto.RepeatedField( proto.MESSAGE, number=1, message="GroupResult", ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=3, ) @@ -450,7 +452,7 @@ class GroupResult(proto.Message): request. Attributes: - properties (Mapping[str, google.protobuf.struct_pb2.Value]): + properties (MutableMapping[str, google.protobuf.struct_pb2.Value]): Properties matching the groupBy fields in the request. count (int): @@ -458,13 +460,13 @@ class GroupResult(proto.Message): properties. """ - properties = proto.MapField( + properties: MutableMapping[str, struct_pb2.Value] = proto.MapField( proto.STRING, proto.MESSAGE, number=1, message=struct_pb2.Value, ) - count = proto.Field( + count: int = proto.Field( proto.INT64, number=2, ) @@ -488,15 +490,15 @@ class ListSourcesRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=2, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=7, ) @@ -506,7 +508,7 @@ class ListSourcesResponse(proto.Message): r"""Response message for listing sources. Attributes: - sources (Sequence[google.cloud.securitycenter_v1beta1.types.Source]): + sources (MutableSequence[google.cloud.securitycenter_v1beta1.types.Source]): Sources belonging to the requested parent. next_page_token (str): Token to retrieve the next page of results, @@ -517,12 +519,12 @@ class ListSourcesResponse(proto.Message): def raw_page(self): return self - sources = proto.RepeatedField( + sources: MutableSequence[gcs_source.Source] = proto.RepeatedField( proto.MESSAGE, number=1, message=gcs_source.Source, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -626,38 +628,38 @@ class ListAssetsRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - order_by = proto.Field( + order_by: str = proto.Field( proto.STRING, number=3, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, ) - compare_duration = proto.Field( + compare_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=5, message=duration_pb2.Duration, ) - field_mask = proto.Field( + field_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=7, message=field_mask_pb2.FieldMask, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=8, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=9, ) @@ -667,7 +669,7 @@ class ListAssetsResponse(proto.Message): r"""Response message for listing assets. Attributes: - list_assets_results (Sequence[google.cloud.securitycenter_v1beta1.types.ListAssetsResponse.ListAssetsResult]): + list_assets_results (MutableSequence[google.cloud.securitycenter_v1beta1.types.ListAssetsResponse.ListAssetsResult]): Assets matching the list request. read_time (google.protobuf.timestamp_pb2.Timestamp): Time used for executing the list request. @@ -702,12 +704,12 @@ class State(proto.Enum): REMOVED = 3 ACTIVE = 4 - asset = proto.Field( + asset: gcs_asset.Asset = proto.Field( proto.MESSAGE, number=1, message=gcs_asset.Asset, ) - state = proto.Field( + state: "ListAssetsResponse.ListAssetsResult.State" = proto.Field( proto.ENUM, number=2, enum="ListAssetsResponse.ListAssetsResult.State", @@ -717,21 +719,21 @@ class State(proto.Enum): def raw_page(self): return self - list_assets_results = proto.RepeatedField( + list_assets_results: MutableSequence[ListAssetsResult] = proto.RepeatedField( proto.MESSAGE, number=1, message=ListAssetsResult, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=3, ) - total_size = proto.Field( + total_size: int = proto.Field( proto.INT32, number=4, ) @@ -808,33 +810,33 @@ class ListFindingsRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - order_by = proto.Field( + order_by: str = proto.Field( proto.STRING, number=3, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, ) - field_mask = proto.Field( + field_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=5, message=field_mask_pb2.FieldMask, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=6, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=7, ) @@ -844,7 +846,7 @@ class ListFindingsResponse(proto.Message): r"""Response message for listing findings. Attributes: - findings (Sequence[google.cloud.securitycenter_v1beta1.types.Finding]): + findings (MutableSequence[google.cloud.securitycenter_v1beta1.types.Finding]): Findings matching the list request. read_time (google.protobuf.timestamp_pb2.Timestamp): Time used for executing the list request. @@ -860,21 +862,21 @@ class ListFindingsResponse(proto.Message): def raw_page(self): return self - findings = proto.RepeatedField( + findings: MutableSequence[gcs_finding.Finding] = proto.RepeatedField( proto.MESSAGE, number=1, message=gcs_finding.Finding, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=3, ) - total_size = proto.Field( + total_size: int = proto.Field( proto.INT32, number=4, ) @@ -896,16 +898,16 @@ class SetFindingStateRequest(proto.Message): takes effect. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - state = proto.Field( + state: gcs_finding.Finding.State = proto.Field( proto.ENUM, number=2, enum=gcs_finding.Finding.State, ) - start_time = proto.Field( + start_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, @@ -922,7 +924,7 @@ class RunAssetDiscoveryRequest(proto.Message): for. Its format is "organizations/[organization_id]". """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) @@ -946,12 +948,12 @@ class UpdateFindingRequest(proto.Message): specified when creating a finding. """ - finding = proto.Field( + finding: gcs_finding.Finding = proto.Field( proto.MESSAGE, number=1, message=gcs_finding.Finding, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -970,12 +972,12 @@ class UpdateOrganizationSettingsRequest(proto.Message): settings resource. """ - organization_settings = proto.Field( + organization_settings: gcs_organization_settings.OrganizationSettings = proto.Field( proto.MESSAGE, number=1, message=gcs_organization_settings.OrganizationSettings, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -993,12 +995,12 @@ class UpdateSourceRequest(proto.Message): resource. """ - source = proto.Field( + source: gcs_source.Source = proto.Field( proto.MESSAGE, number=1, message=gcs_source.Source, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -1020,17 +1022,17 @@ class UpdateSecurityMarksRequest(proto.Message): take effect. """ - security_marks = proto.Field( + security_marks: gcs_security_marks.SecurityMarks = proto.Field( proto.MESSAGE, number=1, message=gcs_security_marks.SecurityMarks, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, ) - start_time = proto.Field( + start_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, diff --git a/google/cloud/securitycenter_v1beta1/types/source.py b/google/cloud/securitycenter_v1beta1/types/source.py index a6e7f8f7..587546e3 100644 --- a/google/cloud/securitycenter_v1beta1/types/source.py +++ b/google/cloud/securitycenter_v1beta1/types/source.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -54,15 +56,15 @@ class Source(proto.Message): outdated/insecure libraries.". """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) diff --git a/google/cloud/securitycenter_v1p1beta1/__init__.py b/google/cloud/securitycenter_v1p1beta1/__init__.py index 93053f8e..64c20f57 100644 --- a/google/cloud/securitycenter_v1p1beta1/__init__.py +++ b/google/cloud/securitycenter_v1p1beta1/__init__.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.cloud.securitycenter import gapic_version as package_version + +__version__ = package_version.__version__ + from .services.security_center import SecurityCenterAsyncClient, SecurityCenterClient from .types.asset import Asset diff --git a/google/cloud/securitycenter_v1p1beta1/gapic_version.py b/google/cloud/securitycenter_v1p1beta1/gapic_version.py new file mode 100644 index 00000000..cb72862e --- /dev/null +++ b/google/cloud/securitycenter_v1p1beta1/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "1.17.0" # {x-release-please-version} diff --git a/google/cloud/securitycenter_v1p1beta1/services/security_center/async_client.py b/google/cloud/securitycenter_v1p1beta1/services/security_center/async_client.py index 5bc1a0f7..d1fec0e5 100644 --- a/google/cloud/securitycenter_v1p1beta1/services/security_center/async_client.py +++ b/google/cloud/securitycenter_v1p1beta1/services/security_center/async_client.py @@ -16,7 +16,17 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 @@ -24,7 +34,8 @@ from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.securitycenter_v1p1beta1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -206,9 +217,9 @@ def transport(self) -> SecurityCenterTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, SecurityCenterTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the security center client. @@ -252,12 +263,14 @@ def __init__( async def create_source( self, - request: Union[securitycenter_service.CreateSourceRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateSourceRequest, dict] + ] = None, *, - parent: str = None, - source: gcs_source.Source = None, + parent: Optional[str] = None, + source: Optional[gcs_source.Source] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_source.Source: r"""Creates a source. @@ -289,7 +302,7 @@ async def sample_create_source(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.CreateSourceRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.CreateSourceRequest, dict]]): The request object. Request message for creating a source. parent (:class:`str`): @@ -369,13 +382,15 @@ async def sample_create_source(): async def create_finding( self, - request: Union[securitycenter_service.CreateFindingRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateFindingRequest, dict] + ] = None, *, - parent: str = None, - finding_id: str = None, - finding: gcs_finding.Finding = None, + parent: Optional[str] = None, + finding_id: Optional[str] = None, + finding: Optional[gcs_finding.Finding] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_finding.Finding: r"""Creates a finding. The corresponding source must @@ -409,7 +424,7 @@ async def sample_create_finding(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.CreateFindingRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.CreateFindingRequest, dict]]): The request object. Request message for creating a finding. parent (:class:`str`): @@ -502,15 +517,17 @@ async def sample_create_finding(): async def create_notification_config( self, - request: Union[ - securitycenter_service.CreateNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.CreateNotificationConfigRequest, dict] ] = None, *, - parent: str = None, - config_id: str = None, - notification_config: gcs_notification_config.NotificationConfig = None, + parent: Optional[str] = None, + config_id: Optional[str] = None, + notification_config: Optional[ + gcs_notification_config.NotificationConfig + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_notification_config.NotificationConfig: r"""Creates a notification config. @@ -543,7 +560,7 @@ async def sample_create_notification_config(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.CreateNotificationConfigRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.CreateNotificationConfigRequest, dict]]): The request object. Request message for creating a notification config. parent (:class:`str`): @@ -637,13 +654,13 @@ async def sample_create_notification_config(): async def delete_notification_config( self, - request: Union[ - securitycenter_service.DeleteNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.DeleteNotificationConfigRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a notification config. @@ -672,7 +689,7 @@ async def sample_delete_notification_config(): await client.delete_notification_config(request=request) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.DeleteNotificationConfigRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.DeleteNotificationConfigRequest, dict]]): The request object. Request message for deleting a notification config. name (:class:`str`): @@ -730,11 +747,11 @@ async def sample_delete_notification_config(): async def get_iam_policy( self, - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the access control policy on the specified @@ -768,7 +785,7 @@ async def sample_get_iam_policy(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): + request (Optional[Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]]): The request object. Request message for `GetIamPolicy` method. resource (:class:`str`): @@ -907,13 +924,13 @@ async def sample_get_iam_policy(): async def get_notification_config( self, - request: Union[ - securitycenter_service.GetNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.GetNotificationConfigRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> notification_config.NotificationConfig: r"""Gets a notification config. @@ -945,7 +962,7 @@ async def sample_get_notification_config(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.GetNotificationConfigRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.GetNotificationConfigRequest, dict]]): The request object. Request message for getting a notification config. name (:class:`str`): @@ -1027,13 +1044,13 @@ async def sample_get_notification_config(): async def get_organization_settings( self, - request: Union[ - securitycenter_service.GetOrganizationSettingsRequest, dict + request: Optional[ + Union[securitycenter_service.GetOrganizationSettingsRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> organization_settings.OrganizationSettings: r"""Gets the settings for an organization. @@ -1065,7 +1082,7 @@ async def sample_get_organization_settings(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.GetOrganizationSettingsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.GetOrganizationSettingsRequest, dict]]): The request object. Request message for getting organization settings. name (:class:`str`): @@ -1143,11 +1160,11 @@ async def sample_get_organization_settings(): async def get_source( self, - request: Union[securitycenter_service.GetSourceRequest, dict] = None, + request: Optional[Union[securitycenter_service.GetSourceRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> source.Source: r"""Gets a source. @@ -1179,7 +1196,7 @@ async def sample_get_source(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.GetSourceRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.GetSourceRequest, dict]]): The request object. Request message for getting a source. name (:class:`str`): @@ -1260,10 +1277,12 @@ async def sample_get_source(): async def group_assets( self, - request: Union[securitycenter_service.GroupAssetsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GroupAssetsRequest, dict] + ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.GroupAssetsAsyncPager: r"""Filters an organization's assets and groups them by @@ -1298,7 +1317,7 @@ async def sample_group_assets(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.GroupAssetsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.GroupAssetsRequest, dict]]): The request object. Request message for grouping by assets. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -1365,12 +1384,14 @@ async def sample_group_assets(): async def group_findings( self, - request: Union[securitycenter_service.GroupFindingsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GroupFindingsRequest, dict] + ] = None, *, - parent: str = None, - group_by: str = None, + parent: Optional[str] = None, + group_by: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.GroupFindingsAsyncPager: r"""Filters an organization or source's findings and groups them by @@ -1410,7 +1431,7 @@ async def sample_group_findings(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.GroupFindingsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.GroupFindingsRequest, dict]]): The request object. Request message for grouping by findings. parent (:class:`str`): @@ -1528,11 +1549,11 @@ async def sample_group_findings(): async def list_assets( self, - request: Union[securitycenter_service.ListAssetsRequest, dict] = None, + request: Optional[Union[securitycenter_service.ListAssetsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListAssetsAsyncPager: r"""Lists an organization's assets. @@ -1565,7 +1586,7 @@ async def sample_list_assets(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.ListAssetsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.ListAssetsRequest, dict]]): The request object. Request message for listing assets. parent (:class:`str`): Required. Name of the organization assets should belong @@ -1652,11 +1673,13 @@ async def sample_list_assets(): async def list_findings( self, - request: Union[securitycenter_service.ListFindingsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListFindingsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFindingsAsyncPager: r"""Lists an organization or source's findings. @@ -1693,7 +1716,7 @@ async def sample_list_findings(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.ListFindingsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.ListFindingsRequest, dict]]): The request object. Request message for listing findings. parent (:class:`str`): @@ -1788,13 +1811,13 @@ async def sample_list_findings(): async def list_notification_configs( self, - request: Union[ - securitycenter_service.ListNotificationConfigsRequest, dict + request: Optional[ + Union[securitycenter_service.ListNotificationConfigsRequest, dict] ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListNotificationConfigsAsyncPager: r"""Lists notification configs. @@ -1827,7 +1850,7 @@ async def sample_list_notification_configs(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.ListNotificationConfigsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.ListNotificationConfigsRequest, dict]]): The request object. Request message for listing notification configs. parent (:class:`str`): @@ -1916,11 +1939,13 @@ async def sample_list_notification_configs(): async def list_sources( self, - request: Union[securitycenter_service.ListSourcesRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListSourcesRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListSourcesAsyncPager: r"""Lists all sources belonging to an organization. @@ -1953,7 +1978,7 @@ async def sample_list_sources(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.ListSourcesRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.ListSourcesRequest, dict]]): The request object. Request message for listing sources. parent (:class:`str`): Required. Resource name of the parent of sources to @@ -2041,11 +2066,13 @@ async def sample_list_sources(): async def run_asset_discovery( self, - request: Union[securitycenter_service.RunAssetDiscoveryRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.RunAssetDiscoveryRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Runs asset discovery. The discovery is tracked with a @@ -2080,13 +2107,13 @@ async def sample_run_asset_discovery(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.RunAssetDiscoveryRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.RunAssetDiscoveryRequest, dict]]): The request object. Request message for running asset discovery for an organization. parent (:class:`str`): @@ -2164,13 +2191,15 @@ async def sample_run_asset_discovery(): async def set_finding_state( self, - request: Union[securitycenter_service.SetFindingStateRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.SetFindingStateRequest, dict] + ] = None, *, - name: str = None, - state: finding.Finding.State = None, - start_time: timestamp_pb2.Timestamp = None, + name: Optional[str] = None, + state: Optional[finding.Finding.State] = None, + start_time: Optional[timestamp_pb2.Timestamp] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> finding.Finding: r"""Updates the state of a finding. @@ -2203,7 +2232,7 @@ async def sample_set_finding_state(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.SetFindingStateRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.SetFindingStateRequest, dict]]): The request object. Request message for updating a finding's state. name (:class:`str`): @@ -2297,11 +2326,11 @@ async def sample_set_finding_state(): async def set_iam_policy( self, - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the access control policy on the specified @@ -2335,7 +2364,7 @@ async def sample_set_iam_policy(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): + request (Optional[Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]]): The request object. Request message for `SetIamPolicy` method. resource (:class:`str`): @@ -2464,12 +2493,12 @@ async def sample_set_iam_policy(): async def test_iam_permissions( self, - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, - resource: str = None, - permissions: Sequence[str] = None, + resource: Optional[str] = None, + permissions: Optional[MutableSequence[str]] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns the permissions that a caller has on the @@ -2504,7 +2533,7 @@ async def sample_test_iam_permissions(): print(response) Args: - request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): + request (Optional[Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]]): The request object. Request message for `TestIamPermissions` method. resource (:class:`str`): @@ -2516,7 +2545,7 @@ async def sample_test_iam_permissions(): This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - permissions (:class:`Sequence[str]`): + permissions (:class:`MutableSequence[str]`): The set of permissions to check for the ``resource``. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see `IAM @@ -2592,12 +2621,14 @@ async def sample_test_iam_permissions(): async def update_finding( self, - request: Union[securitycenter_service.UpdateFindingRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateFindingRequest, dict] + ] = None, *, - finding: gcs_finding.Finding = None, - update_mask: field_mask_pb2.FieldMask = None, + finding: Optional[gcs_finding.Finding] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_finding.Finding: r"""Creates or updates a finding. The corresponding @@ -2629,7 +2660,7 @@ async def sample_update_finding(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.UpdateFindingRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.UpdateFindingRequest, dict]]): The request object. Request message for updating or creating a finding. finding (:class:`google.cloud.securitycenter_v1p1beta1.types.Finding`): @@ -2725,14 +2756,16 @@ async def sample_update_finding(): async def update_notification_config( self, - request: Union[ - securitycenter_service.UpdateNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.UpdateNotificationConfigRequest, dict] ] = None, *, - notification_config: gcs_notification_config.NotificationConfig = None, - update_mask: field_mask_pb2.FieldMask = None, + notification_config: Optional[ + gcs_notification_config.NotificationConfig + ] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_notification_config.NotificationConfig: r"""Updates a notification config. The following update fields are @@ -2764,7 +2797,7 @@ async def sample_update_notification_config(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.UpdateNotificationConfigRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.UpdateNotificationConfigRequest, dict]]): The request object. Request message for updating a notification config. notification_config (:class:`google.cloud.securitycenter_v1p1beta1.types.NotificationConfig`): @@ -2848,13 +2881,15 @@ async def sample_update_notification_config(): async def update_organization_settings( self, - request: Union[ - securitycenter_service.UpdateOrganizationSettingsRequest, dict + request: Optional[ + Union[securitycenter_service.UpdateOrganizationSettingsRequest, dict] ] = None, *, - organization_settings: gcs_organization_settings.OrganizationSettings = None, + organization_settings: Optional[ + gcs_organization_settings.OrganizationSettings + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_organization_settings.OrganizationSettings: r"""Updates an organization's settings. @@ -2885,7 +2920,7 @@ async def sample_update_organization_settings(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.UpdateOrganizationSettingsRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.UpdateOrganizationSettingsRequest, dict]]): The request object. Request message for updating an organization's settings. organization_settings (:class:`google.cloud.securitycenter_v1p1beta1.types.OrganizationSettings`): @@ -2954,12 +2989,14 @@ async def sample_update_organization_settings(): async def update_source( self, - request: Union[securitycenter_service.UpdateSourceRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateSourceRequest, dict] + ] = None, *, - source: gcs_source.Source = None, - update_mask: field_mask_pb2.FieldMask = None, + source: Optional[gcs_source.Source] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_source.Source: r"""Updates a source. @@ -2990,7 +3027,7 @@ async def sample_update_source(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.UpdateSourceRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.UpdateSourceRequest, dict]]): The request object. Request message for updating a source. source (:class:`google.cloud.securitycenter_v1p1beta1.types.Source`): @@ -3073,12 +3110,14 @@ async def sample_update_source(): async def update_security_marks( self, - request: Union[securitycenter_service.UpdateSecurityMarksRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateSecurityMarksRequest, dict] + ] = None, *, - security_marks: gcs_security_marks.SecurityMarks = None, - update_mask: field_mask_pb2.FieldMask = None, + security_marks: Optional[gcs_security_marks.SecurityMarks] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_security_marks.SecurityMarks: r"""Updates security marks. @@ -3109,7 +3148,7 @@ async def sample_update_security_marks(): print(response) Args: - request (Union[google.cloud.securitycenter_v1p1beta1.types.UpdateSecurityMarksRequest, dict]): + request (Optional[Union[google.cloud.securitycenter_v1p1beta1.types.UpdateSecurityMarksRequest, dict]]): The request object. Request message for updating a SecurityMarks resource. security_marks (:class:`google.cloud.securitycenter_v1p1beta1.types.SecurityMarks`): @@ -3202,14 +3241,9 @@ async def __aexit__(self, exc_type, exc, tb): await self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-securitycenter", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SecurityCenterAsyncClient",) diff --git a/google/cloud/securitycenter_v1p1beta1/services/security_center/client.py b/google/cloud/securitycenter_v1p1beta1/services/security_center/client.py index d0a8e6c3..33bf4a24 100644 --- a/google/cloud/securitycenter_v1p1beta1/services/security_center/client.py +++ b/google/cloud/securitycenter_v1p1beta1/services/security_center/client.py @@ -16,7 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -27,7 +38,8 @@ from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.oauth2 import service_account # type: ignore -import pkg_resources + +from google.cloud.securitycenter_v1p1beta1 import gapic_version as package_version try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -83,7 +95,7 @@ class SecurityCenterClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[SecurityCenterTransport]: """Returns an appropriate transport class. @@ -472,8 +484,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, SecurityCenterTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, SecurityCenterTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the security center client. @@ -487,7 +499,7 @@ def __init__( transport (Union[str, SecurityCenterTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -517,6 +529,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -569,12 +582,14 @@ def __init__( def create_source( self, - request: Union[securitycenter_service.CreateSourceRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateSourceRequest, dict] + ] = None, *, - parent: str = None, - source: gcs_source.Source = None, + parent: Optional[str] = None, + source: Optional[gcs_source.Source] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_source.Source: r"""Creates a source. @@ -686,13 +701,15 @@ def sample_create_source(): def create_finding( self, - request: Union[securitycenter_service.CreateFindingRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.CreateFindingRequest, dict] + ] = None, *, - parent: str = None, - finding_id: str = None, - finding: gcs_finding.Finding = None, + parent: Optional[str] = None, + finding_id: Optional[str] = None, + finding: Optional[gcs_finding.Finding] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_finding.Finding: r"""Creates a finding. The corresponding source must @@ -819,15 +836,17 @@ def sample_create_finding(): def create_notification_config( self, - request: Union[ - securitycenter_service.CreateNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.CreateNotificationConfigRequest, dict] ] = None, *, - parent: str = None, - config_id: str = None, - notification_config: gcs_notification_config.NotificationConfig = None, + parent: Optional[str] = None, + config_id: Optional[str] = None, + notification_config: Optional[ + gcs_notification_config.NotificationConfig + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_notification_config.NotificationConfig: r"""Creates a notification config. @@ -958,13 +977,13 @@ def sample_create_notification_config(): def delete_notification_config( self, - request: Union[ - securitycenter_service.DeleteNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.DeleteNotificationConfigRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a notification config. @@ -1055,11 +1074,11 @@ def sample_delete_notification_config(): def get_iam_policy( self, - request: Union[iam_policy_pb2.GetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Gets the access control policy on the specified @@ -1219,13 +1238,13 @@ def sample_get_iam_policy(): def get_notification_config( self, - request: Union[ - securitycenter_service.GetNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.GetNotificationConfigRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> notification_config.NotificationConfig: r"""Gets a notification config. @@ -1329,13 +1348,13 @@ def sample_get_notification_config(): def get_organization_settings( self, - request: Union[ - securitycenter_service.GetOrganizationSettingsRequest, dict + request: Optional[ + Union[securitycenter_service.GetOrganizationSettingsRequest, dict] ] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> organization_settings.OrganizationSettings: r"""Gets the settings for an organization. @@ -1439,11 +1458,11 @@ def sample_get_organization_settings(): def get_source( self, - request: Union[securitycenter_service.GetSourceRequest, dict] = None, + request: Optional[Union[securitycenter_service.GetSourceRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> source.Source: r"""Gets a source. @@ -1546,10 +1565,12 @@ def sample_get_source(): def group_assets( self, - request: Union[securitycenter_service.GroupAssetsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GroupAssetsRequest, dict] + ] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.GroupAssetsPager: r"""Filters an organization's assets and groups them by @@ -1642,12 +1663,14 @@ def sample_group_assets(): def group_findings( self, - request: Union[securitycenter_service.GroupFindingsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.GroupFindingsRequest, dict] + ] = None, *, - parent: str = None, - group_by: str = None, + parent: Optional[str] = None, + group_by: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.GroupFindingsPager: r"""Filters an organization or source's findings and groups them by @@ -1795,11 +1818,11 @@ def sample_group_findings(): def list_assets( self, - request: Union[securitycenter_service.ListAssetsRequest, dict] = None, + request: Optional[Union[securitycenter_service.ListAssetsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListAssetsPager: r"""Lists an organization's assets. @@ -1909,11 +1932,13 @@ def sample_list_assets(): def list_findings( self, - request: Union[securitycenter_service.ListFindingsRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListFindingsRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListFindingsPager: r"""Lists an organization or source's findings. @@ -2035,13 +2060,13 @@ def sample_list_findings(): def list_notification_configs( self, - request: Union[ - securitycenter_service.ListNotificationConfigsRequest, dict + request: Optional[ + Union[securitycenter_service.ListNotificationConfigsRequest, dict] ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListNotificationConfigsPager: r"""Lists notification configs. @@ -2157,11 +2182,13 @@ def sample_list_notification_configs(): def list_sources( self, - request: Union[securitycenter_service.ListSourcesRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.ListSourcesRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListSourcesPager: r"""Lists all sources belonging to an organization. @@ -2272,11 +2299,13 @@ def sample_list_sources(): def run_asset_discovery( self, - request: Union[securitycenter_service.RunAssetDiscoveryRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.RunAssetDiscoveryRequest, dict] + ] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Runs asset discovery. The discovery is tracked with a @@ -2395,13 +2424,15 @@ def sample_run_asset_discovery(): def set_finding_state( self, - request: Union[securitycenter_service.SetFindingStateRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.SetFindingStateRequest, dict] + ] = None, *, - name: str = None, - state: finding.Finding.State = None, - start_time: timestamp_pb2.Timestamp = None, + name: Optional[str] = None, + state: Optional[finding.Finding.State] = None, + start_time: Optional[timestamp_pb2.Timestamp] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> finding.Finding: r"""Updates the state of a finding. @@ -2528,11 +2559,11 @@ def sample_set_finding_state(): def set_iam_policy( self, - request: Union[iam_policy_pb2.SetIamPolicyRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None, *, - resource: str = None, + resource: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> policy_pb2.Policy: r"""Sets the access control policy on the specified @@ -2692,12 +2723,12 @@ def sample_set_iam_policy(): def test_iam_permissions( self, - request: Union[iam_policy_pb2.TestIamPermissionsRequest, dict] = None, + request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None, *, - resource: str = None, - permissions: Sequence[str] = None, + resource: Optional[str] = None, + permissions: Optional[MutableSequence[str]] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> iam_policy_pb2.TestIamPermissionsResponse: r"""Returns the permissions that a caller has on the @@ -2744,7 +2775,7 @@ def sample_test_iam_permissions(): This corresponds to the ``resource`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - permissions (Sequence[str]): + permissions (MutableSequence[str]): The set of permissions to check for the ``resource``. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see `IAM @@ -2808,12 +2839,14 @@ def sample_test_iam_permissions(): def update_finding( self, - request: Union[securitycenter_service.UpdateFindingRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateFindingRequest, dict] + ] = None, *, - finding: gcs_finding.Finding = None, - update_mask: field_mask_pb2.FieldMask = None, + finding: Optional[gcs_finding.Finding] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_finding.Finding: r"""Creates or updates a finding. The corresponding @@ -2941,14 +2974,16 @@ def sample_update_finding(): def update_notification_config( self, - request: Union[ - securitycenter_service.UpdateNotificationConfigRequest, dict + request: Optional[ + Union[securitycenter_service.UpdateNotificationConfigRequest, dict] ] = None, *, - notification_config: gcs_notification_config.NotificationConfig = None, - update_mask: field_mask_pb2.FieldMask = None, + notification_config: Optional[ + gcs_notification_config.NotificationConfig + ] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_notification_config.NotificationConfig: r"""Updates a notification config. The following update fields are @@ -3068,13 +3103,15 @@ def sample_update_notification_config(): def update_organization_settings( self, - request: Union[ - securitycenter_service.UpdateOrganizationSettingsRequest, dict + request: Optional[ + Union[securitycenter_service.UpdateOrganizationSettingsRequest, dict] ] = None, *, - organization_settings: gcs_organization_settings.OrganizationSettings = None, + organization_settings: Optional[ + gcs_organization_settings.OrganizationSettings + ] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_organization_settings.OrganizationSettings: r"""Updates an organization's settings. @@ -3178,12 +3215,14 @@ def sample_update_organization_settings(): def update_source( self, - request: Union[securitycenter_service.UpdateSourceRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateSourceRequest, dict] + ] = None, *, - source: gcs_source.Source = None, - update_mask: field_mask_pb2.FieldMask = None, + source: Optional[gcs_source.Source] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_source.Source: r"""Updates a source. @@ -3297,12 +3336,14 @@ def sample_update_source(): def update_security_marks( self, - request: Union[securitycenter_service.UpdateSecurityMarksRequest, dict] = None, + request: Optional[ + Union[securitycenter_service.UpdateSecurityMarksRequest, dict] + ] = None, *, - security_marks: gcs_security_marks.SecurityMarks = None, - update_mask: field_mask_pb2.FieldMask = None, + security_marks: Optional[gcs_security_marks.SecurityMarks] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_security_marks.SecurityMarks: r"""Updates security marks. @@ -3433,14 +3474,9 @@ def __exit__(self, type, value, traceback): self.transport.close() -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-securitycenter", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) __all__ = ("SecurityCenterClient",) diff --git a/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/base.py b/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/base.py index 7accc851..a7cb4a59 100644 --- a/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/base.py +++ b/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/base.py @@ -27,8 +27,8 @@ from google.longrunning import operations_pb2 # type: ignore from google.oauth2 import service_account # type: ignore from google.protobuf import empty_pb2 # type: ignore -import pkg_resources +from google.cloud.securitycenter_v1p1beta1 import gapic_version as package_version from google.cloud.securitycenter_v1p1beta1.types import ( notification_config as gcs_notification_config, ) @@ -46,14 +46,9 @@ from google.cloud.securitycenter_v1p1beta1.types import source from google.cloud.securitycenter_v1p1beta1.types import source as gcs_source -try: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution( - "google-cloud-securitycenter", - ).version, - ) -except pkg_resources.DistributionNotFound: - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( + gapic_version=package_version.__version__ +) class SecurityCenterTransport(abc.ABC): @@ -67,7 +62,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc.py b/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc.py index 355fd3f7..62d49b24 100644 --- a/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc.py +++ b/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc.py @@ -65,14 +65,14 @@ def __init__( self, *, host: str = "securitycenter.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -200,8 +200,8 @@ def __init__( def create_channel( cls, host: str = "securitycenter.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc_asyncio.py b/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc_asyncio.py index d7f15fac..48fa46f2 100644 --- a/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc_asyncio.py +++ b/google/cloud/securitycenter_v1p1beta1/services/security_center/transports/grpc_asyncio.py @@ -67,7 +67,7 @@ class SecurityCenterGrpcAsyncIOTransport(SecurityCenterTransport): def create_channel( cls, host: str = "securitycenter.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -110,15 +110,15 @@ def __init__( self, *, host: str = "securitycenter.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/google/cloud/securitycenter_v1p1beta1/types/asset.py b/google/cloud/securitycenter_v1p1beta1/types/asset.py index fae606f5..d28230eb 100644 --- a/google/cloud/securitycenter_v1p1beta1/types/asset.py +++ b/google/cloud/securitycenter_v1p1beta1/types/asset.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import struct_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -50,7 +52,7 @@ class Asset(proto.Message): Security Command Center managed properties. These properties are managed by Security Command Center and cannot be modified by the user. - resource_properties (Mapping[str, google.protobuf.struct_pb2.Value]): + resource_properties (MutableMapping[str, google.protobuf.struct_pb2.Value]): Resource managed properties. These properties are managed and defined by the Google Cloud resource and cannot be modified by the user. @@ -105,7 +107,7 @@ class SecurityCenterProperties(proto.Message): The full resource name of the project the resource belongs to. See: https://cloud.google.com/apis/design/resource_names#full_resource_name - resource_owners (Sequence[str]): + resource_owners (MutableSequence[str]): Owners of the Google Cloud resource. resource_display_name (str): The user defined display name for this @@ -116,46 +118,46 @@ class SecurityCenterProperties(proto.Message): resource_project_display_name (str): The user defined display name for the project of this resource. - folders (Sequence[google.cloud.securitycenter_v1p1beta1.types.Folder]): + folders (MutableSequence[google.cloud.securitycenter_v1p1beta1.types.Folder]): Contains a Folder message for each folder in the assets ancestry. The first folder is the deepest nested folder, and the last folder is the folder directly under the Organization. """ - resource_name = proto.Field( + resource_name: str = proto.Field( proto.STRING, number=1, ) - resource_type = proto.Field( + resource_type: str = proto.Field( proto.STRING, number=2, ) - resource_parent = proto.Field( + resource_parent: str = proto.Field( proto.STRING, number=3, ) - resource_project = proto.Field( + resource_project: str = proto.Field( proto.STRING, number=4, ) - resource_owners = proto.RepeatedField( + resource_owners: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=5, ) - resource_display_name = proto.Field( + resource_display_name: str = proto.Field( proto.STRING, number=6, ) - resource_parent_display_name = proto.Field( + resource_parent_display_name: str = proto.Field( proto.STRING, number=7, ) - resource_project_display_name = proto.Field( + resource_project_display_name: str = proto.Field( proto.STRING, number=8, ) - folders = proto.RepeatedField( + folders: MutableSequence[folder.Folder] = proto.RepeatedField( proto.MESSAGE, number=10, message=folder.Folder, @@ -175,47 +177,47 @@ class IamPolicy(proto.Message): for format details. """ - policy_blob = proto.Field( + policy_blob: str = proto.Field( proto.STRING, number=1, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - security_center_properties = proto.Field( + security_center_properties: SecurityCenterProperties = proto.Field( proto.MESSAGE, number=2, message=SecurityCenterProperties, ) - resource_properties = proto.MapField( + resource_properties: MutableMapping[str, struct_pb2.Value] = proto.MapField( proto.STRING, proto.MESSAGE, number=7, message=struct_pb2.Value, ) - security_marks = proto.Field( + security_marks: gcs_security_marks.SecurityMarks = proto.Field( proto.MESSAGE, number=8, message=gcs_security_marks.SecurityMarks, ) - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=9, message=timestamp_pb2.Timestamp, ) - update_time = proto.Field( + update_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=10, message=timestamp_pb2.Timestamp, ) - iam_policy = proto.Field( + iam_policy: IamPolicy = proto.Field( proto.MESSAGE, number=11, message=IamPolicy, ) - canonical_name = proto.Field( + canonical_name: str = proto.Field( proto.STRING, number=13, ) diff --git a/google/cloud/securitycenter_v1p1beta1/types/finding.py b/google/cloud/securitycenter_v1p1beta1/types/finding.py index 90403f7b..900cb812 100644 --- a/google/cloud/securitycenter_v1p1beta1/types/finding.py +++ b/google/cloud/securitycenter_v1p1beta1/types/finding.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import struct_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore import proto # type: ignore @@ -68,7 +70,7 @@ class Finding(proto.Message): additional information about the finding can be found. This field is guaranteed to be either empty or a well formed URL. - source_properties (Mapping[str, google.protobuf.struct_pb2.Value]): + source_properties (MutableMapping[str, google.protobuf.struct_pb2.Value]): Source specific properties. These properties are managed by the source that writes the finding. The key names in the source_properties map must be between 1 and 255 characters, @@ -122,58 +124,58 @@ class Severity(proto.Enum): MEDIUM = 3 LOW = 4 - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=2, ) - resource_name = proto.Field( + resource_name: str = proto.Field( proto.STRING, number=3, ) - state = proto.Field( + state: State = proto.Field( proto.ENUM, number=4, enum=State, ) - category = proto.Field( + category: str = proto.Field( proto.STRING, number=5, ) - external_uri = proto.Field( + external_uri: str = proto.Field( proto.STRING, number=6, ) - source_properties = proto.MapField( + source_properties: MutableMapping[str, struct_pb2.Value] = proto.MapField( proto.STRING, proto.MESSAGE, number=7, message=struct_pb2.Value, ) - security_marks = proto.Field( + security_marks: gcs_security_marks.SecurityMarks = proto.Field( proto.MESSAGE, number=8, message=gcs_security_marks.SecurityMarks, ) - event_time = proto.Field( + event_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=9, message=timestamp_pb2.Timestamp, ) - create_time = proto.Field( + create_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=10, message=timestamp_pb2.Timestamp, ) - severity = proto.Field( + severity: Severity = proto.Field( proto.ENUM, number=13, enum=Severity, ) - canonical_name = proto.Field( + canonical_name: str = proto.Field( proto.STRING, number=14, ) diff --git a/google/cloud/securitycenter_v1p1beta1/types/folder.py b/google/cloud/securitycenter_v1p1beta1/types/folder.py index a7328d78..08e889f5 100644 --- a/google/cloud/securitycenter_v1p1beta1/types/folder.py +++ b/google/cloud/securitycenter_v1p1beta1/types/folder.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -36,11 +38,11 @@ class Folder(proto.Message): folder. """ - resource_folder = proto.Field( + resource_folder: str = proto.Field( proto.STRING, number=1, ) - resource_folder_display_name = proto.Field( + resource_folder_display_name: str = proto.Field( proto.STRING, number=2, ) diff --git a/google/cloud/securitycenter_v1p1beta1/types/notification_config.py b/google/cloud/securitycenter_v1p1beta1/types/notification_config.py index 528e5987..50ca126b 100644 --- a/google/cloud/securitycenter_v1p1beta1/types/notification_config.py +++ b/google/cloud/securitycenter_v1p1beta1/types/notification_config.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -94,33 +96,33 @@ class StreamingConfig(proto.Message): - boolean literals ``true`` and ``false`` without quotes. """ - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=1, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=2, ) - event_type = proto.Field( + event_type: EventType = proto.Field( proto.ENUM, number=3, enum=EventType, ) - pubsub_topic = proto.Field( + pubsub_topic: str = proto.Field( proto.STRING, number=4, ) - service_account = proto.Field( + service_account: str = proto.Field( proto.STRING, number=5, ) - streaming_config = proto.Field( + streaming_config: StreamingConfig = proto.Field( proto.MESSAGE, number=6, oneof="notify_config", diff --git a/google/cloud/securitycenter_v1p1beta1/types/notification_message.py b/google/cloud/securitycenter_v1p1beta1/types/notification_message.py index f743a862..e8b3ba8d 100644 --- a/google/cloud/securitycenter_v1p1beta1/types/notification_message.py +++ b/google/cloud/securitycenter_v1p1beta1/types/notification_message.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.securitycenter_v1p1beta1.types import resource as gcs_resource @@ -44,17 +46,17 @@ class NotificationMessage(proto.Message): The Cloud resource tied to the notification. """ - notification_config_name = proto.Field( + notification_config_name: str = proto.Field( proto.STRING, number=1, ) - finding = proto.Field( + finding: gcs_finding.Finding = proto.Field( proto.MESSAGE, number=2, oneof="event", message=gcs_finding.Finding, ) - resource = proto.Field( + resource: gcs_resource.Resource = proto.Field( proto.MESSAGE, number=3, message=gcs_resource.Resource, diff --git a/google/cloud/securitycenter_v1p1beta1/types/organization_settings.py b/google/cloud/securitycenter_v1p1beta1/types/organization_settings.py index 9b263cf6..a18af0e8 100644 --- a/google/cloud/securitycenter_v1p1beta1/types/organization_settings.py +++ b/google/cloud/securitycenter_v1p1beta1/types/organization_settings.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -47,13 +49,13 @@ class AssetDiscoveryConfig(proto.Message): r"""The configuration used for Asset Discovery runs. Attributes: - project_ids (Sequence[str]): + project_ids (MutableSequence[str]): The project ids to use for filtering asset discovery. inclusion_mode (google.cloud.securitycenter_v1p1beta1.types.OrganizationSettings.AssetDiscoveryConfig.InclusionMode): The mode to use for filtering asset discovery. - folder_ids (Sequence[str]): + folder_ids (MutableSequence[str]): The folder ids to use for filtering asset discovery. It consists of only digits, e.g., 756619654966. @@ -73,29 +75,31 @@ class InclusionMode(proto.Enum): INCLUDE_ONLY = 1 EXCLUDE = 2 - project_ids = proto.RepeatedField( + project_ids: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - inclusion_mode = proto.Field( - proto.ENUM, - number=2, - enum="OrganizationSettings.AssetDiscoveryConfig.InclusionMode", + inclusion_mode: "OrganizationSettings.AssetDiscoveryConfig.InclusionMode" = ( + proto.Field( + proto.ENUM, + number=2, + enum="OrganizationSettings.AssetDiscoveryConfig.InclusionMode", + ) ) - folder_ids = proto.RepeatedField( + folder_ids: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - enable_asset_discovery = proto.Field( + enable_asset_discovery: bool = proto.Field( proto.BOOL, number=2, ) - asset_discovery_config = proto.Field( + asset_discovery_config: AssetDiscoveryConfig = proto.Field( proto.MESSAGE, number=3, message=AssetDiscoveryConfig, diff --git a/google/cloud/securitycenter_v1p1beta1/types/resource.py b/google/cloud/securitycenter_v1p1beta1/types/resource.py index 632b05c5..f9740833 100644 --- a/google/cloud/securitycenter_v1p1beta1/types/resource.py +++ b/google/cloud/securitycenter_v1p1beta1/types/resource.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore from google.cloud.securitycenter_v1p1beta1.types import folder @@ -42,7 +44,7 @@ class Resource(proto.Message): The full resource name of resource's parent. parent_display_name (str): The human readable name of resource's parent. - folders (Sequence[google.cloud.securitycenter_v1p1beta1.types.Folder]): + folders (MutableSequence[google.cloud.securitycenter_v1p1beta1.types.Folder]): Output only. Contains a Folder message for each folder in the assets ancestry. The first folder is the deepest nested folder, and the @@ -50,27 +52,27 @@ class Resource(proto.Message): Organization. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - project = proto.Field( + project: str = proto.Field( proto.STRING, number=2, ) - project_display_name = proto.Field( + project_display_name: str = proto.Field( proto.STRING, number=3, ) - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=4, ) - parent_display_name = proto.Field( + parent_display_name: str = proto.Field( proto.STRING, number=5, ) - folders = proto.RepeatedField( + folders: MutableSequence[folder.Folder] = proto.RepeatedField( proto.MESSAGE, number=7, message=folder.Folder, diff --git a/google/cloud/securitycenter_v1p1beta1/types/run_asset_discovery_response.py b/google/cloud/securitycenter_v1p1beta1/types/run_asset_discovery_response.py index e6532005..d12ee4f3 100644 --- a/google/cloud/securitycenter_v1p1beta1/types/run_asset_discovery_response.py +++ b/google/cloud/securitycenter_v1p1beta1/types/run_asset_discovery_response.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import duration_pb2 # type: ignore import proto # type: ignore @@ -42,12 +44,12 @@ class State(proto.Enum): SUPERSEDED = 2 TERMINATED = 3 - state = proto.Field( + state: State = proto.Field( proto.ENUM, number=1, enum=State, ) - duration = proto.Field( + duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=2, message=duration_pb2.Duration, diff --git a/google/cloud/securitycenter_v1p1beta1/types/security_marks.py b/google/cloud/securitycenter_v1p1beta1/types/security_marks.py index 741a59bd..8691afed 100644 --- a/google/cloud/securitycenter_v1p1beta1/types/security_marks.py +++ b/google/cloud/securitycenter_v1p1beta1/types/security_marks.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -37,7 +39,7 @@ class SecurityMarks(proto.Message): Examples: "organizations/{organization_id}/assets/{asset_id}/securityMarks" "organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks". - marks (Mapping[str, str]): + marks (MutableMapping[str, str]): Mutable user specified security marks belonging to the parent resource. Constraints are as follows: @@ -57,16 +59,16 @@ class SecurityMarks(proto.Message): "projects/{project_number}/sources/{source_id}/findings/{finding_id}/securityMarks". """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - marks = proto.MapField( + marks: MutableMapping[str, str] = proto.MapField( proto.STRING, proto.STRING, number=2, ) - canonical_name = proto.Field( + canonical_name: str = proto.Field( proto.STRING, number=3, ) diff --git a/google/cloud/securitycenter_v1p1beta1/types/securitycenter_service.py b/google/cloud/securitycenter_v1p1beta1/types/securitycenter_service.py index f85f57d7..6aa1545f 100644 --- a/google/cloud/securitycenter_v1p1beta1/types/securitycenter_service.py +++ b/google/cloud/securitycenter_v1p1beta1/types/securitycenter_service.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import struct_pb2 # type: ignore @@ -84,15 +86,15 @@ class CreateFindingRequest(proto.Message): fields on this resource. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - finding_id = proto.Field( + finding_id: str = proto.Field( proto.STRING, number=2, ) - finding = proto.Field( + finding: gcs_finding.Finding = proto.Field( proto.MESSAGE, number=3, message=gcs_finding.Finding, @@ -119,15 +121,15 @@ class CreateNotificationConfigRequest(proto.Message): on this resource. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - config_id = proto.Field( + config_id: str = proto.Field( proto.STRING, number=2, ) - notification_config = proto.Field( + notification_config: gcs_notification_config.NotificationConfig = proto.Field( proto.MESSAGE, number=3, message=gcs_notification_config.NotificationConfig, @@ -147,11 +149,11 @@ class CreateSourceRequest(proto.Message): ignored. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - source = proto.Field( + source: gcs_source.Source = proto.Field( proto.MESSAGE, number=2, message=gcs_source.Source, @@ -168,7 +170,7 @@ class DeleteNotificationConfigRequest(proto.Message): "organizations/[organization_id]/notificationConfigs/[config_id]". """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -184,7 +186,7 @@ class GetNotificationConfigRequest(proto.Message): "organizations/[organization_id]/notificationConfigs/[config_id]". """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -200,7 +202,7 @@ class GetOrganizationSettingsRequest(proto.Message): "organizations/[organization_id]/organizationSettings". """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -215,7 +217,7 @@ class GetSourceRequest(proto.Message): is "organizations/[organization_id]/source/[source_id]". """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -381,33 +383,33 @@ class GroupAssetsRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - group_by = proto.Field( + group_by: str = proto.Field( proto.STRING, number=3, ) - compare_duration = proto.Field( + compare_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=4, message=duration_pb2.Duration, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=7, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=8, ) @@ -417,7 +419,7 @@ class GroupAssetsResponse(proto.Message): r"""Response message for grouping by assets. Attributes: - group_by_results (Sequence[google.cloud.securitycenter_v1p1beta1.types.GroupResult]): + group_by_results (MutableSequence[google.cloud.securitycenter_v1p1beta1.types.GroupResult]): Group results. There exists an element for each existing unique combination of property/values. The element contains a count @@ -437,21 +439,21 @@ class GroupAssetsResponse(proto.Message): def raw_page(self): return self - group_by_results = proto.RepeatedField( + group_by_results: MutableSequence["GroupResult"] = proto.RepeatedField( proto.MESSAGE, number=1, message="GroupResult", ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=3, ) - total_size = proto.Field( + total_size: int = proto.Field( proto.INT32, number=4, ) @@ -606,33 +608,33 @@ class GroupFindingsRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - group_by = proto.Field( + group_by: str = proto.Field( proto.STRING, number=3, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, ) - compare_duration = proto.Field( + compare_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=5, message=duration_pb2.Duration, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=7, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=8, ) @@ -642,7 +644,7 @@ class GroupFindingsResponse(proto.Message): r"""Response message for group by findings. Attributes: - group_by_results (Sequence[google.cloud.securitycenter_v1p1beta1.types.GroupResult]): + group_by_results (MutableSequence[google.cloud.securitycenter_v1p1beta1.types.GroupResult]): Group results. There exists an element for each existing unique combination of property/values. The element contains a count @@ -662,21 +664,21 @@ class GroupFindingsResponse(proto.Message): def raw_page(self): return self - group_by_results = proto.RepeatedField( + group_by_results: MutableSequence["GroupResult"] = proto.RepeatedField( proto.MESSAGE, number=1, message="GroupResult", ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=3, ) - total_size = proto.Field( + total_size: int = proto.Field( proto.INT32, number=4, ) @@ -687,7 +689,7 @@ class GroupResult(proto.Message): request. Attributes: - properties (Mapping[str, google.protobuf.struct_pb2.Value]): + properties (MutableMapping[str, google.protobuf.struct_pb2.Value]): Properties matching the groupBy fields in the request. count (int): @@ -695,13 +697,13 @@ class GroupResult(proto.Message): properties. """ - properties = proto.MapField( + properties: MutableMapping[str, struct_pb2.Value] = proto.MapField( proto.STRING, proto.MESSAGE, number=1, message=struct_pb2.Value, ) - count = proto.Field( + count: int = proto.Field( proto.INT64, number=2, ) @@ -725,15 +727,15 @@ class ListNotificationConfigsRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=2, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=3, ) @@ -743,7 +745,7 @@ class ListNotificationConfigsResponse(proto.Message): r"""Response message for listing notification configs. Attributes: - notification_configs (Sequence[google.cloud.securitycenter_v1p1beta1.types.NotificationConfig]): + notification_configs (MutableSequence[google.cloud.securitycenter_v1p1beta1.types.NotificationConfig]): Notification configs belonging to the requested parent. next_page_token (str): @@ -755,12 +757,14 @@ class ListNotificationConfigsResponse(proto.Message): def raw_page(self): return self - notification_configs = proto.RepeatedField( + notification_configs: MutableSequence[ + gcs_notification_config.NotificationConfig + ] = proto.RepeatedField( proto.MESSAGE, number=1, message=gcs_notification_config.NotificationConfig, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -785,15 +789,15 @@ class ListSourcesRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=2, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=7, ) @@ -803,7 +807,7 @@ class ListSourcesResponse(proto.Message): r"""Response message for listing sources. Attributes: - sources (Sequence[google.cloud.securitycenter_v1p1beta1.types.Source]): + sources (MutableSequence[google.cloud.securitycenter_v1p1beta1.types.Source]): Sources belonging to the requested parent. next_page_token (str): Token to retrieve the next page of results, @@ -814,12 +818,12 @@ class ListSourcesResponse(proto.Message): def raw_page(self): return self - sources = proto.RepeatedField( + sources: MutableSequence[gcs_source.Source] = proto.RepeatedField( proto.MESSAGE, number=1, message=gcs_source.Source, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -986,38 +990,38 @@ class ListAssetsRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - order_by = proto.Field( + order_by: str = proto.Field( proto.STRING, number=3, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, ) - compare_duration = proto.Field( + compare_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=5, message=duration_pb2.Duration, ) - field_mask = proto.Field( + field_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=7, message=field_mask_pb2.FieldMask, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=8, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=9, ) @@ -1027,7 +1031,7 @@ class ListAssetsResponse(proto.Message): r"""Response message for listing assets. Attributes: - list_assets_results (Sequence[google.cloud.securitycenter_v1p1beta1.types.ListAssetsResponse.ListAssetsResult]): + list_assets_results (MutableSequence[google.cloud.securitycenter_v1p1beta1.types.ListAssetsResponse.ListAssetsResult]): Assets matching the list request. read_time (google.protobuf.timestamp_pb2.Timestamp): Time used for executing the list request. @@ -1063,12 +1067,12 @@ class StateChange(proto.Enum): REMOVED = 2 ACTIVE = 3 - asset = proto.Field( + asset: gcs_asset.Asset = proto.Field( proto.MESSAGE, number=1, message=gcs_asset.Asset, ) - state_change = proto.Field( + state_change: "ListAssetsResponse.ListAssetsResult.StateChange" = proto.Field( proto.ENUM, number=2, enum="ListAssetsResponse.ListAssetsResult.StateChange", @@ -1078,21 +1082,21 @@ class StateChange(proto.Enum): def raw_page(self): return self - list_assets_results = proto.RepeatedField( + list_assets_results: MutableSequence[ListAssetsResult] = proto.RepeatedField( proto.MESSAGE, number=1, message=ListAssetsResult, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=3, ) - total_size = proto.Field( + total_size: int = proto.Field( proto.INT32, number=4, ) @@ -1244,38 +1248,38 @@ class ListFindingsRequest(proto.Message): maximum is 1000. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - filter = proto.Field( + filter: str = proto.Field( proto.STRING, number=2, ) - order_by = proto.Field( + order_by: str = proto.Field( proto.STRING, number=3, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, ) - compare_duration = proto.Field( + compare_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=5, message=duration_pb2.Duration, ) - field_mask = proto.Field( + field_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=7, message=field_mask_pb2.FieldMask, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=8, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=9, ) @@ -1285,7 +1289,7 @@ class ListFindingsResponse(proto.Message): r"""Response message for listing findings. Attributes: - list_findings_results (Sequence[google.cloud.securitycenter_v1p1beta1.types.ListFindingsResponse.ListFindingsResult]): + list_findings_results (MutableSequence[google.cloud.securitycenter_v1p1beta1.types.ListFindingsResponse.ListFindingsResult]): Findings matching the list request. read_time (google.protobuf.timestamp_pb2.Timestamp): Time used for executing the list request. @@ -1345,50 +1349,52 @@ class Resource(proto.Message): The full resource name of resource's parent. parent_display_name (str): The human readable name of resource's parent. - folders (Sequence[google.cloud.securitycenter_v1p1beta1.types.Folder]): + folders (MutableSequence[google.cloud.securitycenter_v1p1beta1.types.Folder]): Contains a Folder message for each folder in the assets ancestry. The first folder is the deepest nested folder, and the last folder is the folder directly under the Organization. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - project_name = proto.Field( + project_name: str = proto.Field( proto.STRING, number=2, ) - project_display_name = proto.Field( + project_display_name: str = proto.Field( proto.STRING, number=3, ) - parent_name = proto.Field( + parent_name: str = proto.Field( proto.STRING, number=4, ) - parent_display_name = proto.Field( + parent_display_name: str = proto.Field( proto.STRING, number=5, ) - folders = proto.RepeatedField( + folders: MutableSequence[folder.Folder] = proto.RepeatedField( proto.MESSAGE, number=10, message=folder.Folder, ) - finding = proto.Field( + finding: gcs_finding.Finding = proto.Field( proto.MESSAGE, number=1, message=gcs_finding.Finding, ) - state_change = proto.Field( - proto.ENUM, - number=2, - enum="ListFindingsResponse.ListFindingsResult.StateChange", + state_change: "ListFindingsResponse.ListFindingsResult.StateChange" = ( + proto.Field( + proto.ENUM, + number=2, + enum="ListFindingsResponse.ListFindingsResult.StateChange", + ) ) - resource = proto.Field( + resource: "ListFindingsResponse.ListFindingsResult.Resource" = proto.Field( proto.MESSAGE, number=3, message="ListFindingsResponse.ListFindingsResult.Resource", @@ -1398,21 +1404,21 @@ class Resource(proto.Message): def raw_page(self): return self - list_findings_results = proto.RepeatedField( + list_findings_results: MutableSequence[ListFindingsResult] = proto.RepeatedField( proto.MESSAGE, number=1, message=ListFindingsResult, ) - read_time = proto.Field( + read_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=3, ) - total_size = proto.Field( + total_size: int = proto.Field( proto.INT32, number=4, ) @@ -1434,16 +1440,16 @@ class SetFindingStateRequest(proto.Message): takes effect. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - state = proto.Field( + state: gcs_finding.Finding.State = proto.Field( proto.ENUM, number=2, enum=gcs_finding.Finding.State, ) - start_time = proto.Field( + start_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, @@ -1460,7 +1466,7 @@ class RunAssetDiscoveryRequest(proto.Message): for. Its format is "organizations/[organization_id]". """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) @@ -1488,12 +1494,12 @@ class UpdateFindingRequest(proto.Message): "source_properties." in the field mask. """ - finding = proto.Field( + finding: gcs_finding.Finding = proto.Field( proto.MESSAGE, number=1, message=gcs_finding.Finding, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -1512,12 +1518,12 @@ class UpdateNotificationConfigRequest(proto.Message): If empty all mutable fields will be updated. """ - notification_config = proto.Field( + notification_config: gcs_notification_config.NotificationConfig = proto.Field( proto.MESSAGE, number=1, message=gcs_notification_config.NotificationConfig, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -1537,12 +1543,12 @@ class UpdateOrganizationSettingsRequest(proto.Message): If empty all mutable fields will be updated. """ - organization_settings = proto.Field( + organization_settings: gcs_organization_settings.OrganizationSettings = proto.Field( proto.MESSAGE, number=1, message=gcs_organization_settings.OrganizationSettings, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -1561,12 +1567,12 @@ class UpdateSourceRequest(proto.Message): If empty all mutable fields will be updated. """ - source = proto.Field( + source: gcs_source.Source = proto.Field( proto.MESSAGE, number=1, message=gcs_source.Source, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -1595,17 +1601,17 @@ class UpdateSecurityMarksRequest(proto.Message): preceding this time. """ - security_marks = proto.Field( + security_marks: gcs_security_marks.SecurityMarks = proto.Field( proto.MESSAGE, number=1, message=gcs_security_marks.SecurityMarks, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, ) - start_time = proto.Field( + start_time: timestamp_pb2.Timestamp = proto.Field( proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, diff --git a/google/cloud/securitycenter_v1p1beta1/types/source.py b/google/cloud/securitycenter_v1p1beta1/types/source.py index 82500c9b..2f0053cd 100644 --- a/google/cloud/securitycenter_v1p1beta1/types/source.py +++ b/google/cloud/securitycenter_v1p1beta1/types/source.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + import proto # type: ignore __protobuf__ = proto.module( @@ -61,19 +63,19 @@ class Source(proto.Message): the finding. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - description = proto.Field( + description: str = proto.Field( proto.STRING, number=3, ) - canonical_name = proto.Field( + canonical_name: str = proto.Field( proto.STRING, number=14, ) diff --git a/noxfile.py b/noxfile.py index ffe9f354..d8440c02 100644 --- a/noxfile.py +++ b/noxfile.py @@ -273,12 +273,16 @@ def cover(session): session.run("coverage", "erase") -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python="3.9") def docs(session): """Build the docs for this library.""" session.install("-e", ".") - session.install("sphinx==4.0.1", "alabaster", "recommonmark") + session.install( + "sphinx==4.0.1", + "alabaster", + "recommonmark", + ) shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( @@ -295,13 +299,16 @@ def docs(session): ) -@nox.session(python=DEFAULT_PYTHON_VERSION) +@nox.session(python="3.9") def docfx(session): """Build the docfx yaml files for this library.""" session.install("-e", ".") session.install( - "sphinx==4.0.1", "alabaster", "recommonmark", "gcp-sphinx-docfx-yaml" + "sphinx==4.0.1", + "alabaster", + "recommonmark", + "gcp-sphinx-docfx-yaml", ) shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) diff --git a/owlbot.py b/owlbot.py new file mode 100644 index 00000000..ce738f01 --- /dev/null +++ b/owlbot.py @@ -0,0 +1,56 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json +from pathlib import Path +import shutil + +import synthtool as s +import synthtool.gcp as gcp +from synthtool.languages import python + +# ---------------------------------------------------------------------------- +# Copy the generated client from the owl-bot staging directory +# ---------------------------------------------------------------------------- + +clean_up_generated_samples = True + +# Load the default version defined in .repo-metadata.json. +default_version = json.load(open(".repo-metadata.json", "rt")).get( + "default_version" +) + +for library in s.get_staging_dirs(default_version): + if clean_up_generated_samples: + shutil.rmtree("samples/generated_samples", ignore_errors=True) + clean_up_generated_samples = False + s.move([library], excludes=["**/gapic_version.py"]) +s.remove_staging_dirs() + +# ---------------------------------------------------------------------------- +# Add templated files +# ---------------------------------------------------------------------------- + +templated_files = gcp.CommonTemplates().py_library( + cov_level=100, + microgenerator=True, + versions=gcp.common.detect_versions(path="./google", default_first=True), +) +s.move(templated_files, excludes=[".coveragerc", ".github/release-please.yml"]) + +python.py_samples(skip_readmes=True) + +# run format session for all directories which have a noxfile +for noxfile in Path(".").glob("**/noxfile.py"): + s.shell.run(["nox", "-s", "format"], cwd=noxfile.parent, hide_output=False) diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..dba3e030 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,36 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "packages": { + ".": { + "release-type": "python", + "extra-files": [ + "google/cloud/securitycenter_v1beta1/gapic_version.py", + "google/cloud/securitycenter/gapic_version.py", + "google/cloud/securitycenter_v1p1beta1/gapic_version.py", + "google/cloud/securitycenter_v1/gapic_version.py", + { + "type": "json", + "path": "samples/generated_samples/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json", + "jsonpath": "$.clientLibrary.version" + }, + { + "type": "json", + "path": "samples/generated_samples/snippet_metadata_google.cloud.securitycenter.v1.json", + "jsonpath": "$.clientLibrary.version" + }, + { + "type": "json", + "path": "samples/generated_samples/snippet_metadata_google.cloud.securitycenter.v1beta1.json", + "jsonpath": "$.clientLibrary.version" + } + ] + } + }, + "release-type": "python", + "plugins": [ + { + "type": "sentence-case" + } + ], + "initial-version": "0.1.0" +} diff --git a/samples/generated_samples/securitycenter_v1_generated_security_center_bulk_mute_findings_async.py b/samples/generated_samples/securitycenter_v1_generated_security_center_bulk_mute_findings_async.py index bc9019eb..9f200964 100644 --- a/samples/generated_samples/securitycenter_v1_generated_security_center_bulk_mute_findings_async.py +++ b/samples/generated_samples/securitycenter_v1_generated_security_center_bulk_mute_findings_async.py @@ -48,7 +48,7 @@ async def sample_bulk_mute_findings(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/securitycenter_v1_generated_security_center_run_asset_discovery_async.py b/samples/generated_samples/securitycenter_v1_generated_security_center_run_asset_discovery_async.py index 2b9a1205..f46d5c97 100644 --- a/samples/generated_samples/securitycenter_v1_generated_security_center_run_asset_discovery_async.py +++ b/samples/generated_samples/securitycenter_v1_generated_security_center_run_asset_discovery_async.py @@ -48,7 +48,7 @@ async def sample_run_asset_discovery(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/securitycenter_v1beta1_generated_security_center_run_asset_discovery_async.py b/samples/generated_samples/securitycenter_v1beta1_generated_security_center_run_asset_discovery_async.py index 7e15623e..856c1087 100644 --- a/samples/generated_samples/securitycenter_v1beta1_generated_security_center_run_asset_discovery_async.py +++ b/samples/generated_samples/securitycenter_v1beta1_generated_security_center_run_asset_discovery_async.py @@ -48,7 +48,7 @@ async def sample_run_asset_discovery(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/securitycenter_v1p1beta1_generated_security_center_run_asset_discovery_async.py b/samples/generated_samples/securitycenter_v1p1beta1_generated_security_center_run_asset_discovery_async.py index 45938922..1f51b6eb 100644 --- a/samples/generated_samples/securitycenter_v1p1beta1_generated_security_center_run_asset_discovery_async.py +++ b/samples/generated_samples/securitycenter_v1p1beta1_generated_security_center_run_asset_discovery_async.py @@ -48,7 +48,7 @@ async def sample_run_asset_discovery(): print("Waiting for operation to complete...") - response = await operation.result() + response = (await operation).result() # Handle the response print(response) diff --git a/samples/generated_samples/snippet_metadata_securitycenter_v1.json b/samples/generated_samples/snippet_metadata_google.cloud.securitycenter.v1.json similarity index 99% rename from samples/generated_samples/snippet_metadata_securitycenter_v1.json rename to samples/generated_samples/snippet_metadata_google.cloud.securitycenter.v1.json index e964dec5..d82a9bce 100644 --- a/samples/generated_samples/snippet_metadata_securitycenter_v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.securitycenter.v1.json @@ -7,7 +7,8 @@ } ], "language": "PYTHON", - "name": "google-cloud-securitycenter" + "name": "google-cloud-securitycenter", + "version": "1.17.0" }, "snippets": [ { @@ -4447,7 +4448,7 @@ }, { "name": "permissions", - "type": "Sequence[str]" + "type": "MutableSequence[str]" }, { "name": "retry", @@ -4531,7 +4532,7 @@ }, { "name": "permissions", - "type": "Sequence[str]" + "type": "MutableSequence[str]" }, { "name": "retry", diff --git a/samples/generated_samples/snippet_metadata_securitycenter_v1beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.securitycenter.v1beta1.json similarity index 99% rename from samples/generated_samples/snippet_metadata_securitycenter_v1beta1.json rename to samples/generated_samples/snippet_metadata_google.cloud.securitycenter.v1beta1.json index 7407f068..c2408ad8 100644 --- a/samples/generated_samples/snippet_metadata_securitycenter_v1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.securitycenter.v1beta1.json @@ -7,7 +7,8 @@ } ], "language": "PYTHON", - "name": "google-cloud-securitycenter" + "name": "google-cloud-securitycenter", + "version": "1.17.0" }, "snippets": [ { @@ -2155,7 +2156,7 @@ }, { "name": "permissions", - "type": "Sequence[str]" + "type": "MutableSequence[str]" }, { "name": "retry", @@ -2239,7 +2240,7 @@ }, { "name": "permissions", - "type": "Sequence[str]" + "type": "MutableSequence[str]" }, { "name": "retry", diff --git a/samples/generated_samples/snippet_metadata_securitycenter_v1p1beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json similarity index 99% rename from samples/generated_samples/snippet_metadata_securitycenter_v1p1beta1.json rename to samples/generated_samples/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json index 5b30fbf8..0e74a4ad 100644 --- a/samples/generated_samples/snippet_metadata_securitycenter_v1p1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json @@ -7,7 +7,8 @@ } ], "language": "PYTHON", - "name": "google-cloud-securitycenter" + "name": "google-cloud-securitycenter", + "version": "1.17.0" }, "snippets": [ { @@ -2825,7 +2826,7 @@ }, { "name": "permissions", - "type": "Sequence[str]" + "type": "MutableSequence[str]" }, { "name": "retry", @@ -2909,7 +2910,7 @@ }, { "name": "permissions", - "type": "Sequence[str]" + "type": "MutableSequence[str]" }, { "name": "retry", diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index c1715136..05770846 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -18,7 +18,7 @@ import os from pathlib import Path import sys -from typing import Callable, Dict, List, Optional +from typing import Callable, Dict, Optional import nox @@ -108,22 +108,6 @@ def get_pytest_env_vars() -> Dict[str, str]: # -def _determine_local_import_names(start_dir: str) -> List[str]: - """Determines all import names that should be considered "local". - - This is used when running the linter to insure that import order is - properly checked. - """ - file_ext_pairs = [os.path.splitext(path) for path in os.listdir(start_dir)] - return [ - basename - for basename, extension in file_ext_pairs - if extension == ".py" - or os.path.isdir(os.path.join(start_dir, basename)) - and basename not in ("__pycache__") - ] - - # Linting with flake8. # # We ignore the following rules: @@ -138,7 +122,6 @@ def _determine_local_import_names(start_dir: str) -> List[str]: "--show-source", "--builtin=gettext", "--max-complexity=20", - "--import-order-style=google", "--exclude=.nox,.cache,env,lib,generated_pb2,*_pb2.py,*_pb2_grpc.py", "--ignore=E121,E123,E126,E203,E226,E24,E266,E501,E704,W503,W504,I202", "--max-line-length=88", @@ -148,14 +131,11 @@ def _determine_local_import_names(start_dir: str) -> List[str]: @nox.session def lint(session: nox.sessions.Session) -> None: if not TEST_CONFIG["enforce_type_hints"]: - session.install("flake8", "flake8-import-order") + session.install("flake8") else: - session.install("flake8", "flake8-import-order", "flake8-annotations") + session.install("flake8", "flake8-annotations") - local_names = _determine_local_import_names(".") args = FLAKE8_COMMON_ARGS + [ - "--application-import-names", - ",".join(local_names), ".", ] session.run("flake8", *args) diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index fc11ba8d..0e06879c 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1,2 +1,2 @@ -pytest==7.1.3 -google-cloud-bigquery==3.3.3 +pytest==7.2.0 +google-cloud-bigquery==3.4.1 diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 4724ca00..851db1a3 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-pubsub==2.13.7 -google-cloud-securitycenter==1.16.1 \ No newline at end of file +google-cloud-pubsub==2.13.11 +google-cloud-securitycenter==1.16.2 \ No newline at end of file diff --git a/samples/snippets/snippets_notification_configs.py b/samples/snippets/snippets_notification_configs.py index 4d615276..6cc82dd8 100644 --- a/samples/snippets/snippets_notification_configs.py +++ b/samples/snippets/snippets_notification_configs.py @@ -16,23 +16,26 @@ """Demos for working with notification configs.""" -def create_notification_config(organization_id, notification_config_id, pubsub_topic): - - # [START securitycenter_create_notification_config] +# [START securitycenter_create_notification_config] +def create_notification_config(parent_id, notification_config_id, pubsub_topic): + """ + Args: + parent_id: must be in one of the following formats: + "organizations/{organization_id}" + "projects/{project_id}" + "folders/{folder_id}" + notification_config_id: "your-config-id" + pubsub_topic: "projects/{your-project-id}/topics/{your-topic-ic}" + + Ensure this ServiceAccount has the "pubsub.topics.setIamPolicy" permission on the new topic. + """ from google.cloud import securitycenter as securitycenter client = securitycenter.SecurityCenterClient() - # TODO: organization_id = "your-org-id" - # TODO: notification_config_id = "your-config-id" - # TODO: pubsub_topic = "projects/{your-project-id}/topics/{your-topic-ic}" - # Ensure this ServiceAccount has the "pubsub.topics.setIamPolicy" permission on the new topic. - - org_name = "organizations/{org_id}".format(org_id=organization_id) - created_notification_config = client.create_notification_config( request={ - "parent": org_name, + "parent": parent_id, "config_id": notification_config_id, "notification_config": { "description": "Notification for active findings", @@ -47,88 +50,99 @@ def create_notification_config(organization_id, notification_config_id, pubsub_t return created_notification_config -def delete_notification_config(organization_id, notification_config_id): - - # [START securitycenter_delete_notification_config] +# [START securitycenter_delete_notification_config] +def delete_notification_config(parent_id, notification_config_id): + """ + Args: + parent_id: must be in one of the following formats: + "organizations/{organization_id}" + "projects/{project_id}" + "folders/{folder_id}" + notification_config_id: "your-config-id" + """ from google.cloud import securitycenter as securitycenter client = securitycenter.SecurityCenterClient() - # TODO: organization_id = "your-org-id" - # TODO: notification_config_id = "your-config-id" - notification_config_name = ( - "organizations/{org_id}/notificationConfigs/{config_id}".format( - org_id=organization_id, config_id=notification_config_id - ) + f"{parent_id}/notificationConfigs/{notification_config_id}" ) client.delete_notification_config(request={"name": notification_config_name}) - print("Deleted notification config: {}".format(notification_config_name)) + print(f"Deleted notification config: {notification_config_name}") # [END securitycenter_delete_notification_config] return True -def get_notification_config(organization_id, notification_config_id): - - # [START securitycenter_get_notification_config] +# [START securitycenter_get_notification_config] +def get_notification_config(parent_id, notification_config_id): + """ + Args: + parent_id: must be in one of the following formats: + "organizations/{organization_id}" + "projects/{project_id}" + "folders/{folder_id}" + notification_config_id: "your-config-id" + """ from google.cloud import securitycenter as securitycenter client = securitycenter.SecurityCenterClient() - # TODO: organization_id = "your-org-id" - # TODO: notification_config_id = "your-config-id" - notification_config_name = ( - "organizations/{org_id}/notificationConfigs/{config_id}".format( - org_id=organization_id, config_id=notification_config_id - ) + f"{parent_id}/notificationConfigs/{notification_config_id}" ) notification_config = client.get_notification_config( request={"name": notification_config_name} ) - print("Got notification config: {}".format(notification_config)) + print(f"Got notification config: {notification_config}") # [END securitycenter_get_notification_config] return notification_config -def list_notification_configs(organization_id): - - # [START securitycenter_list_notification_configs] +# [START securitycenter_list_notification_configs] +def list_notification_configs(parent_id): + """ + Args: + parent_id: must be in one of the following formats: + "organizations/{organization_id}" + "projects/{project_id}" + "folders/{folder_id}" + """ from google.cloud import securitycenter as securitycenter client = securitycenter.SecurityCenterClient() - # TODO: organization_id = "your-org-id" - org_name = "organizations/{org_id}".format(org_id=organization_id) - notification_configs_iterator = client.list_notification_configs( - request={"parent": org_name} + request={"parent": parent_id} ) for i, config in enumerate(notification_configs_iterator): - print("{}: notification_config: {}".format(i, config)) + print(f"{i}: notification_config: {config}") # [END securitycenter_list_notification_configs]] return notification_configs_iterator -def update_notification_config(organization_id, notification_config_id, pubsub_topic): - # [START securitycenter_update_notification_config] +# [START securitycenter_update_notification_config] +def update_notification_config(parent_id, notification_config_id, pubsub_topic): + """ + Args: + parent_id: must be in one of the following formats: + "organizations/{organization_id}" + "projects/{project_id}" + "folders/{folder_id}" + notification_config_id: "config-id-to-update" + pubsub_topic: "projects/{new-project}/topics/{new-topic}" + + If updating a pubsub_topic, ensure this ServiceAccount has the + "pubsub.topics.setIamPolicy" permission on the new topic. + """ from google.cloud import securitycenter as securitycenter from google.protobuf import field_mask_pb2 client = securitycenter.SecurityCenterClient() - # TODO organization_id = "your-org-id" - # TODO notification_config_id = "config-id-to-update" - # TODO pubsub_topic = "projects/{new-project}/topics/{new-topic}" - # If updating a pubsub_topic, ensure this ServiceAccount has the - # "pubsub.topics.setIamPolicy" permission on the new topic. - notification_config_name = ( - "organizations/{org_id}/notificationConfigs/{config_id}".format( - org_id=organization_id, config_id=notification_config_id - ) + f"{parent_id}/notificationConfigs/{notification_config_id}" ) updated_description = "New updated description" diff --git a/samples/snippets/snippets_notification_test.py b/samples/snippets/snippets_notification_test.py index 93324e29..2cc6d262 100644 --- a/samples/snippets/snippets_notification_test.py +++ b/samples/snippets/snippets_notification_test.py @@ -111,7 +111,7 @@ def deleted_notification_config(): def test_create_notification_config(): created_notification_config = ( snippets_notification_configs.create_notification_config( - ORG_ID, CREATE_CONFIG_ID, PUBSUB_TOPIC + f"organizations/{ORG_ID}", CREATE_CONFIG_ID, PUBSUB_TOPIC ) ) assert created_notification_config is not None @@ -121,25 +121,27 @@ def test_create_notification_config(): def test_delete_notification_config(deleted_notification_config): assert snippets_notification_configs.delete_notification_config( - ORG_ID, DELETE_CONFIG_ID + f"organizations/{ORG_ID}", DELETE_CONFIG_ID ) def test_get_notification_config(new_notification_config_for_get): retrieved_config = snippets_notification_configs.get_notification_config( - ORG_ID, GET_CONFIG_ID + f"organizations/{ORG_ID}", GET_CONFIG_ID ) assert retrieved_config is not None def test_list_notification_configs(): - iterator = snippets_notification_configs.list_notification_configs(ORG_ID) + iterator = snippets_notification_configs.list_notification_configs( + f"organizations/{ORG_ID}" + ) assert iterator is not None def test_update_notification_config(new_notification_config_for_update): updated_config = snippets_notification_configs.update_notification_config( - ORG_ID, UPDATE_CONFIG_ID, PUBSUB_TOPIC + f"organizations/{ORG_ID}", UPDATE_CONFIG_ID, PUBSUB_TOPIC ) assert updated_config is not None diff --git a/securitycenter-v1-py.tar.gz b/securitycenter-v1-py.tar.gz new file mode 100644 index 00000000..23c452a7 Binary files /dev/null and b/securitycenter-v1-py.tar.gz differ diff --git a/setup.py b/setup.py index 22c7c4d6..9e4af075 100644 --- a/setup.py +++ b/setup.py @@ -1,35 +1,49 @@ # -*- coding: utf-8 -*- -# -# Copyright 2018 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# https://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - +# import io import os -import setuptools +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) name = "google-cloud-securitycenter" -description = "Cloud Security Command Center API client library" -version = "1.16.2" -release_status = "Development Status :: 5 - Production/Stable" + + +description = "Google Cloud Securitycenter API client library" + +version = {} +with open( + os.path.join(package_root, "google/cloud/securitycenter/gapic_version.py") +) as fp: + exec(fp.read(), version) +version = version["__version__"] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + dependencies = [ - "google-api-core[grpc] >= 1.32.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", - "grpc-google-iam-v1 >= 0.12.4, <1.0.0dev", + "google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*", "proto-plus >= 1.22.0, <2.0.0dev", "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", + "grpc-google-iam-v1 >= 0.12.4, < 1.0.0dev", ] -extras = {"libcst": "libcst >= 0.2.5"} +url = "https://github.com/googleapis/python-securitycenter" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -55,7 +69,7 @@ author="Google LLC", author_email="googleapis-packages@google.com", license="Apache 2.0", - url="https://github.com/googleapis/python-securitycenter", + url=url, classifiers=[ release_status, "Intended Audience :: Developers", @@ -71,15 +85,9 @@ ], platforms="Posix; MacOS X; Windows", packages=packages, + python_requires=">=3.7", namespace_packages=namespaces, install_requires=dependencies, - extras_require=extras, - python_requires=">=3.7", - scripts=[ - "scripts/fixup_securitycenter_v1_keywords.py", - "scripts/fixup_securitycenter_v1beta1_keywords.py", - "scripts/fixup_securitycenter_v1p1beta1_keywords.py", - ], include_package_data=True, zip_safe=False, ) diff --git a/testing/constraints-3.10.txt b/testing/constraints-3.10.txt index e69de29b..ad3f0fa5 100644 --- a/testing/constraints-3.10.txt +++ b/testing/constraints-3.10.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +grpc-google-iam-v1 diff --git a/testing/constraints-3.11.txt b/testing/constraints-3.11.txt index e69de29b..ad3f0fa5 100644 --- a/testing/constraints-3.11.txt +++ b/testing/constraints-3.11.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +grpc-google-iam-v1 diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt index 90f4b6d9..2beecf99 100644 --- a/testing/constraints-3.7.txt +++ b/testing/constraints-3.7.txt @@ -1,12 +1,10 @@ # This constraints file is used to check that lower bounds # are correct in setup.py -# List *all* library dependencies and extras in this file. +# List all library dependencies and extras in this file. # Pin the version to the lower bound. -# -# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", -# Then this file should have foo==1.14.0 -google-api-core==1.32.0 -grpc-google-iam-v1==0.12.4 +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.34.0 proto-plus==1.22.0 -libcst==0.2.5 protobuf==3.19.5 +grpc-google-iam-v1==0.12.4 diff --git a/testing/constraints-3.8.txt b/testing/constraints-3.8.txt index e69de29b..ad3f0fa5 100644 --- a/testing/constraints-3.8.txt +++ b/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +grpc-google-iam-v1 diff --git a/testing/constraints-3.9.txt b/testing/constraints-3.9.txt index e69de29b..ad3f0fa5 100644 --- a/testing/constraints-3.9.txt +++ b/testing/constraints-3.9.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +grpc-google-iam-v1 diff --git a/tests/unit/gapic/securitycenter_v1/test_security_center.py b/tests/unit/gapic/securitycenter_v1/test_security_center.py index 4b0cb12d..24c11f6a 100644 --- a/tests/unit/gapic/securitycenter_v1/test_security_center.py +++ b/tests/unit/gapic/securitycenter_v1/test_security_center.py @@ -45,6 +45,7 @@ from google.longrunning import operations_pb2 from google.oauth2 import service_account from google.protobuf import duration_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import struct_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -74,6 +75,7 @@ from google.cloud.securitycenter_v1.types import ( iam_binding, indicator, + kernel_rootkit, kubernetes, label, mitre_attack, diff --git a/tests/unit/gapic/securitycenter_v1beta1/test_security_center.py b/tests/unit/gapic/securitycenter_v1beta1/test_security_center.py index e8948d08..5ff8b98e 100644 --- a/tests/unit/gapic/securitycenter_v1beta1/test_security_center.py +++ b/tests/unit/gapic/securitycenter_v1beta1/test_security_center.py @@ -45,6 +45,7 @@ from google.longrunning import operations_pb2 from google.oauth2 import service_account from google.protobuf import duration_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import struct_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore diff --git a/tests/unit/gapic/securitycenter_v1p1beta1/test_security_center.py b/tests/unit/gapic/securitycenter_v1p1beta1/test_security_center.py index 7299e89f..0607814f 100644 --- a/tests/unit/gapic/securitycenter_v1p1beta1/test_security_center.py +++ b/tests/unit/gapic/securitycenter_v1p1beta1/test_security_center.py @@ -45,6 +45,7 @@ from google.longrunning import operations_pb2 from google.oauth2 import service_account from google.protobuf import duration_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import struct_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore