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

feat: add from_service_account_info factory and fix sphinx identifiers #48

Merged
merged 1 commit into from Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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