Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
docs: added resource annotations (#161)
Browse files Browse the repository at this point in the history
* docs: added resource annotations
feat: added flag for implicit dismissal for `DismissDecision`

PiperOrigin-RevId: 427766265

Source-Link: googleapis/googleapis@5556c91

Source-Link: googleapis/googleapis-gen@d03fa03
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDAzZmEwM2IyMTc0NjI3ODRkNmJhMzJjY2RkZTRkZmUwYzA2ZjAxNyJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: use gapic-generator-python 0.63.2
docs: add generated snippets

PiperOrigin-RevId: 427792504

Source-Link: googleapis/googleapis@55b9e1e

Source-Link: googleapis/googleapis-gen@bf4e86b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Feb 17, 2022
1 parent 8ca51b3 commit de63e9e
Show file tree
Hide file tree
Showing 21 changed files with 273 additions and 126 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ class AccessApprovalAsyncClient:
- The API has a collection of
[ApprovalRequest][google.cloud.accessapproval.v1.ApprovalRequest]
resources, named ``approvalRequests/{approval_request_id}``
resources, named ``approvalRequests/{approval_request}``
- The API has top-level settings per Project/Folder/Organization,
named ``accessApprovalSettings``
The service also periodically emails a list of recipients, defined
at the Project/Folder/Organization level in the
accessApprovalSettings, when there is a pending ApprovalRequest for
them to act on. The ApprovalRequests can also optionally be
published to a Cloud Pub/Sub topic owned by the customer (for Beta,
the Pub/Sub setup is managed manually).
published to a Pub/Sub topic owned by the customer (contact support
if you would like to enable Pub/Sub notifications).
ApprovalRequests can be approved or dismissed. Google personel can
ApprovalRequests can be approved or dismissed. Google personnel can
only access the indicated resource or resources if the request is
approved (subject to some exclusions:
https://cloud.google.com/access-approval/docs/overview#exclusions).
Expand All @@ -83,6 +83,16 @@ class AccessApprovalAsyncClient:
DEFAULT_ENDPOINT = AccessApprovalClient.DEFAULT_ENDPOINT
DEFAULT_MTLS_ENDPOINT = AccessApprovalClient.DEFAULT_MTLS_ENDPOINT

access_approval_settings_path = staticmethod(
AccessApprovalClient.access_approval_settings_path
)
parse_access_approval_settings_path = staticmethod(
AccessApprovalClient.parse_access_approval_settings_path
)
approval_request_path = staticmethod(AccessApprovalClient.approval_request_path)
parse_approval_request_path = staticmethod(
AccessApprovalClient.parse_approval_request_path
)
common_billing_account_path = staticmethod(
AccessApprovalClient.common_billing_account_path
)
Expand Down Expand Up @@ -266,6 +276,8 @@ def sample_list_approval_requests():
# Make the request
page_result = client.list_approval_requests(request=request)
# Handle the response
for response in page_result:
print(response)
Expand All @@ -274,8 +286,9 @@ def sample_list_approval_requests():
The request object. Request to list approval requests.
parent (:class:`str`):
The parent resource. This may be
"projects/{project_id}", "folders/{folder_id}", or
"organizations/{organization_id}".
"projects/{project}",
"folders/{folder}", or
"organizations/{organization}".
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -375,15 +388,15 @@ def sample_get_approval_request():
# Make the request
response = client.get_approval_request(request=request)
# Handle response
# Handle the response
print(response)
Args:
request (Union[google.cloud.accessapproval_v1.types.GetApprovalRequestMessage, dict]):
The request object. Request to get an approval request.
name (:class:`str`):
Name of the approval request to
retrieve.
The name of the approval request to retrieve. Format:
"{projects|folders|organizations}/{id}/approvalRequests/{approval_request}"
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -476,7 +489,7 @@ def sample_approve_approval_request():
# Make the request
response = client.approve_approval_request(request=request)
# Handle response
# Handle the response
print(response)
Args:
Expand Down Expand Up @@ -553,7 +566,7 @@ def sample_dismiss_approval_request():
# Make the request
response = client.dismiss_approval_request(request=request)
# Handle response
# Handle the response
print(response)
Args:
Expand Down Expand Up @@ -623,16 +636,17 @@ def sample_get_access_approval_settings():
# Make the request
response = client.get_access_approval_settings(request=request)
# Handle response
# Handle the response
print(response)
Args:
request (Union[google.cloud.accessapproval_v1.types.GetAccessApprovalSettingsMessage, dict]):
The request object. Request to get access approval
settings.
name (:class:`str`):
Name of the AccessApprovalSettings to
retrieve.
The name of the AccessApprovalSettings to retrieve.
Format:
"{projects|folders|organizations}/{id}/accessApprovalSettings"
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -726,7 +740,7 @@ def sample_update_access_approval_settings():
# Make the request
response = client.update_access_approval_settings(request=request)
# Handle response
# Handle the response
print(response)
Args:
Expand Down Expand Up @@ -840,7 +854,7 @@ def sample_delete_access_approval_settings():
)
# Make the request
response = client.delete_access_approval_settings(request=request)
client.delete_access_approval_settings(request=request)
Args:
request (Union[google.cloud.accessapproval_v1.types.DeleteAccessApprovalSettingsMessage, dict]):
Expand Down
63 changes: 47 additions & 16 deletions google/cloud/accessapproval_v1/services/access_approval/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@ class AccessApprovalClient(metaclass=AccessApprovalClientMeta):
- The API has a collection of
[ApprovalRequest][google.cloud.accessapproval.v1.ApprovalRequest]
resources, named ``approvalRequests/{approval_request_id}``
resources, named ``approvalRequests/{approval_request}``
- The API has top-level settings per Project/Folder/Organization,
named ``accessApprovalSettings``
The service also periodically emails a list of recipients, defined
at the Project/Folder/Organization level in the
accessApprovalSettings, when there is a pending ApprovalRequest for
them to act on. The ApprovalRequests can also optionally be
published to a Cloud Pub/Sub topic owned by the customer (for Beta,
the Pub/Sub setup is managed manually).
published to a Pub/Sub topic owned by the customer (contact support
if you would like to enable Pub/Sub notifications).
ApprovalRequests can be approved or dismissed. Google personel can
ApprovalRequests can be approved or dismissed. Google personnel can
only access the indicated resource or resources if the request is
approved (subject to some exclusions:
https://cloud.google.com/access-approval/docs/overview#exclusions).
Expand Down Expand Up @@ -196,6 +196,33 @@ def transport(self) -> AccessApprovalTransport:
"""
return self._transport

@staticmethod
def access_approval_settings_path(project: str,) -> str:
"""Returns a fully-qualified access_approval_settings string."""
return "projects/{project}/accessApprovalSettings".format(project=project,)

@staticmethod
def parse_access_approval_settings_path(path: str) -> Dict[str, str]:
"""Parses a access_approval_settings path into its component segments."""
m = re.match(r"^projects/(?P<project>.+?)/accessApprovalSettings$", path)
return m.groupdict() if m else {}

@staticmethod
def approval_request_path(project: str, approval_request: str,) -> str:
"""Returns a fully-qualified approval_request string."""
return "projects/{project}/approvalRequests/{approval_request}".format(
project=project, approval_request=approval_request,
)

@staticmethod
def parse_approval_request_path(path: str) -> Dict[str, str]:
"""Parses a approval_request path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/approvalRequests/(?P<approval_request>.+?)$",
path,
)
return m.groupdict() if m else {}

@staticmethod
def common_billing_account_path(billing_account: str,) -> str:
"""Returns a fully-qualified billing_account string."""
Expand Down Expand Up @@ -450,6 +477,8 @@ def sample_list_approval_requests():
# Make the request
page_result = client.list_approval_requests(request=request)
# Handle the response
for response in page_result:
print(response)
Expand All @@ -458,8 +487,9 @@ def sample_list_approval_requests():
The request object. Request to list approval requests.
parent (str):
The parent resource. This may be
"projects/{project_id}", "folders/{folder_id}", or
"organizations/{organization_id}".
"projects/{project}",
"folders/{folder}", or
"organizations/{organization}".
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -551,15 +581,15 @@ def sample_get_approval_request():
# Make the request
response = client.get_approval_request(request=request)
# Handle response
# Handle the response
print(response)
Args:
request (Union[google.cloud.accessapproval_v1.types.GetApprovalRequestMessage, dict]):
The request object. Request to get an approval request.
name (str):
Name of the approval request to
retrieve.
The name of the approval request to retrieve. Format:
"{projects|folders|organizations}/{id}/approvalRequests/{approval_request}"
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -644,7 +674,7 @@ def sample_approve_approval_request():
# Make the request
response = client.approve_approval_request(request=request)
# Handle response
# Handle the response
print(response)
Args:
Expand Down Expand Up @@ -723,7 +753,7 @@ def sample_dismiss_approval_request():
# Make the request
response = client.dismiss_approval_request(request=request)
# Handle response
# Handle the response
print(response)
Args:
Expand Down Expand Up @@ -795,16 +825,17 @@ def sample_get_access_approval_settings():
# Make the request
response = client.get_access_approval_settings(request=request)
# Handle response
# Handle the response
print(response)
Args:
request (Union[google.cloud.accessapproval_v1.types.GetAccessApprovalSettingsMessage, dict]):
The request object. Request to get access approval
settings.
name (str):
Name of the AccessApprovalSettings to
retrieve.
The name of the AccessApprovalSettings to retrieve.
Format:
"{projects|folders|organizations}/{id}/accessApprovalSettings"
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -892,7 +923,7 @@ def sample_update_access_approval_settings():
# Make the request
response = client.update_access_approval_settings(request=request)
# Handle response
# Handle the response
print(response)
Args:
Expand Down Expand Up @@ -1009,7 +1040,7 @@ def sample_delete_access_approval_settings():
)
# Make the request
response = client.delete_access_approval_settings(request=request)
client.delete_access_approval_settings(request=request)
Args:
request (Union[google.cloud.accessapproval_v1.types.DeleteAccessApprovalSettingsMessage, dict]):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ class AccessApprovalGrpcTransport(AccessApprovalTransport):
- The API has a collection of
[ApprovalRequest][google.cloud.accessapproval.v1.ApprovalRequest]
resources, named ``approvalRequests/{approval_request_id}``
resources, named ``approvalRequests/{approval_request}``
- The API has top-level settings per Project/Folder/Organization,
named ``accessApprovalSettings``
The service also periodically emails a list of recipients, defined
at the Project/Folder/Organization level in the
accessApprovalSettings, when there is a pending ApprovalRequest for
them to act on. The ApprovalRequests can also optionally be
published to a Cloud Pub/Sub topic owned by the customer (for Beta,
the Pub/Sub setup is managed manually).
published to a Pub/Sub topic owned by the customer (contact support
if you would like to enable Pub/Sub notifications).
ApprovalRequests can be approved or dismissed. Google personel can
ApprovalRequests can be approved or dismissed. Google personnel can
only access the indicated resource or resources if the request is
approved (subject to some exclusions:
https://cloud.google.com/access-approval/docs/overview#exclusions).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ class AccessApprovalGrpcAsyncIOTransport(AccessApprovalTransport):
- The API has a collection of
[ApprovalRequest][google.cloud.accessapproval.v1.ApprovalRequest]
resources, named ``approvalRequests/{approval_request_id}``
resources, named ``approvalRequests/{approval_request}``
- The API has top-level settings per Project/Folder/Organization,
named ``accessApprovalSettings``
The service also periodically emails a list of recipients, defined
at the Project/Folder/Organization level in the
accessApprovalSettings, when there is a pending ApprovalRequest for
them to act on. The ApprovalRequests can also optionally be
published to a Cloud Pub/Sub topic owned by the customer (for Beta,
the Pub/Sub setup is managed manually).
published to a Pub/Sub topic owned by the customer (contact support
if you would like to enable Pub/Sub notifications).
ApprovalRequests can be approved or dismissed. Google personel can
ApprovalRequests can be approved or dismissed. Google personnel can
only access the indicated resource or resources if the request is
approved (subject to some exclusions:
https://cloud.google.com/access-approval/docs/overview#exclusions).
Expand Down
Loading

0 comments on commit de63e9e

Please sign in to comment.