Skip to content

Commit

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

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 authored Jan 6, 2021
1 parent a395245 commit 14400ad
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ Types for Google Cloud Oslogin Common API

.. automodule:: google.cloud.oslogin_v1.common
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
OsLoginService
--------------------------------

.. automodule:: google.cloud.oslogin_v1.services.os_login_service
:members:
:inherited-members:
6 changes: 3 additions & 3 deletions packages/google-cloud-os-login/docs/oslogin_v1/services.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Services for Google Cloud Oslogin v1 API
========================================
.. toctree::
:maxdepth: 2

.. automodule:: google.cloud.oslogin_v1.services.os_login_service
:members:
:inherited-members:
os_login_service
1 change: 1 addition & 0 deletions packages/google-cloud-os-login/docs/oslogin_v1/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ Types for Google Cloud Oslogin v1 API

.. automodule:: google.cloud.oslogin_v1.types
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class PosixAccount(proto.Message):
empty value is used.
account_id (str):
Output only. A POSIX account identifier.
operating_system_type (~.common.OperatingSystemType):
operating_system_type (google.cloud.oslogin.v1.types.OperatingSystemType):
The operating system type where this account
applies.
name (str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class OsLoginServiceAsyncClient:
OsLoginServiceClient.parse_common_location_path
)

from_service_account_info = OsLoginServiceClient.from_service_account_info
from_service_account_file = OsLoginServiceClient.from_service_account_file
from_service_account_json = from_service_account_file

Expand Down Expand Up @@ -163,14 +164,15 @@ async def delete_posix_account(
r"""Deletes a POSIX account.
Args:
request (:class:`~.oslogin.DeletePosixAccountRequest`):
request (:class:`google.cloud.oslogin_v1.types.DeletePosixAccountRequest`):
The request object. A request message for deleting a
POSIX account entry.
name (:class:`str`):
Required. A reference to the POSIX account to update.
POSIX accounts are identified by the project ID they are
associated with. A reference to the POSIX account is in
format ``users/{user}/projects/{project}``.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand Down Expand Up @@ -238,14 +240,15 @@ async def delete_ssh_public_key(
r"""Deletes an SSH public key.
Args:
request (:class:`~.oslogin.DeleteSshPublicKeyRequest`):
request (:class:`google.cloud.oslogin_v1.types.DeleteSshPublicKeyRequest`):
The request object. A request message for deleting an
SSH public key.
name (:class:`str`):
Required. The fingerprint of the public key to update.
Public keys are identified by their SHA-256 fingerprint.
The fingerprint of the public key is in format
``users/{user}/sshPublicKeys/{fingerprint}``.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand Down Expand Up @@ -314,12 +317,13 @@ async def get_login_profile(
to a virtual machine on Google Compute Engine.
Args:
request (:class:`~.oslogin.GetLoginProfileRequest`):
request (:class:`google.cloud.oslogin_v1.types.GetLoginProfileRequest`):
The request object. A request message for retrieving the
login profile information for a user.
name (:class:`str`):
Required. The unique ID for the user in format
``users/{user}``.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -331,7 +335,7 @@ async def get_login_profile(
sent along with the request as metadata.
Returns:
~.oslogin.LoginProfile:
google.cloud.oslogin_v1.types.LoginProfile:
The user profile information used for
logging in to a virtual machine on
Google Compute Engine.
Expand Down Expand Up @@ -395,14 +399,15 @@ async def get_ssh_public_key(
r"""Retrieves an SSH public key.
Args:
request (:class:`~.oslogin.GetSshPublicKeyRequest`):
request (:class:`google.cloud.oslogin_v1.types.GetSshPublicKeyRequest`):
The request object. A request message for retrieving an
SSH public key.
name (:class:`str`):
Required. The fingerprint of the public key to retrieve.
Public keys are identified by their SHA-256 fingerprint.
The fingerprint of the public key is in format
``users/{user}/sshPublicKeys/{fingerprint}``.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -414,7 +419,7 @@ async def get_ssh_public_key(
sent along with the request as metadata.
Returns:
~.common.SshPublicKey:
google.cloud.oslogin.v1.common_pb2.SshPublicKey:
The SSH public key information
associated with a Google account.
Expand Down Expand Up @@ -482,24 +487,27 @@ async def import_ssh_public_key(
profile.
Args:
request (:class:`~.oslogin.ImportSshPublicKeyRequest`):
request (:class:`google.cloud.oslogin_v1.types.ImportSshPublicKeyRequest`):
The request object. A request message for importing an
SSH public key.
parent (:class:`str`):
Required. The unique ID for the user in format
``users/{user}``.
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
ssh_public_key (:class:`~.common.SshPublicKey`):
ssh_public_key (:class:`google.cloud.oslogin.v1.common_pb2.SshPublicKey`):
Optional. The SSH public key and
expiration time.
This corresponds to the ``ssh_public_key`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
project_id (:class:`str`):
The project ID of the Google Cloud
Platform project.
This corresponds to the ``project_id`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -511,7 +519,7 @@ async def import_ssh_public_key(
sent along with the request as metadata.
Returns:
~.oslogin.ImportSshPublicKeyResponse:
google.cloud.oslogin_v1.types.ImportSshPublicKeyResponse:
A response message for importing an
SSH public key.
Expand Down Expand Up @@ -581,26 +589,29 @@ async def update_ssh_public_key(
information. This method supports patch semantics.
Args:
request (:class:`~.oslogin.UpdateSshPublicKeyRequest`):
request (:class:`google.cloud.oslogin_v1.types.UpdateSshPublicKeyRequest`):
The request object. A request message for updating an
SSH public key.
name (:class:`str`):
Required. The fingerprint of the public key to update.
Public keys are identified by their SHA-256 fingerprint.
The fingerprint of the public key is in format
``users/{user}/sshPublicKeys/{fingerprint}``.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
ssh_public_key (:class:`~.common.SshPublicKey`):
ssh_public_key (:class:`google.cloud.oslogin.v1.common_pb2.SshPublicKey`):
Required. The SSH public key and
expiration time.
This corresponds to the ``ssh_public_key`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
update_mask (:class:`~.field_mask.FieldMask`):
update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
Mask to control which fields get
updated. Updates all if not present.
This corresponds to the ``update_mask`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
Expand All @@ -612,7 +623,7 @@ async def update_ssh_public_key(
sent along with the request as metadata.
Returns:
~.common.SshPublicKey:
google.cloud.oslogin.v1.common_pb2.SshPublicKey:
The SSH public key information
associated with a Google account.
Expand Down
Loading

0 comments on commit 14400ad

Please sign in to comment.