Skip to content
This repository was archived by the owner on Oct 16, 2023. It is now read-only.

Commit 07a2025

Browse files
gcf-owl-bot[bot]partheaSita04
authored
feat: Add client for IAM Deny v2 API (#230)
* feat: Create the public IAM Deny v2 API PiperOrigin-RevId: 470600752 Source-Link: googleapis/googleapis@dac66f6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/729529edc103e45087ffae8353eaf009ad7fe8c2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzI5NTI5ZWRjMTAzZTQ1MDg3ZmZhZTgzNTNlYWYwMDlhZDdmZThjMiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * regenerate files using cl/470713093 * workaround docstring formatting issue * add pytest to samples CI * lint * fix import statement in samples/snippets * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs(samples): migrate samples from iam_v2beta to iam_v2 * update required checks to include samples * use GOOGLE_CLOUD_PROJECT * fix imports in samples/snippets * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add pytest * chore(python): prepare for release of the iam/v2 python client PiperOrigin-RevId: 471240188 Source-Link: googleapis/googleapis@ea847a1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/6f1e4cd013ab2914773826e68b2a2d0763030a39 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmYxZTRjZDAxM2FiMjkxNDc3MzgyNmU2OGIyYTJkMDc2MzAzMGEzOSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: Bump gapic-generator-python version to 1.3.0 PiperOrigin-RevId: 472561635 Source-Link: googleapis/googleapis@332ecf5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4313d682880fd9d7247291164d4e9d3d5bd9f177 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDMxM2Q2ODI4ODBmZDlkNzI0NzI5MTE2NGQ0ZTlkM2Q1YmQ5ZjE3NyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: use gapic-generator-python 1.3.1 PiperOrigin-RevId: 472772457 Source-Link: googleapis/googleapis@855b74d Source-Link: https://github.com/googleapis/googleapis-gen/commit/b64b1e7da3e138f15ca361552ef0545e54891b4f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjY0YjFlN2RhM2UxMzhmMTVjYTM2MTU1MmVmMDU0NWU1NDg5MWI0ZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: integrate gapic-generator-python-1.4.1 and enable more py_test targets PiperOrigin-RevId: 473833416 Source-Link: googleapis/googleapis@565a550 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1ee1a06c6de3ca8b843572c1fde0548f84236989 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWVlMWEwNmM2ZGUzY2E4Yjg0MzU3MmMxZmRlMDU0OGY4NDIzNjk4OSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * updated test to delete stale policies and avoid quota error * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat!: remove ListApplicablePolicies PiperOrigin-RevId: 475955031 Source-Link: googleapis/googleapis@65376f4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c8504e97891ed9e664cf68270d7e61bec160fe57 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzg1MDRlOTc4OTFlZDllNjY0Y2Y2ODI3MGQ3ZTYxYmVjMTYwZmU1NyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * samples: wait for the operation to complete * samples: minor refactoring * use project `python-docs-samples-tests` Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]> Co-authored-by: Sita Lakshmi Sangameswaran <[email protected]> Co-authored-by: SitaLakshmi <[email protected]>
1 parent 96b63f4 commit 07a2025

File tree

74 files changed

+9134
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+9134
-231
lines changed

.github/sync-repo-settings.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# https://github.com/googleapis/repo-automation-bots/tree/main/packages/sync-repo-settings
2+
# Rules for main branch protection
3+
branchProtectionRules:
4+
# Identifies the protection rule pattern. Name of the branch to be protected.
5+
# Defaults to `main`
6+
- pattern: main
7+
requiresCodeOwnerReviews: true
8+
requiresStrictStatusChecks: true
9+
requiredStatusCheckContexts:
10+
- 'cla/google'
11+
- 'OwlBot Post Processor'
12+
- 'docs'
13+
- 'docfx'
14+
- 'lint'
15+
- 'unit (3.6)'
16+
- 'unit (3.7)'
17+
- 'unit (3.8)'
18+
- 'unit (3.9)'
19+
- 'unit (3.10)'
20+
- 'cover'
21+
- 'Samples - Lint'
22+
- 'Samples - Python 3.7'
23+
- 'Samples - Python 3.8'
24+
- 'Samples - Python 3.9'
25+
- 'Samples - Python 3.10'
26+
permissionRules:
27+
- team: actools-python
28+
permission: admin
29+
- team: actools
30+
permission: admin
31+
- team: yoshi-python
32+
permission: push
33+
- team: python-samples-owners
34+
permission: push
35+
- team: python-samples-reviewers
36+
permission: push

docs/iam_v2/policies.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Policies
2+
--------------------------
3+
4+
.. automodule:: google.cloud.iam_v2.services.policies
5+
:members:
6+
:inherited-members:
7+
8+
.. automodule:: google.cloud.iam_v2.services.policies.pagers
9+
:members:
10+
:inherited-members:

docs/iam_v2/services.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Services for Google Cloud Iam v2 API
2+
====================================
3+
.. toctree::
4+
:maxdepth: 2
5+
6+
policies

docs/iam_v2/types.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Types for Google Cloud Iam v2 API
2+
=================================
3+
4+
.. automodule:: google.cloud.iam_v2.types
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

docs/index.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
.. include:: multiprocessing.rst
44

5-
This package includes clients for multiple versions of Cloud Identity and Access Management.
6-
By default, you will get version ``iam_credentials_v1``.
75

6+
API Reference
7+
-------------
8+
.. toctree::
9+
:maxdepth: 2
10+
11+
iam_v2/services
12+
iam_v2/types
813

914
API Reference
1015
-------------
@@ -22,7 +27,6 @@ API Reference
2227
iam_v2beta/services
2328
iam_v2beta/types
2429

25-
2630
Migration Guide
2731
---------------
2832

google/cloud/iam_credentials_v1/services/iam_credentials/async_client.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,13 @@ async def generate_access_token(
234234
235235
.. code-block:: python
236236
237+
# This snippet has been automatically generated and should be regarded as a
238+
# code template only.
239+
# It will require modifications to work:
240+
# - It may require correct/in-range values for request initialization.
241+
# - It may require specifying regional endpoints when creating the service
242+
# client as shown in:
243+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
237244
from google.cloud import iam_credentials_v1
238245
239246
async def sample_generate_access_token():
@@ -243,7 +250,7 @@ async def sample_generate_access_token():
243250
# Initialize request argument(s)
244251
request = iam_credentials_v1.GenerateAccessTokenRequest(
245252
name="name_value",
246-
scope=['scope_value_1', 'scope_value_2'],
253+
scope=['scope_value1', 'scope_value2'],
247254
)
248255
249256
# Make the request
@@ -391,6 +398,13 @@ async def generate_id_token(
391398
392399
.. code-block:: python
393400
401+
# This snippet has been automatically generated and should be regarded as a
402+
# code template only.
403+
# It will require modifications to work:
404+
# - It may require correct/in-range values for request initialization.
405+
# - It may require specifying regional endpoints when creating the service
406+
# client as shown in:
407+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
394408
from google.cloud import iam_credentials_v1
395409
396410
async def sample_generate_id_token():
@@ -541,6 +555,13 @@ async def sign_blob(
541555
542556
.. code-block:: python
543557
558+
# This snippet has been automatically generated and should be regarded as a
559+
# code template only.
560+
# It will require modifications to work:
561+
# - It may require correct/in-range values for request initialization.
562+
# - It may require specifying regional endpoints when creating the service
563+
# client as shown in:
564+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
544565
from google.cloud import iam_credentials_v1
545566
546567
async def sample_sign_blob():
@@ -678,6 +699,13 @@ async def sign_jwt(
678699
679700
.. code-block:: python
680701
702+
# This snippet has been automatically generated and should be regarded as a
703+
# code template only.
704+
# It will require modifications to work:
705+
# - It may require correct/in-range values for request initialization.
706+
# - It may require specifying regional endpoints when creating the service
707+
# client as shown in:
708+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
681709
from google.cloud import iam_credentials_v1
682710
683711
async def sample_sign_jwt():

google/cloud/iam_credentials_v1/services/iam_credentials/client.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,13 @@ def generate_access_token(
455455
456456
.. code-block:: python
457457
458+
# This snippet has been automatically generated and should be regarded as a
459+
# code template only.
460+
# It will require modifications to work:
461+
# - It may require correct/in-range values for request initialization.
462+
# - It may require specifying regional endpoints when creating the service
463+
# client as shown in:
464+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
458465
from google.cloud import iam_credentials_v1
459466
460467
def sample_generate_access_token():
@@ -464,7 +471,7 @@ def sample_generate_access_token():
464471
# Initialize request argument(s)
465472
request = iam_credentials_v1.GenerateAccessTokenRequest(
466473
name="name_value",
467-
scope=['scope_value_1', 'scope_value_2'],
474+
scope=['scope_value1', 'scope_value2'],
468475
)
469476
470477
# Make the request
@@ -602,6 +609,13 @@ def generate_id_token(
602609
603610
.. code-block:: python
604611
612+
# This snippet has been automatically generated and should be regarded as a
613+
# code template only.
614+
# It will require modifications to work:
615+
# - It may require correct/in-range values for request initialization.
616+
# - It may require specifying regional endpoints when creating the service
617+
# client as shown in:
618+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
605619
from google.cloud import iam_credentials_v1
606620
607621
def sample_generate_id_token():
@@ -742,6 +756,13 @@ def sign_blob(
742756
743757
.. code-block:: python
744758
759+
# This snippet has been automatically generated and should be regarded as a
760+
# code template only.
761+
# It will require modifications to work:
762+
# - It may require correct/in-range values for request initialization.
763+
# - It may require specifying regional endpoints when creating the service
764+
# client as shown in:
765+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
745766
from google.cloud import iam_credentials_v1
746767
747768
def sample_sign_blob():
@@ -869,6 +890,13 @@ def sign_jwt(
869890
870891
.. code-block:: python
871892
893+
# This snippet has been automatically generated and should be regarded as a
894+
# code template only.
895+
# It will require modifications to work:
896+
# - It may require correct/in-range values for request initialization.
897+
# - It may require specifying regional endpoints when creating the service
898+
# client as shown in:
899+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
872900
from google.cloud import iam_credentials_v1
873901
874902
def sample_sign_jwt():

google/cloud/iam_v2/__init__.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
from .services.policies import PoliciesAsyncClient, PoliciesClient
18+
from .types.deny import DenyRule
19+
from .types.policy import (
20+
CreatePolicyRequest,
21+
DeletePolicyRequest,
22+
GetPolicyRequest,
23+
ListPoliciesRequest,
24+
ListPoliciesResponse,
25+
Policy,
26+
PolicyOperationMetadata,
27+
PolicyRule,
28+
UpdatePolicyRequest,
29+
)
30+
31+
__all__ = (
32+
"PoliciesAsyncClient",
33+
"CreatePolicyRequest",
34+
"DeletePolicyRequest",
35+
"DenyRule",
36+
"GetPolicyRequest",
37+
"ListPoliciesRequest",
38+
"ListPoliciesResponse",
39+
"PoliciesClient",
40+
"Policy",
41+
"PolicyOperationMetadata",
42+
"PolicyRule",
43+
"UpdatePolicyRequest",
44+
)
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{
2+
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
3+
"language": "python",
4+
"libraryPackage": "google.cloud.iam_v2",
5+
"protoPackage": "google.iam.v2",
6+
"schema": "1.0",
7+
"services": {
8+
"Policies": {
9+
"clients": {
10+
"grpc": {
11+
"libraryClient": "PoliciesClient",
12+
"rpcs": {
13+
"CreatePolicy": {
14+
"methods": [
15+
"create_policy"
16+
]
17+
},
18+
"DeletePolicy": {
19+
"methods": [
20+
"delete_policy"
21+
]
22+
},
23+
"GetPolicy": {
24+
"methods": [
25+
"get_policy"
26+
]
27+
},
28+
"ListPolicies": {
29+
"methods": [
30+
"list_policies"
31+
]
32+
},
33+
"UpdatePolicy": {
34+
"methods": [
35+
"update_policy"
36+
]
37+
}
38+
}
39+
},
40+
"grpc-async": {
41+
"libraryClient": "PoliciesAsyncClient",
42+
"rpcs": {
43+
"CreatePolicy": {
44+
"methods": [
45+
"create_policy"
46+
]
47+
},
48+
"DeletePolicy": {
49+
"methods": [
50+
"delete_policy"
51+
]
52+
},
53+
"GetPolicy": {
54+
"methods": [
55+
"get_policy"
56+
]
57+
},
58+
"ListPolicies": {
59+
"methods": [
60+
"list_policies"
61+
]
62+
},
63+
"UpdatePolicy": {
64+
"methods": [
65+
"update_policy"
66+
]
67+
}
68+
}
69+
}
70+
}
71+
}
72+
}
73+
}

google/cloud/iam_v2/py.typed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Marker file for PEP 561.
2+
# The google-cloud-iam package uses inline types.

0 commit comments

Comments
 (0)