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

Commit

Permalink
Browse files Browse the repository at this point in the history
feat: add from_service_account_info factory and fix sphinx identifiers (
#48)

feat: add 'from_service_account_info' factory to clients
fix: fix sphinx identifiers
PiperOrigin-RevId: 350246057

Source-Author: Google APIs <noreply@google.com>
Source-Date: Tue Jan 5 16:44:11 2021 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 520682435235d9c503983a360a2090025aa47cd1
Source-Link: googleapis/googleapis@5206824
  • Loading branch information
yoshi-automation committed Jan 6, 2021
1 parent 197a016 commit 29746e1
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 48 deletions.
6 changes: 6 additions & 0 deletions docs/credentials_v1/iam_credentials.rst
@@ -0,0 +1,6 @@
IAMCredentials
--------------------------------

.. automodule:: google.cloud.iam_credentials_v1.services.iam_credentials
:members:
:inherited-members:
6 changes: 3 additions & 3 deletions docs/credentials_v1/services.rst
@@ -1,6 +1,6 @@
Services for Google Iam Credentials v1 API
==========================================
.. toctree::
:maxdepth: 2

.. automodule:: google.cloud.iam_credentials_v1.services.iam_credentials
:members:
:inherited-members:
iam_credentials
1 change: 1 addition & 0 deletions docs/credentials_v1/types.rst
Expand Up @@ -3,4 +3,5 @@ Types for Google Iam Credentials v1 API

.. automodule:: google.cloud.iam_credentials_v1.types
:members:
:undoc-members:
:show-inheritance:
Expand Up @@ -89,6 +89,7 @@ class IAMCredentialsAsyncClient:
IAMCredentialsClient.parse_common_location_path
)

from_service_account_info = IAMCredentialsClient.from_service_account_info
from_service_account_file = IAMCredentialsClient.from_service_account_file
from_service_account_json = from_service_account_file

Expand Down Expand Up @@ -169,7 +170,7 @@ async def generate_access_token(
account.
Args:
request (:class:`~.common.GenerateAccessTokenRequest`):
request (:class:`google.cloud.iam_credentials_v1.types.GenerateAccessTokenRequest`):
The request object.
name (:class:`str`):
Required. The resource name of the service account for
Expand All @@ -178,6 +179,7 @@ async def generate_access_token(
``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``.
The ``-`` wildcard character is required; replacing it
with a project ID is invalid.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -195,6 +197,7 @@ async def generate_access_token(
``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``.
The ``-`` wildcard character is required; replacing it
with a project ID is invalid.
This corresponds to the ``delegates`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -205,16 +208,18 @@ async def generate_access_token(
https://developers.google.com/identity/protocols/googlescopes
for more information.
At least one value required.
This corresponds to the ``scope`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
lifetime (:class:`~.duration.Duration`):
lifetime (:class:`google.protobuf.duration_pb2.Duration`):
The desired lifetime duration of the
access token in seconds. Must be set to
a value less than or equal to 3600 (1
hour). If a value is not specified, the
token's lifetime will be set to a
default value of one hour.
This corresponds to the ``lifetime`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -226,7 +231,7 @@ async def generate_access_token(
sent along with the request as metadata.
Returns:
~.common.GenerateAccessTokenResponse:
google.cloud.iam_credentials_v1.types.GenerateAccessTokenResponse:
"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -298,7 +303,7 @@ async def generate_id_token(
account.
Args:
request (:class:`~.common.GenerateIdTokenRequest`):
request (:class:`google.cloud.iam_credentials_v1.types.GenerateIdTokenRequest`):
The request object.
name (:class:`str`):
Required. The resource name of the service account for
Expand All @@ -307,6 +312,7 @@ async def generate_id_token(
``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``.
The ``-`` wildcard character is required; replacing it
with a project ID is invalid.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -324,20 +330,23 @@ async def generate_id_token(
``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``.
The ``-`` wildcard character is required; replacing it
with a project ID is invalid.
This corresponds to the ``delegates`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
audience (:class:`str`):
Required. The audience for the token,
such as the API or account that this
token grants access to.
This corresponds to the ``audience`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
include_email (:class:`bool`):
Include the service account email in the token. If set
to ``true``, the token will contain ``email`` and
``email_verified`` claims.
This corresponds to the ``include_email`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -349,7 +358,7 @@ async def generate_id_token(
sent along with the request as metadata.
Returns:
~.common.GenerateIdTokenResponse:
google.cloud.iam_credentials_v1.types.GenerateIdTokenResponse:
"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -420,7 +429,7 @@ async def sign_blob(
private key.
Args:
request (:class:`~.common.SignBlobRequest`):
request (:class:`google.cloud.iam_credentials_v1.types.SignBlobRequest`):
The request object.
name (:class:`str`):
Required. The resource name of the service account for
Expand All @@ -429,6 +438,7 @@ async def sign_blob(
``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``.
The ``-`` wildcard character is required; replacing it
with a project ID is invalid.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -446,6 +456,7 @@ async def sign_blob(
``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``.
The ``-`` wildcard character is required; replacing it
with a project ID is invalid.
This corresponds to the ``delegates`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -462,7 +473,7 @@ async def sign_blob(
sent along with the request as metadata.
Returns:
~.common.SignBlobResponse:
google.cloud.iam_credentials_v1.types.SignBlobResponse:
"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -531,7 +542,7 @@ async def sign_jwt(
private key.
Args:
request (:class:`~.common.SignJwtRequest`):
request (:class:`google.cloud.iam_credentials_v1.types.SignJwtRequest`):
The request object.
name (:class:`str`):
Required. The resource name of the service account for
Expand All @@ -540,6 +551,7 @@ async def sign_jwt(
``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``.
The ``-`` wildcard character is required; replacing it
with a project ID is invalid.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -557,13 +569,15 @@ async def sign_jwt(
``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``.
The ``-`` wildcard character is required; replacing it
with a project ID is invalid.
This corresponds to the ``delegates`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
payload (:class:`str`):
Required. The JWT payload to sign: a
JSON object that contains a JWT Claims
Set.
This corresponds to the ``payload`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -575,7 +589,7 @@ async def sign_jwt(
sent along with the request as metadata.
Returns:
~.common.SignJwtResponse:
google.cloud.iam_credentials_v1.types.SignJwtResponse:
"""
# Create or coerce a protobuf request object.
Expand Down

0 comments on commit 29746e1

Please sign in to comment.