From f903af460761fd4e259e8ba122df9f1fcd38adb2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 25 Oct 2019 14:54:10 -0700 Subject: [PATCH] feat(oslogin)!: rename `fingerprint_path` to `ssh_public_key_path`; rename `project_path` to `posix_account_path`; add `OperatingSystemType` enum; make `ssh_public_key` optional param to `import_ssh_public_key`; annotate protos (via synth) (#9431) --- docs/conf.py | 9 +- docs/gapic/v1/api.rst | 4 +- docs/gapic/v1/types.rst | 4 +- google/__init__.py | 4 +- google/cloud/__init__.py | 4 +- google/cloud/oslogin.py | 9 +- google/cloud/oslogin_v1/__init__.py | 4 +- google/cloud/oslogin_v1/gapic/enums.py | 35 + .../gapic/os_login_service_client.py | 64 +- .../gapic/os_login_service_client_config.py | 24 +- .../os_login_service_grpc_transport.py | 2 - google/cloud/oslogin_v1/proto/common_pb2.py | 176 +++- google/cloud/oslogin_v1/proto/oslogin.proto | 112 ++- .../proto/oslogin/common/__init__.py | 0 .../proto/oslogin/common/common_pb2.py | 355 -------- .../proto/oslogin/common/common_pb2_grpc.py | 2 - google/cloud/oslogin_v1/proto/oslogin_pb2.py | 201 +++-- .../proto/oslogin_v1/proto/__init__.py | 0 .../proto/oslogin_v1/proto/oslogin_pb2.py | 848 ------------------ .../oslogin_v1/proto/oslogin_pb2_grpc.py | 148 --- synth.metadata | 12 +- synth.py | 15 +- .../v1/test_os_login_service_client_v1.py | 33 +- 23 files changed, 495 insertions(+), 1570 deletions(-) create mode 100644 google/cloud/oslogin_v1/gapic/enums.py delete mode 100644 google/cloud/oslogin_v1/proto/oslogin/common/__init__.py delete mode 100644 google/cloud/oslogin_v1/proto/oslogin/common/common_pb2.py delete mode 100644 google/cloud/oslogin_v1/proto/oslogin/common/common_pb2_grpc.py delete mode 100644 google/cloud/oslogin_v1/proto/oslogin_v1/proto/__init__.py delete mode 100644 google/cloud/oslogin_v1/proto/oslogin_v1/proto/oslogin_pb2.py delete mode 100644 google/cloud/oslogin_v1/proto/oslogin_v1/proto/oslogin_pb2_grpc.py diff --git a/docs/conf.py b/docs/conf.py index f44d9a3..b361448 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -45,6 +45,7 @@ autodoc_default_flags = ["members"] autosummary_generate = True + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -121,6 +122,7 @@ # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True + # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for @@ -229,6 +231,7 @@ # -- Options for warnings ------------------------------------------------------ + suppress_warnings = [ # Temporarily suppress this to avoid "more than one target found for # cross-reference" warning, which are intractable for us to avoid while in @@ -284,6 +287,7 @@ # If false, no module index is generated. # latex_domain_indices = True + # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples @@ -301,6 +305,7 @@ # If true, show URL addresses after external links. # man_show_urls = False + # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples @@ -330,6 +335,7 @@ # If true, do not generate a @detailmenu in the "Top" node's menu. # texinfo_no_detailmenu = False + # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { "python": ("http://python.readthedocs.org/en/latest/", None), @@ -338,11 +344,12 @@ "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/stable/", None), + "requests": ("https://requests.kennethreitz.org/en/master/", None), "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), } + # Napoleon settings napoleon_google_docstring = True napoleon_numpy_docstring = True diff --git a/docs/gapic/v1/api.rst b/docs/gapic/v1/api.rst index 29e3db9..25108a1 100644 --- a/docs/gapic/v1/api.rst +++ b/docs/gapic/v1/api.rst @@ -1,5 +1,5 @@ -Client for Google Cloud OS Login API -==================================== +Client for Cloud OS Login API +============================= .. automodule:: google.cloud.oslogin_v1 :members: diff --git a/docs/gapic/v1/types.rst b/docs/gapic/v1/types.rst index 25d3fd0..9694a7e 100644 --- a/docs/gapic/v1/types.rst +++ b/docs/gapic/v1/types.rst @@ -1,5 +1,5 @@ -Types for Google Cloud OS Login API Client -========================================== +Types for Cloud OS Login API Client +=================================== .. automodule:: google.cloud.oslogin_v1.types :members: \ No newline at end of file diff --git a/google/__init__.py b/google/__init__.py index dd3a9f4..8fcc60e 100644 --- a/google/__init__.py +++ b/google/__init__.py @@ -1,4 +1,6 @@ -# Copyright 2018 Google LLC +# -*- coding: utf-8 -*- +# +# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/__init__.py b/google/cloud/__init__.py index dd3a9f4..8fcc60e 100644 --- a/google/cloud/__init__.py +++ b/google/cloud/__init__.py @@ -1,4 +1,6 @@ -# Copyright 2018 Google LLC +# -*- coding: utf-8 -*- +# +# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/oslogin.py b/google/cloud/oslogin.py index 3c44a48..416aad0 100644 --- a/google/cloud/oslogin.py +++ b/google/cloud/oslogin.py @@ -1,4 +1,6 @@ -# Copyright 2018 Google LLC +# -*- coding: utf-8 -*- +# +# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,9 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. + from __future__ import absolute_import from google.cloud.oslogin_v1 import OsLoginServiceClient +from google.cloud.oslogin_v1 import enums from google.cloud.oslogin_v1 import types -__all__ = ("types", "OsLoginServiceClient") + +__all__ = ("enums", "types", "OsLoginServiceClient") diff --git a/google/cloud/oslogin_v1/__init__.py b/google/cloud/oslogin_v1/__init__.py index 2691d28..83a5ac2 100644 --- a/google/cloud/oslogin_v1/__init__.py +++ b/google/cloud/oslogin_v1/__init__.py @@ -18,11 +18,13 @@ from __future__ import absolute_import from google.cloud.oslogin_v1 import types +from google.cloud.oslogin_v1.gapic import enums from google.cloud.oslogin_v1.gapic import os_login_service_client class OsLoginServiceClient(os_login_service_client.OsLoginServiceClient): __doc__ = os_login_service_client.OsLoginServiceClient.__doc__ + enums = enums -__all__ = ("types", "OsLoginServiceClient") +__all__ = ("enums", "types", "OsLoginServiceClient") diff --git a/google/cloud/oslogin_v1/gapic/enums.py b/google/cloud/oslogin_v1/gapic/enums.py new file mode 100644 index 0000000..ab555b0 --- /dev/null +++ b/google/cloud/oslogin_v1/gapic/enums.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Wrappers for protocol buffer enum types.""" + +import enum + + +class OperatingSystemType(enum.IntEnum): + """ + The operating system options for account entries. + + Attributes: + OPERATING_SYSTEM_TYPE_UNSPECIFIED (int): The operating system type associated with the user account information is + unspecified. + LINUX (int): Linux user account information. + WINDOWS (int): Windows user account information. + """ + + OPERATING_SYSTEM_TYPE_UNSPECIFIED = 0 + LINUX = 1 + WINDOWS = 2 diff --git a/google/cloud/oslogin_v1/gapic/os_login_service_client.py b/google/cloud/oslogin_v1/gapic/os_login_service_client.py index d19ee1d..ec496c5 100644 --- a/google/cloud/oslogin_v1/gapic/os_login_service_client.py +++ b/google/cloud/oslogin_v1/gapic/os_login_service_client.py @@ -29,6 +29,7 @@ import google.api_core.path_template import grpc +from google.cloud.oslogin_v1.gapic import enums from google.cloud.oslogin_v1.gapic import os_login_service_client_config from google.cloud.oslogin_v1.gapic.transports import os_login_service_grpc_transport from google.cloud.oslogin_v1.proto import common_pb2 @@ -77,19 +78,19 @@ def from_service_account_file(cls, filename, *args, **kwargs): from_service_account_json = from_service_account_file @classmethod - def fingerprint_path(cls, user, fingerprint): - """Return a fully-qualified fingerprint string.""" + def posix_account_path(cls, user, project): + """Return a fully-qualified posix_account string.""" return google.api_core.path_template.expand( - "users/{user}/sshPublicKeys/{fingerprint}", - user=user, - fingerprint=fingerprint, + "users/{user}/projects/{project}", user=user, project=project ) @classmethod - def project_path(cls, user, project): - """Return a fully-qualified project string.""" + def ssh_public_key_path(cls, user, fingerprint): + """Return a fully-qualified ssh_public_key string.""" return google.api_core.path_template.expand( - "users/{user}/projects/{project}", user=user, project=project + "users/{user}/sshPublicKeys/{fingerprint}", + user=user, + fingerprint=fingerprint, ) @classmethod @@ -225,12 +226,12 @@ def delete_posix_account( >>> >>> client = oslogin_v1.OsLoginServiceClient() >>> - >>> name = client.project_path('[USER]', '[PROJECT]') + >>> name = client.posix_account_path('[USER]', '[PROJECT]') >>> >>> client.delete_posix_account(name) Args: - name (str): A reference to the POSIX account to update. POSIX accounts are + name (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}``. retry (Optional[google.api_core.retry.Retry]): A retry object used @@ -293,14 +294,14 @@ def delete_ssh_public_key( >>> >>> client = oslogin_v1.OsLoginServiceClient() >>> - >>> name = client.fingerprint_path('[USER]', '[FINGERPRINT]') + >>> name = client.ssh_public_key_path('[USER]', '[FINGERPRINT]') >>> >>> client.delete_ssh_public_key(name) Args: - name (str): 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}``. + name (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}``. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -349,6 +350,8 @@ def delete_ssh_public_key( def get_login_profile( self, name, + project_id=None, + system_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, @@ -367,7 +370,9 @@ def get_login_profile( >>> response = client.get_login_profile(name) Args: - name (str): The unique ID for the user in format ``users/{user}``. + name (str): Required. The unique ID for the user in format ``users/{user}``. + project_id (str): The project ID of the Google Cloud Platform project. + system_id (str): A system ID for filtering the results of the request. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -398,7 +403,9 @@ def get_login_profile( client_info=self._client_info, ) - request = oslogin_pb2.GetLoginProfileRequest(name=name) + request = oslogin_pb2.GetLoginProfileRequest( + name=name, project_id=project_id, system_id=system_id + ) if metadata is None: metadata = [] metadata = list(metadata) @@ -431,12 +438,12 @@ def get_ssh_public_key( >>> >>> client = oslogin_v1.OsLoginServiceClient() >>> - >>> name = client.fingerprint_path('[USER]', '[FINGERPRINT]') + >>> name = client.ssh_public_key_path('[USER]', '[FINGERPRINT]') >>> >>> response = client.get_ssh_public_key(name) Args: - name (str): The fingerprint of the public key to retrieve. Public keys are + name (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}``. retry (Optional[google.api_core.retry.Retry]): A retry object used @@ -490,7 +497,7 @@ def get_ssh_public_key( def import_ssh_public_key( self, parent, - ssh_public_key, + ssh_public_key=None, project_id=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, @@ -508,14 +515,11 @@ def import_ssh_public_key( >>> >>> parent = client.user_path('[USER]') >>> - >>> # TODO: Initialize `ssh_public_key`: - >>> ssh_public_key = {} - >>> - >>> response = client.import_ssh_public_key(parent, ssh_public_key) + >>> response = client.import_ssh_public_key(parent) Args: - parent (str): The unique ID for the user in format ``users/{user}``. - ssh_public_key (Union[dict, ~google.cloud.oslogin_v1.types.SshPublicKey]): The SSH public key and expiration time. + parent (str): Required. The unique ID for the user in format ``users/{user}``. + ssh_public_key (Union[dict, ~google.cloud.oslogin_v1.types.SshPublicKey]): Optional. The SSH public key and expiration time. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.oslogin_v1.types.SshPublicKey` @@ -588,7 +592,7 @@ def update_ssh_public_key( >>> >>> client = oslogin_v1.OsLoginServiceClient() >>> - >>> name = client.fingerprint_path('[USER]', '[FINGERPRINT]') + >>> name = client.ssh_public_key_path('[USER]', '[FINGERPRINT]') >>> >>> # TODO: Initialize `ssh_public_key`: >>> ssh_public_key = {} @@ -596,10 +600,10 @@ def update_ssh_public_key( >>> response = client.update_ssh_public_key(name, ssh_public_key) Args: - name (str): 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}``. - ssh_public_key (Union[dict, ~google.cloud.oslogin_v1.types.SshPublicKey]): The SSH public key and expiration time. + name (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}``. + ssh_public_key (Union[dict, ~google.cloud.oslogin_v1.types.SshPublicKey]): Required. The SSH public key and expiration time. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.oslogin_v1.types.SshPublicKey` diff --git a/google/cloud/oslogin_v1/gapic/os_login_service_client_config.py b/google/cloud/oslogin_v1/gapic/os_login_service_client_config.py index e55e796..6d64718 100644 --- a/google/cloud/oslogin_v1/gapic/os_login_service_client_config.py +++ b/google/cloud/oslogin_v1/gapic/os_login_service_client_config.py @@ -10,41 +10,41 @@ "initial_retry_delay_millis": 100, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 10000, + "initial_rpc_timeout_millis": 20000, "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 10000, + "max_rpc_timeout_millis": 20000, "total_timeout_millis": 600000, } }, "methods": { "DeletePosixAccount": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, "DeleteSshPublicKey": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, "GetLoginProfile": { - "timeout_millis": 10000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "GetSshPublicKey": { - "timeout_millis": 10000, + "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "ImportSshPublicKey": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, "UpdateSshPublicKey": { - "timeout_millis": 10000, - "retry_codes_name": "idempotent", + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, }, diff --git a/google/cloud/oslogin_v1/gapic/transports/os_login_service_grpc_transport.py b/google/cloud/oslogin_v1/gapic/transports/os_login_service_grpc_transport.py index 6414cf2..2860dfe 100644 --- a/google/cloud/oslogin_v1/gapic/transports/os_login_service_grpc_transport.py +++ b/google/cloud/oslogin_v1/gapic/transports/os_login_service_grpc_transport.py @@ -33,9 +33,7 @@ class OsLoginServiceGrpcTransport(object): # in this service. _OAUTH_SCOPES = ( "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", "https://www.googleapis.com/auth/compute", - "https://www.googleapis.com/auth/compute.readonly", ) def __init__( diff --git a/google/cloud/oslogin_v1/proto/common_pb2.py b/google/cloud/oslogin_v1/proto/common_pb2.py index 7a81f9e..c842ef7 100644 --- a/google/cloud/oslogin_v1/proto/common_pb2.py +++ b/google/cloud/oslogin_v1/proto/common_pb2.py @@ -1,32 +1,72 @@ +# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/oslogin/common/common.proto import sys _b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) +from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database -from google.protobuf import descriptor_pb2 # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name="google/cloud/oslogin/common/common.proto", package="google.cloud.oslogin.common", syntax="proto3", + serialized_options=_b( + "\n\037com.google.cloud.oslogin.commonB\014OsLoginProtoZAgoogle.golang.org/genproto/googleapis/cloud/oslogin/common;common\252\002\033Google.Cloud.OsLogin.Common\312\002\033Google\\Cloud\\OsLogin\\Common\352A+\n\033oslogin.googleapis.com/User\022\014users/{user}" + ), serialized_pb=_b( - '\n(google/cloud/oslogin/common/common.proto\x12\x1bgoogle.cloud.oslogin.common\x1a\x1cgoogle/api/annotations.proto"\xa8\x01\n\x0cPosixAccount\x12\x0f\n\x07primary\x18\x01 \x01(\x08\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x0b\n\x03uid\x18\x03 \x01(\x03\x12\x0b\n\x03gid\x18\x04 \x01(\x03\x12\x16\n\x0ehome_directory\x18\x05 \x01(\t\x12\r\n\x05shell\x18\x06 \x01(\t\x12\r\n\x05gecos\x18\x07 \x01(\t\x12\x11\n\tsystem_id\x18\x08 \x01(\t\x12\x12\n\naccount_id\x18\t \x01(\t"N\n\x0cSshPublicKey\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x14\x65xpiration_time_usec\x18\x02 \x01(\x03\x12\x13\n\x0b\x66ingerprint\x18\x03 \x01(\tB\xae\x01\n\x1f\x63om.google.cloud.oslogin.commonB\x0cOsLoginProtoZAgoogle.golang.org/genproto/googleapis/cloud/oslogin/common;common\xaa\x02\x1bGoogle.Cloud.OsLogin.Common\xca\x02\x1bGoogle\\Cloud\\OsLogin\\Commonb\x06proto3' + '\n(google/cloud/oslogin/common/common.proto\x12\x1bgoogle.cloud.oslogin.common\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto"\xdc\x02\n\x0cPosixAccount\x12\x0f\n\x07primary\x18\x01 \x01(\x08\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x0b\n\x03uid\x18\x03 \x01(\x03\x12\x0b\n\x03gid\x18\x04 \x01(\x03\x12\x16\n\x0ehome_directory\x18\x05 \x01(\t\x12\r\n\x05shell\x18\x06 \x01(\t\x12\r\n\x05gecos\x18\x07 \x01(\t\x12\x11\n\tsystem_id\x18\x08 \x01(\t\x12\x17\n\naccount_id\x18\t \x01(\tB\x03\xe0\x41\x03\x12O\n\x15operating_system_type\x18\n \x01(\x0e\x32\x30.google.cloud.oslogin.common.OperatingSystemType\x12\x11\n\x04name\x18\x0b \x01(\tB\x03\xe0\x41\x03:I\xea\x41\x46\n#oslogin.googleapis.com/PosixAccount\x12\x1fusers/{user}/projects/{project}"\xba\x01\n\x0cSshPublicKey\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x14\x65xpiration_time_usec\x18\x02 \x01(\x03\x12\x18\n\x0b\x66ingerprint\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04name\x18\x04 \x01(\tB\x03\xe0\x41\x03:R\xea\x41O\n#oslogin.googleapis.com/SshPublicKey\x12(users/{user}/sshPublicKeys/{fingerprint}*T\n\x13OperatingSystemType\x12%\n!OPERATING_SYSTEM_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05LINUX\x10\x01\x12\x0b\n\x07WINDOWS\x10\x02\x42\xdc\x01\n\x1f\x63om.google.cloud.oslogin.commonB\x0cOsLoginProtoZAgoogle.golang.org/genproto/googleapis/cloud/oslogin/common;common\xaa\x02\x1bGoogle.Cloud.OsLogin.Common\xca\x02\x1bGoogle\\Cloud\\OsLogin\\Common\xea\x41+\n\x1boslogin.googleapis.com/User\x12\x0cusers/{user}b\x06proto3' ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], + dependencies=[ + google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, + google_dot_api_dot_resource__pb2.DESCRIPTOR, + ], +) + +_OPERATINGSYSTEMTYPE = _descriptor.EnumDescriptor( + name="OperatingSystemType", + full_name="google.cloud.oslogin.common.OperatingSystemType", + filename=None, + file=DESCRIPTOR, + values=[ + _descriptor.EnumValueDescriptor( + name="OPERATING_SYSTEM_TYPE_UNSPECIFIED", + index=0, + number=0, + serialized_options=None, + type=None, + ), + _descriptor.EnumValueDescriptor( + name="LINUX", index=1, number=1, serialized_options=None, type=None + ), + _descriptor.EnumValueDescriptor( + name="WINDOWS", index=2, number=2, serialized_options=None, type=None + ), + ], + containing_type=None, + serialized_options=None, + serialized_start=673, + serialized_end=757, ) +_sym_db.RegisterEnumDescriptor(_OPERATINGSYSTEMTYPE) + +OperatingSystemType = enum_type_wrapper.EnumTypeWrapper(_OPERATINGSYSTEMTYPE) +OPERATING_SYSTEM_TYPE_UNSPECIFIED = 0 +LINUX = 1 +WINDOWS = 2 _POSIXACCOUNT = _descriptor.Descriptor( @@ -51,7 +91,8 @@ containing_type=None, is_extension=False, extension_scope=None, - options=None, + serialized_options=None, + file=DESCRIPTOR, ), _descriptor.FieldDescriptor( name="username", @@ -68,7 +109,8 @@ containing_type=None, is_extension=False, extension_scope=None, - options=None, + serialized_options=None, + file=DESCRIPTOR, ), _descriptor.FieldDescriptor( name="uid", @@ -85,7 +127,8 @@ containing_type=None, is_extension=False, extension_scope=None, - options=None, + serialized_options=None, + file=DESCRIPTOR, ), _descriptor.FieldDescriptor( name="gid", @@ -102,7 +145,8 @@ containing_type=None, is_extension=False, extension_scope=None, - options=None, + serialized_options=None, + file=DESCRIPTOR, ), _descriptor.FieldDescriptor( name="home_directory", @@ -119,7 +163,8 @@ containing_type=None, is_extension=False, extension_scope=None, - options=None, + serialized_options=None, + file=DESCRIPTOR, ), _descriptor.FieldDescriptor( name="shell", @@ -136,7 +181,8 @@ containing_type=None, is_extension=False, extension_scope=None, - options=None, + serialized_options=None, + file=DESCRIPTOR, ), _descriptor.FieldDescriptor( name="gecos", @@ -153,7 +199,8 @@ containing_type=None, is_extension=False, extension_scope=None, - options=None, + serialized_options=None, + file=DESCRIPTOR, ), _descriptor.FieldDescriptor( name="system_id", @@ -170,7 +217,8 @@ containing_type=None, is_extension=False, extension_scope=None, - options=None, + serialized_options=None, + file=DESCRIPTOR, ), _descriptor.FieldDescriptor( name="account_id", @@ -187,19 +235,58 @@ containing_type=None, is_extension=False, extension_scope=None, - options=None, + serialized_options=_b("\340A\003"), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="operating_system_type", + full_name="google.cloud.oslogin.common.PosixAccount.operating_system_type", + index=9, + number=10, + type=14, + cpp_type=8, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.oslogin.common.PosixAccount.name", + index=10, + number=11, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b("\340A\003"), + file=DESCRIPTOR, ), ], extensions=[], nested_types=[], enum_types=[], - options=None, + serialized_options=_b( + "\352AF\n#oslogin.googleapis.com/PosixAccount\022\037users/{user}/projects/{project}" + ), is_extendable=False, syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=104, - serialized_end=272, + serialized_start=134, + serialized_end=482, ) @@ -225,7 +312,8 @@ containing_type=None, is_extension=False, extension_scope=None, - options=None, + serialized_options=None, + file=DESCRIPTOR, ), _descriptor.FieldDescriptor( name="expiration_time_usec", @@ -242,7 +330,8 @@ containing_type=None, is_extension=False, extension_scope=None, - options=None, + serialized_options=None, + file=DESCRIPTOR, ), _descriptor.FieldDescriptor( name="fingerprint", @@ -259,23 +348,46 @@ containing_type=None, is_extension=False, extension_scope=None, - options=None, + serialized_options=_b("\340A\003"), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="name", + full_name="google.cloud.oslogin.common.SshPublicKey.name", + index=3, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=_b("\340A\003"), + file=DESCRIPTOR, ), ], extensions=[], nested_types=[], enum_types=[], - options=None, + serialized_options=_b( + "\352AO\n#oslogin.googleapis.com/SshPublicKey\022(users/{user}/sshPublicKeys/{fingerprint}" + ), is_extendable=False, syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=274, - serialized_end=352, + serialized_start=485, + serialized_end=671, ) +_POSIXACCOUNT.fields_by_name["operating_system_type"].enum_type = _OPERATINGSYSTEMTYPE DESCRIPTOR.message_types_by_name["PosixAccount"] = _POSIXACCOUNT DESCRIPTOR.message_types_by_name["SshPublicKey"] = _SSHPUBLICKEY +DESCRIPTOR.enum_types_by_name["OperatingSystemType"] = _OPERATINGSYSTEMTYPE _sym_db.RegisterFileDescriptor(DESCRIPTOR) PosixAccount = _reflection.GeneratedProtocolMessageType( @@ -307,6 +419,10 @@ applies to. By default, the empty value is used. account_id: Output only. A POSIX account identifier. + operating_system_type: + The operating system type where this account applies. + name: + Output only. The canonical resource name. """, # @@protoc_insertion_point(class_scope:google.cloud.oslogin.common.PosixAccount) ), @@ -329,6 +445,8 @@ An expiration time in microseconds since epoch. fingerprint: Output only. The SHA-256 fingerprint of the SSH public key. + name: + Output only. The canonical resource name. """, # @@protoc_insertion_point(class_scope:google.cloud.oslogin.common.SshPublicKey) ), @@ -336,11 +454,11 @@ _sym_db.RegisterMessage(SshPublicKey) -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions( - descriptor_pb2.FileOptions(), - _b( - "\n\037com.google.cloud.oslogin.commonB\014OsLoginProtoZAgoogle.golang.org/genproto/googleapis/cloud/oslogin/common;common\252\002\033Google.Cloud.OsLogin.Common\312\002\033Google\\Cloud\\OsLogin\\Common" - ), -) +DESCRIPTOR._options = None +_POSIXACCOUNT.fields_by_name["account_id"]._options = None +_POSIXACCOUNT.fields_by_name["name"]._options = None +_POSIXACCOUNT._options = None +_SSHPUBLICKEY.fields_by_name["fingerprint"]._options = None +_SSHPUBLICKEY.fields_by_name["name"]._options = None +_SSHPUBLICKEY._options = None # @@protoc_insertion_point(module_scope) diff --git a/google/cloud/oslogin_v1/proto/oslogin.proto b/google/cloud/oslogin_v1/proto/oslogin.proto index d76bd47..75d7c06 100644 --- a/google/cloud/oslogin_v1/proto/oslogin.proto +++ b/google/cloud/oslogin_v1/proto/oslogin.proto @@ -1,4 +1,4 @@ -// Copyright 2017 Google Inc. +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,12 +11,16 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// syntax = "proto3"; package google.cloud.oslogin.v1; import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/oslogin/common/common.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; @@ -33,20 +37,25 @@ option php_namespace = "Google\\Cloud\\OsLogin\\V1"; // The Cloud OS Login API allows you to manage users and their associated SSH // public keys for logging into virtual machines on Google Cloud Platform. service OsLoginService { + option (google.api.default_host) = "oslogin.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/compute"; + // Deletes a POSIX account. - rpc DeletePosixAccount(DeletePosixAccountRequest) - returns (google.protobuf.Empty) { + rpc DeletePosixAccount(DeletePosixAccountRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=users/*/projects/*}" }; + option (google.api.method_signature) = "name"; } // Deletes an SSH public key. - rpc DeleteSshPublicKey(DeleteSshPublicKeyRequest) - returns (google.protobuf.Empty) { + rpc DeleteSshPublicKey(DeleteSshPublicKeyRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1/{name=users/*/sshPublicKeys/*}" }; + option (google.api.method_signature) = "name"; } // Retrieves the profile information used for logging in to a virtual machine @@ -55,92 +64,122 @@ service OsLoginService { option (google.api.http) = { get: "/v1/{name=users/*}/loginProfile" }; + option (google.api.method_signature) = "name"; } // Retrieves an SSH public key. - rpc GetSshPublicKey(GetSshPublicKeyRequest) - returns (google.cloud.oslogin.common.SshPublicKey) { + rpc GetSshPublicKey(GetSshPublicKeyRequest) returns (google.cloud.oslogin.common.SshPublicKey) { option (google.api.http) = { get: "/v1/{name=users/*/sshPublicKeys/*}" }; + option (google.api.method_signature) = "name"; } // Adds an SSH public key and returns the profile information. Default POSIX // account information is set when no username and UID exist as part of the // login profile. - rpc ImportSshPublicKey(ImportSshPublicKeyRequest) - returns (ImportSshPublicKeyResponse) { + rpc ImportSshPublicKey(ImportSshPublicKeyRequest) returns (ImportSshPublicKeyResponse) { option (google.api.http) = { post: "/v1/{parent=users/*}:importSshPublicKey" body: "ssh_public_key" }; + option (google.api.method_signature) = "parent,ssh_public_key"; + option (google.api.method_signature) = "parent,ssh_public_key,project_id"; } // Updates an SSH public key and returns the profile information. This method // supports patch semantics. - rpc UpdateSshPublicKey(UpdateSshPublicKeyRequest) - returns (google.cloud.oslogin.common.SshPublicKey) { + rpc UpdateSshPublicKey(UpdateSshPublicKeyRequest) returns (google.cloud.oslogin.common.SshPublicKey) { option (google.api.http) = { patch: "/v1/{name=users/*/sshPublicKeys/*}" body: "ssh_public_key" }; + option (google.api.method_signature) = "name,ssh_public_key"; + option (google.api.method_signature) = "name,ssh_public_key,update_mask"; } } // The user profile information used for logging in to a virtual machine on // Google Compute Engine. message LoginProfile { - // The primary email address that uniquely identifies the user. - string name = 1; + // Required. A unique user ID. + string name = 1 [(google.api.field_behavior) = REQUIRED]; // The list of POSIX accounts associated with the user. repeated google.cloud.oslogin.common.PosixAccount posix_accounts = 2; // A map from SSH public key fingerprint to the associated key object. map ssh_public_keys = 3; - - // Indicates if the user is suspended. A suspended user cannot log in but - // their profile information is retained. - bool suspended = 4; } // A request message for deleting a POSIX account entry. message DeletePosixAccountRequest { - // A reference to the POSIX account to update. POSIX accounts are identified + // 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}`. - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/PosixAccount" + } + ]; } // A request message for deleting an SSH public key. message DeleteSshPublicKeyRequest { - // The fingerprint of the public key to update. Public keys are identified by + // 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}`. - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/SshPublicKey" + } + ]; } // A request message for retrieving the login profile information for a user. message GetLoginProfileRequest { - // The unique ID for the user in format `users/{user}`. - string name = 1; + // Required. The unique ID for the user in format `users/{user}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "oslogin.googleapis.com/PosixAccount" + } + ]; + + // The project ID of the Google Cloud Platform project. + string project_id = 2; + + // A system ID for filtering the results of the request. + string system_id = 3; } // A request message for retrieving an SSH public key. message GetSshPublicKeyRequest { - // The fingerprint of the public key to retrieve. Public keys are identified + // 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}`. - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/SshPublicKey" + } + ]; } // A request message for importing an SSH public key. message ImportSshPublicKeyRequest { - // The unique ID for the user in format `users/{user}`. - string parent = 1; + // Required. The unique ID for the user in format `users/{user}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "oslogin.googleapis.com/SshPublicKey" + } + ]; - // The SSH public key and expiration time. - google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2; + // Optional. The SSH public key and expiration time. + google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(google.api.field_behavior) = OPTIONAL]; // The project ID of the Google Cloud Platform project. string project_id = 3; @@ -154,13 +193,18 @@ message ImportSshPublicKeyResponse { // A request message for updating an SSH public key. message UpdateSshPublicKeyRequest { - // The fingerprint of the public key to update. Public keys are identified by + // 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}`. - string name = 1; - - // The SSH public key and expiration time. - google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "oslogin.googleapis.com/SshPublicKey" + } + ]; + + // Required. The SSH public key and expiration time. + google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2 [(google.api.field_behavior) = REQUIRED]; // Mask to control which fields get updated. Updates all if not present. google.protobuf.FieldMask update_mask = 3; diff --git a/google/cloud/oslogin_v1/proto/oslogin/common/__init__.py b/google/cloud/oslogin_v1/proto/oslogin/common/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/google/cloud/oslogin_v1/proto/oslogin/common/common_pb2.py b/google/cloud/oslogin_v1/proto/oslogin/common/common_pb2.py deleted file mode 100644 index 93acf47..0000000 --- a/google/cloud/oslogin_v1/proto/oslogin/common/common_pb2.py +++ /dev/null @@ -1,355 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/oslogin/common/common.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/oslogin/common/common.proto", - package="google.cloud.oslogin.common", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.oslogin.commonB\014OsLoginProtoZAgoogle.golang.org/genproto/googleapis/cloud/oslogin/common;common\252\002\033Google.Cloud.OsLogin.Common\312\002\033Google\\Cloud\\OsLogin\\Common" - ), - serialized_pb=_b( - '\n(google/cloud/oslogin/common/common.proto\x12\x1bgoogle.cloud.oslogin.common\x1a\x1cgoogle/api/annotations.proto"\xa8\x01\n\x0cPosixAccount\x12\x0f\n\x07primary\x18\x01 \x01(\x08\x12\x10\n\x08username\x18\x02 \x01(\t\x12\x0b\n\x03uid\x18\x03 \x01(\x03\x12\x0b\n\x03gid\x18\x04 \x01(\x03\x12\x16\n\x0ehome_directory\x18\x05 \x01(\t\x12\r\n\x05shell\x18\x06 \x01(\t\x12\r\n\x05gecos\x18\x07 \x01(\t\x12\x11\n\tsystem_id\x18\x08 \x01(\t\x12\x12\n\naccount_id\x18\t \x01(\t"N\n\x0cSshPublicKey\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x14\x65xpiration_time_usec\x18\x02 \x01(\x03\x12\x13\n\x0b\x66ingerprint\x18\x03 \x01(\tB\xae\x01\n\x1f\x63om.google.cloud.oslogin.commonB\x0cOsLoginProtoZAgoogle.golang.org/genproto/googleapis/cloud/oslogin/common;common\xaa\x02\x1bGoogle.Cloud.OsLogin.Common\xca\x02\x1bGoogle\\Cloud\\OsLogin\\Commonb\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_POSIXACCOUNT = _descriptor.Descriptor( - name="PosixAccount", - full_name="google.cloud.oslogin.common.PosixAccount", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="primary", - full_name="google.cloud.oslogin.common.PosixAccount.primary", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="username", - full_name="google.cloud.oslogin.common.PosixAccount.username", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="uid", - full_name="google.cloud.oslogin.common.PosixAccount.uid", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="gid", - full_name="google.cloud.oslogin.common.PosixAccount.gid", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="home_directory", - full_name="google.cloud.oslogin.common.PosixAccount.home_directory", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shell", - full_name="google.cloud.oslogin.common.PosixAccount.shell", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="gecos", - full_name="google.cloud.oslogin.common.PosixAccount.gecos", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="system_id", - full_name="google.cloud.oslogin.common.PosixAccount.system_id", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="account_id", - full_name="google.cloud.oslogin.common.PosixAccount.account_id", - index=8, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=104, - serialized_end=272, -) - - -_SSHPUBLICKEY = _descriptor.Descriptor( - name="SshPublicKey", - full_name="google.cloud.oslogin.common.SshPublicKey", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.oslogin.common.SshPublicKey.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="expiration_time_usec", - full_name="google.cloud.oslogin.common.SshPublicKey.expiration_time_usec", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="fingerprint", - full_name="google.cloud.oslogin.common.SshPublicKey.fingerprint", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=274, - serialized_end=352, -) - -DESCRIPTOR.message_types_by_name["PosixAccount"] = _POSIXACCOUNT -DESCRIPTOR.message_types_by_name["SshPublicKey"] = _SSHPUBLICKEY -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -PosixAccount = _reflection.GeneratedProtocolMessageType( - "PosixAccount", - (_message.Message,), - dict( - DESCRIPTOR=_POSIXACCOUNT, - __module__="google.cloud.oslogin.common.common_pb2", - __doc__="""The POSIX account information associated with a Google account. - - - Attributes: - primary: - Only one POSIX account can be marked as primary. - username: - The username of the POSIX account. - uid: - The user ID. - gid: - The default group ID. - home_directory: - The path to the home directory for this account. - shell: - The path to the logic shell for this account. - gecos: - The GECOS (user information) entry for this account. - system_id: - System identifier for which account the username or uid - applies to. By default, the empty value is used. - account_id: - Output only. A POSIX account identifier. - """, - # @@protoc_insertion_point(class_scope:google.cloud.oslogin.common.PosixAccount) - ), -) -_sym_db.RegisterMessage(PosixAccount) - -SshPublicKey = _reflection.GeneratedProtocolMessageType( - "SshPublicKey", - (_message.Message,), - dict( - DESCRIPTOR=_SSHPUBLICKEY, - __module__="google.cloud.oslogin.common.common_pb2", - __doc__="""The SSH public key information associated with a Google account. - - - Attributes: - key: - Public key text in SSH format, defined by RFC4253 section 6.6. - expiration_time_usec: - An expiration time in microseconds since epoch. - fingerprint: - Output only. The SHA-256 fingerprint of the SSH public key. - """, - # @@protoc_insertion_point(class_scope:google.cloud.oslogin.common.SshPublicKey) - ), -) -_sym_db.RegisterMessage(SshPublicKey) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/google/cloud/oslogin_v1/proto/oslogin/common/common_pb2_grpc.py b/google/cloud/oslogin_v1/proto/oslogin/common/common_pb2_grpc.py deleted file mode 100644 index 07cb78f..0000000 --- a/google/cloud/oslogin_v1/proto/oslogin/common/common_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/google/cloud/oslogin_v1/proto/oslogin_pb2.py b/google/cloud/oslogin_v1/proto/oslogin_pb2.py index 3eb27bd..0feaf4b 100644 --- a/google/cloud/oslogin_v1/proto/oslogin_pb2.py +++ b/google/cloud/oslogin_v1/proto/oslogin_pb2.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/oslogin_v1/proto/oslogin.proto @@ -15,6 +16,9 @@ from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 +from google.api import client_pb2 as google_dot_api_dot_client__pb2 +from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 +from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 from google.cloud.oslogin_v1.proto import ( common_pb2 as google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2, ) @@ -30,10 +34,13 @@ "\n\033com.google.cloud.oslogin.v1B\014OsLoginProtoP\001Z>google.golang.org/genproto/googleapis/cloud/oslogin/v1;oslogin\252\002\027Google.Cloud.OsLogin.V1\312\002\027Google\\Cloud\\OsLogin\\V1" ), serialized_pb=_b( - '\n+google/cloud/oslogin_v1/proto/oslogin.proto\x12\x17google.cloud.oslogin.v1\x1a\x1cgoogle/api/annotations.proto\x1a(google/cloud/oslogin/common/common.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\xa6\x02\n\x0cLoginProfile\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x41\n\x0eposix_accounts\x18\x02 \x03(\x0b\x32).google.cloud.oslogin.common.PosixAccount\x12Q\n\x0fssh_public_keys\x18\x03 \x03(\x0b\x32\x38.google.cloud.oslogin.v1.LoginProfile.SshPublicKeysEntry\x12\x11\n\tsuspended\x18\x04 \x01(\x08\x1a_\n\x12SshPublicKeysEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).google.cloud.oslogin.common.SshPublicKey:\x02\x38\x01")\n\x19\x44\x65letePosixAccountRequest\x12\x0c\n\x04name\x18\x01 \x01(\t")\n\x19\x44\x65leteSshPublicKeyRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"&\n\x16GetLoginProfileRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"&\n\x16GetSshPublicKeyRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\x82\x01\n\x19ImportSshPublicKeyRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x41\n\x0essh_public_key\x18\x02 \x01(\x0b\x32).google.cloud.oslogin.common.SshPublicKey\x12\x12\n\nproject_id\x18\x03 \x01(\t"Z\n\x1aImportSshPublicKeyResponse\x12<\n\rlogin_profile\x18\x01 \x01(\x0b\x32%.google.cloud.oslogin.v1.LoginProfile"\x9d\x01\n\x19UpdateSshPublicKeyRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x41\n\x0essh_public_key\x18\x02 \x01(\x0b\x32).google.cloud.oslogin.common.SshPublicKey\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask2\xcd\x07\n\x0eOsLoginService\x12\x87\x01\n\x12\x44\x65letePosixAccount\x12\x32.google.cloud.oslogin.v1.DeletePosixAccountRequest\x1a\x16.google.protobuf.Empty"%\x82\xd3\xe4\x93\x02\x1f*\x1d/v1/{name=users/*/projects/*}\x12\x8c\x01\n\x12\x44\x65leteSshPublicKey\x12\x32.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest\x1a\x16.google.protobuf.Empty"*\x82\xd3\xe4\x93\x02$*"/v1/{name=users/*/sshPublicKeys/*}\x12\x92\x01\n\x0fGetLoginProfile\x12/.google.cloud.oslogin.v1.GetLoginProfileRequest\x1a%.google.cloud.oslogin.v1.LoginProfile"\'\x82\xd3\xe4\x93\x02!\x12\x1f/v1/{name=users/*}/loginProfile\x12\x99\x01\n\x0fGetSshPublicKey\x12/.google.cloud.oslogin.v1.GetSshPublicKeyRequest\x1a).google.cloud.oslogin.common.SshPublicKey"*\x82\xd3\xe4\x93\x02$\x12"/v1/{name=users/*/sshPublicKeys/*}\x12\xbe\x01\n\x12ImportSshPublicKey\x12\x32.google.cloud.oslogin.v1.ImportSshPublicKeyRequest\x1a\x33.google.cloud.oslogin.v1.ImportSshPublicKeyResponse"?\x82\xd3\xe4\x93\x02\x39"\'/v1/{parent=users/*}:importSshPublicKey:\x0essh_public_key\x12\xaf\x01\n\x12UpdateSshPublicKey\x12\x32.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest\x1a).google.cloud.oslogin.common.SshPublicKey":\x82\xd3\xe4\x93\x02\x34\x32"/v1/{name=users/*/sshPublicKeys/*}:\x0essh_public_keyB\xa1\x01\n\x1b\x63om.google.cloud.oslogin.v1B\x0cOsLoginProtoP\x01Z>google.golang.org/genproto/googleapis/cloud/oslogin/v1;oslogin\xaa\x02\x17Google.Cloud.OsLogin.V1\xca\x02\x17Google\\Cloud\\OsLogin\\V1b\x06proto3' + '\n+google/cloud/oslogin_v1/proto/oslogin.proto\x12\x17google.cloud.oslogin.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a(google/cloud/oslogin/common/common.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\x98\x02\n\x0cLoginProfile\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x0eposix_accounts\x18\x02 \x03(\x0b\x32).google.cloud.oslogin.common.PosixAccount\x12Q\n\x0fssh_public_keys\x18\x03 \x03(\x0b\x32\x38.google.cloud.oslogin.v1.LoginProfile.SshPublicKeysEntry\x1a_\n\x12SshPublicKeysEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).google.cloud.oslogin.common.SshPublicKey:\x02\x38\x01"V\n\x19\x44\x65letePosixAccountRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#oslogin.googleapis.com/PosixAccount"V\n\x19\x44\x65leteSshPublicKeyRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#oslogin.googleapis.com/SshPublicKey"z\n\x16GetLoginProfileRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#oslogin.googleapis.com/PosixAccount\x12\x12\n\nproject_id\x18\x02 \x01(\t\x12\x11\n\tsystem_id\x18\x03 \x01(\t"S\n\x16GetSshPublicKeyRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#oslogin.googleapis.com/SshPublicKey"\xb4\x01\n\x19ImportSshPublicKeyRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#oslogin.googleapis.com/SshPublicKey\x12\x46\n\x0essh_public_key\x18\x02 \x01(\x0b\x32).google.cloud.oslogin.common.SshPublicKeyB\x03\xe0\x41\x01\x12\x12\n\nproject_id\x18\x03 \x01(\t"Z\n\x1aImportSshPublicKeyResponse\x12<\n\rlogin_profile\x18\x01 \x01(\x0b\x32%.google.cloud.oslogin.v1.LoginProfile"\xcf\x01\n\x19UpdateSshPublicKeyRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#oslogin.googleapis.com/SshPublicKey\x12\x46\n\x0essh_public_key\x18\x02 \x01(\x0b\x32).google.cloud.oslogin.common.SshPublicKeyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask2\xd0\t\n\x0eOsLoginService\x12\x8e\x01\n\x12\x44\x65letePosixAccount\x12\x32.google.cloud.oslogin.v1.DeletePosixAccountRequest\x1a\x16.google.protobuf.Empty",\x82\xd3\xe4\x93\x02\x1f*\x1d/v1/{name=users/*/projects/*}\xda\x41\x04name\x12\x93\x01\n\x12\x44\x65leteSshPublicKey\x12\x32.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest\x1a\x16.google.protobuf.Empty"1\x82\xd3\xe4\x93\x02$*"/v1/{name=users/*/sshPublicKeys/*}\xda\x41\x04name\x12\x99\x01\n\x0fGetLoginProfile\x12/.google.cloud.oslogin.v1.GetLoginProfileRequest\x1a%.google.cloud.oslogin.v1.LoginProfile".\x82\xd3\xe4\x93\x02!\x12\x1f/v1/{name=users/*}/loginProfile\xda\x41\x04name\x12\xa0\x01\n\x0fGetSshPublicKey\x12/.google.cloud.oslogin.v1.GetSshPublicKeyRequest\x1a).google.cloud.oslogin.common.SshPublicKey"1\x82\xd3\xe4\x93\x02$\x12"/v1/{name=users/*/sshPublicKeys/*}\xda\x41\x04name\x12\xf9\x01\n\x12ImportSshPublicKey\x12\x32.google.cloud.oslogin.v1.ImportSshPublicKeyRequest\x1a\x33.google.cloud.oslogin.v1.ImportSshPublicKeyResponse"z\x82\xd3\xe4\x93\x02\x39"\'/v1/{parent=users/*}:importSshPublicKey:\x0essh_public_key\xda\x41\x15parent,ssh_public_key\xda\x41 parent,ssh_public_key,project_id\x12\xe7\x01\n\x12UpdateSshPublicKey\x12\x32.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest\x1a).google.cloud.oslogin.common.SshPublicKey"r\x82\xd3\xe4\x93\x02\x34\x32"/v1/{name=users/*/sshPublicKeys/*}:\x0essh_public_key\xda\x41\x13name,ssh_public_key\xda\x41\x1fname,ssh_public_key,update_mask\x1ar\xca\x41\x16oslogin.googleapis.com\xd2\x41Vhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/computeB\xa1\x01\n\x1b\x63om.google.cloud.oslogin.v1B\x0cOsLoginProtoP\x01Z>google.golang.org/genproto/googleapis/cloud/oslogin/v1;oslogin\xaa\x02\x17Google.Cloud.OsLogin.V1\xca\x02\x17Google\\Cloud\\OsLogin\\V1b\x06proto3' ), dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_client__pb2.DESCRIPTOR, + google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, + google_dot_api_dot_resource__pb2.DESCRIPTOR, google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2.DESCRIPTOR, google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, @@ -93,8 +100,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=407, - serialized_end=502, + serialized_start=478, + serialized_end=573, ) _LOGINPROFILE = _descriptor.Descriptor( @@ -119,7 +126,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -158,24 +165,6 @@ serialized_options=None, file=DESCRIPTOR, ), - _descriptor.FieldDescriptor( - name="suspended", - full_name="google.cloud.oslogin.v1.LoginProfile.suspended", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), ], extensions=[], nested_types=[_LOGINPROFILE_SSHPUBLICKEYSENTRY], @@ -185,8 +174,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=208, - serialized_end=502, + serialized_start=293, + serialized_end=573, ) @@ -212,7 +201,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b( + "\340A\002\372A%\n#oslogin.googleapis.com/PosixAccount" + ), file=DESCRIPTOR, ) ], @@ -224,8 +215,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=504, - serialized_end=545, + serialized_start=575, + serialized_end=661, ) @@ -251,7 +242,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b( + "\340A\002\372A%\n#oslogin.googleapis.com/SshPublicKey" + ), file=DESCRIPTOR, ) ], @@ -263,8 +256,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=547, - serialized_end=588, + serialized_start=663, + serialized_end=749, ) @@ -290,9 +283,47 @@ containing_type=None, is_extension=False, extension_scope=None, + serialized_options=_b( + "\340A\002\372A%\022#oslogin.googleapis.com/PosixAccount" + ), + file=DESCRIPTOR, + ), + _descriptor.FieldDescriptor( + name="project_id", + full_name="google.cloud.oslogin.v1.GetLoginProfileRequest.project_id", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + ), + _descriptor.FieldDescriptor( + name="system_id", + full_name="google.cloud.oslogin.v1.GetLoginProfileRequest.system_id", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=_b("").decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + ), ], extensions=[], nested_types=[], @@ -302,8 +333,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=590, - serialized_end=628, + serialized_start=751, + serialized_end=873, ) @@ -329,7 +360,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b( + "\340A\002\372A%\n#oslogin.googleapis.com/SshPublicKey" + ), file=DESCRIPTOR, ) ], @@ -341,8 +374,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=630, - serialized_end=668, + serialized_start=875, + serialized_end=958, ) @@ -368,7 +401,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b( + "\340A\002\372A%\022#oslogin.googleapis.com/SshPublicKey" + ), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -386,7 +421,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\001"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -416,8 +451,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=671, - serialized_end=801, + serialized_start=961, + serialized_end=1141, ) @@ -455,8 +490,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=803, - serialized_end=893, + serialized_start=1143, + serialized_end=1233, ) @@ -482,7 +517,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b( + "\340A\002\372A%\n#oslogin.googleapis.com/SshPublicKey" + ), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -500,7 +537,7 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=None, + serialized_options=_b("\340A\002"), file=DESCRIPTOR, ), _descriptor.FieldDescriptor( @@ -530,8 +567,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=896, - serialized_end=1053, + serialized_start=1236, + serialized_end=1443, ) _LOGINPROFILE_SSHPUBLICKEYSENTRY.fields_by_name[ @@ -595,15 +632,12 @@ Attributes: name: - The primary email address that uniquely identifies the user. + Required. A unique user ID. posix_accounts: The list of POSIX accounts associated with the user. ssh_public_keys: A map from SSH public key fingerprint to the associated key object. - suspended: - Indicates if the user is suspended. A suspended user cannot - log in but their profile information is retained. """, # @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1.LoginProfile) ), @@ -622,9 +656,9 @@ Attributes: name: - 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 + 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}``. """, # @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1.DeletePosixAccountRequest) @@ -643,9 +677,9 @@ Attributes: name: - 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 + 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}``. """, # @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1.DeleteSshPublicKeyRequest) @@ -665,7 +699,12 @@ Attributes: name: - The unique ID for the user in format ``users/{user}``. + Required. The unique ID for the user in format + ``users/{user}``. + project_id: + The project ID of the Google Cloud Platform project. + system_id: + A system ID for filtering the results of the request. """, # @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1.GetLoginProfileRequest) ), @@ -683,9 +722,9 @@ Attributes: name: - 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 + 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}``. """, # @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1.GetSshPublicKeyRequest) @@ -704,9 +743,10 @@ Attributes: parent: - The unique ID for the user in format ``users/{user}``. + Required. The unique ID for the user in format + ``users/{user}``. ssh_public_key: - The SSH public key and expiration time. + Optional. The SSH public key and expiration time. project_id: The project ID of the Google Cloud Platform project. """, @@ -744,12 +784,12 @@ Attributes: name: - 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 + 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}``. ssh_public_key: - The SSH public key and expiration time. + Required. The SSH public key and expiration time. update_mask: Mask to control which fields get updated. Updates all if not present. @@ -762,15 +802,26 @@ DESCRIPTOR._options = None _LOGINPROFILE_SSHPUBLICKEYSENTRY._options = None +_LOGINPROFILE.fields_by_name["name"]._options = None +_DELETEPOSIXACCOUNTREQUEST.fields_by_name["name"]._options = None +_DELETESSHPUBLICKEYREQUEST.fields_by_name["name"]._options = None +_GETLOGINPROFILEREQUEST.fields_by_name["name"]._options = None +_GETSSHPUBLICKEYREQUEST.fields_by_name["name"]._options = None +_IMPORTSSHPUBLICKEYREQUEST.fields_by_name["parent"]._options = None +_IMPORTSSHPUBLICKEYREQUEST.fields_by_name["ssh_public_key"]._options = None +_UPDATESSHPUBLICKEYREQUEST.fields_by_name["name"]._options = None +_UPDATESSHPUBLICKEYREQUEST.fields_by_name["ssh_public_key"]._options = None _OSLOGINSERVICE = _descriptor.ServiceDescriptor( name="OsLoginService", full_name="google.cloud.oslogin.v1.OsLoginService", file=DESCRIPTOR, index=0, - serialized_options=None, - serialized_start=1056, - serialized_end=2029, + serialized_options=_b( + "\312A\026oslogin.googleapis.com\322AVhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/compute" + ), + serialized_start=1446, + serialized_end=2678, methods=[ _descriptor.MethodDescriptor( name="DeletePosixAccount", @@ -780,7 +831,7 @@ input_type=_DELETEPOSIXACCOUNTREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, serialized_options=_b( - "\202\323\344\223\002\037*\035/v1/{name=users/*/projects/*}" + "\202\323\344\223\002\037*\035/v1/{name=users/*/projects/*}\332A\004name" ), ), _descriptor.MethodDescriptor( @@ -791,7 +842,7 @@ input_type=_DELETESSHPUBLICKEYREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, serialized_options=_b( - '\202\323\344\223\002$*"/v1/{name=users/*/sshPublicKeys/*}' + '\202\323\344\223\002$*"/v1/{name=users/*/sshPublicKeys/*}\332A\004name' ), ), _descriptor.MethodDescriptor( @@ -802,7 +853,7 @@ input_type=_GETLOGINPROFILEREQUEST, output_type=_LOGINPROFILE, serialized_options=_b( - "\202\323\344\223\002!\022\037/v1/{name=users/*}/loginProfile" + "\202\323\344\223\002!\022\037/v1/{name=users/*}/loginProfile\332A\004name" ), ), _descriptor.MethodDescriptor( @@ -813,7 +864,7 @@ input_type=_GETSSHPUBLICKEYREQUEST, output_type=google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2._SSHPUBLICKEY, serialized_options=_b( - '\202\323\344\223\002$\022"/v1/{name=users/*/sshPublicKeys/*}' + '\202\323\344\223\002$\022"/v1/{name=users/*/sshPublicKeys/*}\332A\004name' ), ), _descriptor.MethodDescriptor( @@ -824,7 +875,7 @@ input_type=_IMPORTSSHPUBLICKEYREQUEST, output_type=_IMPORTSSHPUBLICKEYRESPONSE, serialized_options=_b( - "\202\323\344\223\0029\"'/v1/{parent=users/*}:importSshPublicKey:\016ssh_public_key" + "\202\323\344\223\0029\"'/v1/{parent=users/*}:importSshPublicKey:\016ssh_public_key\332A\025parent,ssh_public_key\332A parent,ssh_public_key,project_id" ), ), _descriptor.MethodDescriptor( @@ -835,7 +886,7 @@ input_type=_UPDATESSHPUBLICKEYREQUEST, output_type=google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2._SSHPUBLICKEY, serialized_options=_b( - '\202\323\344\223\00242"/v1/{name=users/*/sshPublicKeys/*}:\016ssh_public_key' + '\202\323\344\223\00242"/v1/{name=users/*/sshPublicKeys/*}:\016ssh_public_key\332A\023name,ssh_public_key\332A\037name,ssh_public_key,update_mask' ), ), ], diff --git a/google/cloud/oslogin_v1/proto/oslogin_v1/proto/__init__.py b/google/cloud/oslogin_v1/proto/oslogin_v1/proto/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/google/cloud/oslogin_v1/proto/oslogin_v1/proto/oslogin_pb2.py b/google/cloud/oslogin_v1/proto/oslogin_v1/proto/oslogin_pb2.py deleted file mode 100644 index 11ba220..0000000 --- a/google/cloud/oslogin_v1/proto/oslogin_v1/proto/oslogin_pb2.py +++ /dev/null @@ -1,848 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/oslogin_v1/proto/oslogin.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.oslogin_v1.proto import ( - common_pb2 as google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/oslogin_v1/proto/oslogin.proto", - package="google.cloud.oslogin.v1", - syntax="proto3", - serialized_options=_b( - "\n\033com.google.cloud.oslogin.v1B\014OsLoginProtoP\001Z>google.golang.org/genproto/googleapis/cloud/oslogin/v1;oslogin\252\002\027Google.Cloud.OsLogin.V1\312\002\027Google\\Cloud\\OsLogin\\V1" - ), - serialized_pb=_b( - '\n+google/cloud/oslogin_v1/proto/oslogin.proto\x12\x17google.cloud.oslogin.v1\x1a\x1cgoogle/api/annotations.proto\x1a(google/cloud/oslogin/common/common.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\xa6\x02\n\x0cLoginProfile\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x41\n\x0eposix_accounts\x18\x02 \x03(\x0b\x32).google.cloud.oslogin.common.PosixAccount\x12Q\n\x0fssh_public_keys\x18\x03 \x03(\x0b\x32\x38.google.cloud.oslogin.v1.LoginProfile.SshPublicKeysEntry\x12\x11\n\tsuspended\x18\x04 \x01(\x08\x1a_\n\x12SshPublicKeysEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).google.cloud.oslogin.common.SshPublicKey:\x02\x38\x01")\n\x19\x44\x65letePosixAccountRequest\x12\x0c\n\x04name\x18\x01 \x01(\t")\n\x19\x44\x65leteSshPublicKeyRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"&\n\x16GetLoginProfileRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"&\n\x16GetSshPublicKeyRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\x82\x01\n\x19ImportSshPublicKeyRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x41\n\x0essh_public_key\x18\x02 \x01(\x0b\x32).google.cloud.oslogin.common.SshPublicKey\x12\x12\n\nproject_id\x18\x03 \x01(\t"Z\n\x1aImportSshPublicKeyResponse\x12<\n\rlogin_profile\x18\x01 \x01(\x0b\x32%.google.cloud.oslogin.v1.LoginProfile"\x9d\x01\n\x19UpdateSshPublicKeyRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x41\n\x0essh_public_key\x18\x02 \x01(\x0b\x32).google.cloud.oslogin.common.SshPublicKey\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask2\xcd\x07\n\x0eOsLoginService\x12\x87\x01\n\x12\x44\x65letePosixAccount\x12\x32.google.cloud.oslogin.v1.DeletePosixAccountRequest\x1a\x16.google.protobuf.Empty"%\x82\xd3\xe4\x93\x02\x1f*\x1d/v1/{name=users/*/projects/*}\x12\x8c\x01\n\x12\x44\x65leteSshPublicKey\x12\x32.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest\x1a\x16.google.protobuf.Empty"*\x82\xd3\xe4\x93\x02$*"/v1/{name=users/*/sshPublicKeys/*}\x12\x92\x01\n\x0fGetLoginProfile\x12/.google.cloud.oslogin.v1.GetLoginProfileRequest\x1a%.google.cloud.oslogin.v1.LoginProfile"\'\x82\xd3\xe4\x93\x02!\x12\x1f/v1/{name=users/*}/loginProfile\x12\x99\x01\n\x0fGetSshPublicKey\x12/.google.cloud.oslogin.v1.GetSshPublicKeyRequest\x1a).google.cloud.oslogin.common.SshPublicKey"*\x82\xd3\xe4\x93\x02$\x12"/v1/{name=users/*/sshPublicKeys/*}\x12\xbe\x01\n\x12ImportSshPublicKey\x12\x32.google.cloud.oslogin.v1.ImportSshPublicKeyRequest\x1a\x33.google.cloud.oslogin.v1.ImportSshPublicKeyResponse"?\x82\xd3\xe4\x93\x02\x39"\'/v1/{parent=users/*}:importSshPublicKey:\x0essh_public_key\x12\xaf\x01\n\x12UpdateSshPublicKey\x12\x32.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest\x1a).google.cloud.oslogin.common.SshPublicKey":\x82\xd3\xe4\x93\x02\x34\x32"/v1/{name=users/*/sshPublicKeys/*}:\x0essh_public_keyB\xa1\x01\n\x1b\x63om.google.cloud.oslogin.v1B\x0cOsLoginProtoP\x01Z>google.golang.org/genproto/googleapis/cloud/oslogin/v1;oslogin\xaa\x02\x17Google.Cloud.OsLogin.V1\xca\x02\x17Google\\Cloud\\OsLogin\\V1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - ], -) - - -_LOGINPROFILE_SSHPUBLICKEYSENTRY = _descriptor.Descriptor( - name="SshPublicKeysEntry", - full_name="google.cloud.oslogin.v1.LoginProfile.SshPublicKeysEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.oslogin.v1.LoginProfile.SshPublicKeysEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.oslogin.v1.LoginProfile.SshPublicKeysEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=407, - serialized_end=502, -) - -_LOGINPROFILE = _descriptor.Descriptor( - name="LoginProfile", - full_name="google.cloud.oslogin.v1.LoginProfile", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.oslogin.v1.LoginProfile.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="posix_accounts", - full_name="google.cloud.oslogin.v1.LoginProfile.posix_accounts", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ssh_public_keys", - full_name="google.cloud.oslogin.v1.LoginProfile.ssh_public_keys", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="suspended", - full_name="google.cloud.oslogin.v1.LoginProfile.suspended", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_LOGINPROFILE_SSHPUBLICKEYSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=208, - serialized_end=502, -) - - -_DELETEPOSIXACCOUNTREQUEST = _descriptor.Descriptor( - name="DeletePosixAccountRequest", - full_name="google.cloud.oslogin.v1.DeletePosixAccountRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.oslogin.v1.DeletePosixAccountRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=504, - serialized_end=545, -) - - -_DELETESSHPUBLICKEYREQUEST = _descriptor.Descriptor( - name="DeleteSshPublicKeyRequest", - full_name="google.cloud.oslogin.v1.DeleteSshPublicKeyRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.oslogin.v1.DeleteSshPublicKeyRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=547, - serialized_end=588, -) - - -_GETLOGINPROFILEREQUEST = _descriptor.Descriptor( - name="GetLoginProfileRequest", - full_name="google.cloud.oslogin.v1.GetLoginProfileRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.oslogin.v1.GetLoginProfileRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=590, - serialized_end=628, -) - - -_GETSSHPUBLICKEYREQUEST = _descriptor.Descriptor( - name="GetSshPublicKeyRequest", - full_name="google.cloud.oslogin.v1.GetSshPublicKeyRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.oslogin.v1.GetSshPublicKeyRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=630, - serialized_end=668, -) - - -_IMPORTSSHPUBLICKEYREQUEST = _descriptor.Descriptor( - name="ImportSshPublicKeyRequest", - full_name="google.cloud.oslogin.v1.ImportSshPublicKeyRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.oslogin.v1.ImportSshPublicKeyRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ssh_public_key", - full_name="google.cloud.oslogin.v1.ImportSshPublicKeyRequest.ssh_public_key", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.cloud.oslogin.v1.ImportSshPublicKeyRequest.project_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=671, - serialized_end=801, -) - - -_IMPORTSSHPUBLICKEYRESPONSE = _descriptor.Descriptor( - name="ImportSshPublicKeyResponse", - full_name="google.cloud.oslogin.v1.ImportSshPublicKeyResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="login_profile", - full_name="google.cloud.oslogin.v1.ImportSshPublicKeyResponse.login_profile", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=803, - serialized_end=893, -) - - -_UPDATESSHPUBLICKEYREQUEST = _descriptor.Descriptor( - name="UpdateSshPublicKeyRequest", - full_name="google.cloud.oslogin.v1.UpdateSshPublicKeyRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.oslogin.v1.UpdateSshPublicKeyRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ssh_public_key", - full_name="google.cloud.oslogin.v1.UpdateSshPublicKeyRequest.ssh_public_key", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.oslogin.v1.UpdateSshPublicKeyRequest.update_mask", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=896, - serialized_end=1053, -) - -_LOGINPROFILE_SSHPUBLICKEYSENTRY.fields_by_name[ - "value" -].message_type = google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2._SSHPUBLICKEY -_LOGINPROFILE_SSHPUBLICKEYSENTRY.containing_type = _LOGINPROFILE -_LOGINPROFILE.fields_by_name[ - "posix_accounts" -].message_type = google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2._POSIXACCOUNT -_LOGINPROFILE.fields_by_name[ - "ssh_public_keys" -].message_type = _LOGINPROFILE_SSHPUBLICKEYSENTRY -_IMPORTSSHPUBLICKEYREQUEST.fields_by_name[ - "ssh_public_key" -].message_type = google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2._SSHPUBLICKEY -_IMPORTSSHPUBLICKEYRESPONSE.fields_by_name["login_profile"].message_type = _LOGINPROFILE -_UPDATESSHPUBLICKEYREQUEST.fields_by_name[ - "ssh_public_key" -].message_type = google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2._SSHPUBLICKEY -_UPDATESSHPUBLICKEYREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -DESCRIPTOR.message_types_by_name["LoginProfile"] = _LOGINPROFILE -DESCRIPTOR.message_types_by_name[ - "DeletePosixAccountRequest" -] = _DELETEPOSIXACCOUNTREQUEST -DESCRIPTOR.message_types_by_name[ - "DeleteSshPublicKeyRequest" -] = _DELETESSHPUBLICKEYREQUEST -DESCRIPTOR.message_types_by_name["GetLoginProfileRequest"] = _GETLOGINPROFILEREQUEST -DESCRIPTOR.message_types_by_name["GetSshPublicKeyRequest"] = _GETSSHPUBLICKEYREQUEST -DESCRIPTOR.message_types_by_name[ - "ImportSshPublicKeyRequest" -] = _IMPORTSSHPUBLICKEYREQUEST -DESCRIPTOR.message_types_by_name[ - "ImportSshPublicKeyResponse" -] = _IMPORTSSHPUBLICKEYRESPONSE -DESCRIPTOR.message_types_by_name[ - "UpdateSshPublicKeyRequest" -] = _UPDATESSHPUBLICKEYREQUEST -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -LoginProfile = _reflection.GeneratedProtocolMessageType( - "LoginProfile", - (_message.Message,), - dict( - SshPublicKeysEntry=_reflection.GeneratedProtocolMessageType( - "SshPublicKeysEntry", - (_message.Message,), - dict( - DESCRIPTOR=_LOGINPROFILE_SSHPUBLICKEYSENTRY, - __module__="google.cloud.oslogin_v1.proto.oslogin_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1.LoginProfile.SshPublicKeysEntry) - ), - ), - DESCRIPTOR=_LOGINPROFILE, - __module__="google.cloud.oslogin_v1.proto.oslogin_pb2", - __doc__="""The user profile information used for logging in to a virtual machine on - Google Compute Engine. - - - Attributes: - name: - The primary email address that uniquely identifies the user. - posix_accounts: - The list of POSIX accounts associated with the user. - ssh_public_keys: - A map from SSH public key fingerprint to the associated key - object. - suspended: - Indicates if the user is suspended. A suspended user cannot - log in but their profile information is retained. - """, - # @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1.LoginProfile) - ), -) -_sym_db.RegisterMessage(LoginProfile) -_sym_db.RegisterMessage(LoginProfile.SshPublicKeysEntry) - -DeletePosixAccountRequest = _reflection.GeneratedProtocolMessageType( - "DeletePosixAccountRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEPOSIXACCOUNTREQUEST, - __module__="google.cloud.oslogin_v1.proto.oslogin_pb2", - __doc__="""A request message for deleting a POSIX account entry. - - - Attributes: - name: - 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}``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1.DeletePosixAccountRequest) - ), -) -_sym_db.RegisterMessage(DeletePosixAccountRequest) - -DeleteSshPublicKeyRequest = _reflection.GeneratedProtocolMessageType( - "DeleteSshPublicKeyRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETESSHPUBLICKEYREQUEST, - __module__="google.cloud.oslogin_v1.proto.oslogin_pb2", - __doc__="""A request message for deleting an SSH public key. - - - Attributes: - name: - 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}``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1.DeleteSshPublicKeyRequest) - ), -) -_sym_db.RegisterMessage(DeleteSshPublicKeyRequest) - -GetLoginProfileRequest = _reflection.GeneratedProtocolMessageType( - "GetLoginProfileRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETLOGINPROFILEREQUEST, - __module__="google.cloud.oslogin_v1.proto.oslogin_pb2", - __doc__="""A request message for retrieving the login profile information for a - user. - - - Attributes: - name: - The unique ID for the user in format ``users/{user}``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1.GetLoginProfileRequest) - ), -) -_sym_db.RegisterMessage(GetLoginProfileRequest) - -GetSshPublicKeyRequest = _reflection.GeneratedProtocolMessageType( - "GetSshPublicKeyRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETSSHPUBLICKEYREQUEST, - __module__="google.cloud.oslogin_v1.proto.oslogin_pb2", - __doc__="""A request message for retrieving an SSH public key. - - - Attributes: - name: - 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}``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1.GetSshPublicKeyRequest) - ), -) -_sym_db.RegisterMessage(GetSshPublicKeyRequest) - -ImportSshPublicKeyRequest = _reflection.GeneratedProtocolMessageType( - "ImportSshPublicKeyRequest", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTSSHPUBLICKEYREQUEST, - __module__="google.cloud.oslogin_v1.proto.oslogin_pb2", - __doc__="""A request message for importing an SSH public key. - - - Attributes: - parent: - The unique ID for the user in format ``users/{user}``. - ssh_public_key: - The SSH public key and expiration time. - project_id: - The project ID of the Google Cloud Platform project. - """, - # @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1.ImportSshPublicKeyRequest) - ), -) -_sym_db.RegisterMessage(ImportSshPublicKeyRequest) - -ImportSshPublicKeyResponse = _reflection.GeneratedProtocolMessageType( - "ImportSshPublicKeyResponse", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTSSHPUBLICKEYRESPONSE, - __module__="google.cloud.oslogin_v1.proto.oslogin_pb2", - __doc__="""A response message for importing an SSH public key. - - - Attributes: - login_profile: - The login profile information for the user. - """, - # @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1.ImportSshPublicKeyResponse) - ), -) -_sym_db.RegisterMessage(ImportSshPublicKeyResponse) - -UpdateSshPublicKeyRequest = _reflection.GeneratedProtocolMessageType( - "UpdateSshPublicKeyRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATESSHPUBLICKEYREQUEST, - __module__="google.cloud.oslogin_v1.proto.oslogin_pb2", - __doc__="""A request message for updating an SSH public key. - - - Attributes: - name: - 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}``. - ssh_public_key: - The SSH public key and expiration time. - update_mask: - Mask to control which fields get updated. Updates all if not - present. - """, - # @@protoc_insertion_point(class_scope:google.cloud.oslogin.v1.UpdateSshPublicKeyRequest) - ), -) -_sym_db.RegisterMessage(UpdateSshPublicKeyRequest) - - -DESCRIPTOR._options = None -_LOGINPROFILE_SSHPUBLICKEYSENTRY._options = None - -_OSLOGINSERVICE = _descriptor.ServiceDescriptor( - name="OsLoginService", - full_name="google.cloud.oslogin.v1.OsLoginService", - file=DESCRIPTOR, - index=0, - serialized_options=None, - serialized_start=1056, - serialized_end=2029, - methods=[ - _descriptor.MethodDescriptor( - name="DeletePosixAccount", - full_name="google.cloud.oslogin.v1.OsLoginService.DeletePosixAccount", - index=0, - containing_service=None, - input_type=_DELETEPOSIXACCOUNTREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002\037*\035/v1/{name=users/*/projects/*}" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteSshPublicKey", - full_name="google.cloud.oslogin.v1.OsLoginService.DeleteSshPublicKey", - index=1, - containing_service=None, - input_type=_DELETESSHPUBLICKEYREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\002$*"/v1/{name=users/*/sshPublicKeys/*}' - ), - ), - _descriptor.MethodDescriptor( - name="GetLoginProfile", - full_name="google.cloud.oslogin.v1.OsLoginService.GetLoginProfile", - index=2, - containing_service=None, - input_type=_GETLOGINPROFILEREQUEST, - output_type=_LOGINPROFILE, - serialized_options=_b( - "\202\323\344\223\002!\022\037/v1/{name=users/*}/loginProfile" - ), - ), - _descriptor.MethodDescriptor( - name="GetSshPublicKey", - full_name="google.cloud.oslogin.v1.OsLoginService.GetSshPublicKey", - index=3, - containing_service=None, - input_type=_GETSSHPUBLICKEYREQUEST, - output_type=google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2._SSHPUBLICKEY, - serialized_options=_b( - '\202\323\344\223\002$\022"/v1/{name=users/*/sshPublicKeys/*}' - ), - ), - _descriptor.MethodDescriptor( - name="ImportSshPublicKey", - full_name="google.cloud.oslogin.v1.OsLoginService.ImportSshPublicKey", - index=4, - containing_service=None, - input_type=_IMPORTSSHPUBLICKEYREQUEST, - output_type=_IMPORTSSHPUBLICKEYRESPONSE, - serialized_options=_b( - "\202\323\344\223\0029\"'/v1/{parent=users/*}:importSshPublicKey:\016ssh_public_key" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateSshPublicKey", - full_name="google.cloud.oslogin.v1.OsLoginService.UpdateSshPublicKey", - index=5, - containing_service=None, - input_type=_UPDATESSHPUBLICKEYREQUEST, - output_type=google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2._SSHPUBLICKEY, - serialized_options=_b( - '\202\323\344\223\00242"/v1/{name=users/*/sshPublicKeys/*}:\016ssh_public_key' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_OSLOGINSERVICE) - -DESCRIPTOR.services_by_name["OsLoginService"] = _OSLOGINSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/google/cloud/oslogin_v1/proto/oslogin_v1/proto/oslogin_pb2_grpc.py b/google/cloud/oslogin_v1/proto/oslogin_v1/proto/oslogin_pb2_grpc.py deleted file mode 100644 index 6b00266..0000000 --- a/google/cloud/oslogin_v1/proto/oslogin_v1/proto/oslogin_pb2_grpc.py +++ /dev/null @@ -1,148 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.oslogin_v1.proto import ( - common_pb2 as google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2, -) -from google.cloud.oslogin_v1.proto import ( - oslogin_pb2 as google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class OsLoginServiceStub(object): - """Cloud OS Login API - - The Cloud OS Login API allows you to manage users and their associated SSH - public keys for logging into virtual machines on Google Cloud Platform. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.DeletePosixAccount = channel.unary_unary( - "/google.cloud.oslogin.v1.OsLoginService/DeletePosixAccount", - request_serializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.DeletePosixAccountRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.DeleteSshPublicKey = channel.unary_unary( - "/google.cloud.oslogin.v1.OsLoginService/DeleteSshPublicKey", - request_serializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.DeleteSshPublicKeyRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.GetLoginProfile = channel.unary_unary( - "/google.cloud.oslogin.v1.OsLoginService/GetLoginProfile", - request_serializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.GetLoginProfileRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.LoginProfile.FromString, - ) - self.GetSshPublicKey = channel.unary_unary( - "/google.cloud.oslogin.v1.OsLoginService/GetSshPublicKey", - request_serializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.GetSshPublicKeyRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2.SshPublicKey.FromString, - ) - self.ImportSshPublicKey = channel.unary_unary( - "/google.cloud.oslogin.v1.OsLoginService/ImportSshPublicKey", - request_serializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.ImportSshPublicKeyRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.ImportSshPublicKeyResponse.FromString, - ) - self.UpdateSshPublicKey = channel.unary_unary( - "/google.cloud.oslogin.v1.OsLoginService/UpdateSshPublicKey", - request_serializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.UpdateSshPublicKeyRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2.SshPublicKey.FromString, - ) - - -class OsLoginServiceServicer(object): - """Cloud OS Login API - - The Cloud OS Login API allows you to manage users and their associated SSH - public keys for logging into virtual machines on Google Cloud Platform. - """ - - def DeletePosixAccount(self, request, context): - """Deletes a POSIX account. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteSshPublicKey(self, request, context): - """Deletes an SSH public key. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetLoginProfile(self, request, context): - """Retrieves the profile information used for logging in to a virtual machine - on Google Compute Engine. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetSshPublicKey(self, request, context): - """Retrieves an SSH public key. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ImportSshPublicKey(self, request, context): - """Adds an SSH public key and returns the profile information. Default POSIX - account information is set when no username and UID exist as part of the - login profile. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateSshPublicKey(self, request, context): - """Updates an SSH public key and returns the profile information. This method - supports patch semantics. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_OsLoginServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "DeletePosixAccount": grpc.unary_unary_rpc_method_handler( - servicer.DeletePosixAccount, - request_deserializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.DeletePosixAccountRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "DeleteSshPublicKey": grpc.unary_unary_rpc_method_handler( - servicer.DeleteSshPublicKey, - request_deserializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.DeleteSshPublicKeyRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "GetLoginProfile": grpc.unary_unary_rpc_method_handler( - servicer.GetLoginProfile, - request_deserializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.GetLoginProfileRequest.FromString, - response_serializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.LoginProfile.SerializeToString, - ), - "GetSshPublicKey": grpc.unary_unary_rpc_method_handler( - servicer.GetSshPublicKey, - request_deserializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.GetSshPublicKeyRequest.FromString, - response_serializer=google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2.SshPublicKey.SerializeToString, - ), - "ImportSshPublicKey": grpc.unary_unary_rpc_method_handler( - servicer.ImportSshPublicKey, - request_deserializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.ImportSshPublicKeyRequest.FromString, - response_serializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.ImportSshPublicKeyResponse.SerializeToString, - ), - "UpdateSshPublicKey": grpc.unary_unary_rpc_method_handler( - servicer.UpdateSshPublicKey, - request_deserializer=google_dot_cloud_dot_oslogin__v1_dot_proto_dot_oslogin__pb2.UpdateSshPublicKeyRequest.FromString, - response_serializer=google_dot_cloud_dot_oslogin_dot_common_dot_common__pb2.SshPublicKey.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.oslogin.v1.OsLoginService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/synth.metadata b/synth.metadata index 56d7ccd..cb189d0 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-08-06T12:33:01.454928Z", + "updateTime": "2019-10-25T21:10:32.534388Z", "sources": [ { "generator": { "name": "artman", - "version": "0.32.1", - "dockerImage": "googleapis/artman@sha256:a684d40ba9a4e15946f5f2ca6b4bd9fe301192f522e9de4fff622118775f309b" + "version": "0.40.2", + "dockerImage": "googleapis/artman@sha256:3b8f7d9b4c206843ce08053474f5c64ae4d388ff7d995e68b59fb65edf73eeb9" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e699b0cba64ffddfae39633417180f1f65875896", - "internalRef": "261759677" + "sha": "d27a44798506d28e8e6d874bd128da43f45f74c4", + "internalRef": "276716410" } }, { "template": { "name": "python_library", "origin": "synthtool.gcp", - "version": "2019.5.2" + "version": "2019.10.17" } } ], diff --git a/synth.py b/synth.py index 7e76e18..4bcb94c 100644 --- a/synth.py +++ b/synth.py @@ -29,9 +29,20 @@ artman_output_name="os-login-v1", include_protos=True, ) +# pb2's are incorrectly generated into deeper directories, so copy separately into proto/ +s.move( + library, + excludes=[ + "nox.py", + "setup.py", + "README.rst", + "docs/index.rst", + "**/proto/oslogin/**", + "**/proto/oslogin_v1/**", + ], +) +s.move(library / "google/cloud/oslogin_v1/proto/**/*", "google/cloud/oslogin_v1/proto") -s.move(library / "google/cloud/oslogin_v1") -s.move(library / "tests/unit/gapic/v1") # Fix up imports s.replace( diff --git a/tests/unit/gapic/v1/test_os_login_service_client_v1.py b/tests/unit/gapic/v1/test_os_login_service_client_v1.py index 18506c0..a912a57 100644 --- a/tests/unit/gapic/v1/test_os_login_service_client_v1.py +++ b/tests/unit/gapic/v1/test_os_login_service_client_v1.py @@ -70,7 +70,7 @@ def test_delete_posix_account(self): client = oslogin_v1.OsLoginServiceClient() # Setup Request - name = client.project_path("[USER]", "[PROJECT]") + name = client.posix_account_path("[USER]", "[PROJECT]") client.delete_posix_account(name) @@ -88,7 +88,7 @@ def test_delete_posix_account_exception(self): client = oslogin_v1.OsLoginServiceClient() # Setup request - name = client.project_path("[USER]", "[PROJECT]") + name = client.posix_account_path("[USER]", "[PROJECT]") with pytest.raises(CustomException): client.delete_posix_account(name) @@ -101,7 +101,7 @@ def test_delete_ssh_public_key(self): client = oslogin_v1.OsLoginServiceClient() # Setup Request - name = client.fingerprint_path("[USER]", "[FINGERPRINT]") + name = client.ssh_public_key_path("[USER]", "[FINGERPRINT]") client.delete_ssh_public_key(name) @@ -119,7 +119,7 @@ def test_delete_ssh_public_key_exception(self): client = oslogin_v1.OsLoginServiceClient() # Setup request - name = client.fingerprint_path("[USER]", "[FINGERPRINT]") + name = client.ssh_public_key_path("[USER]", "[FINGERPRINT]") with pytest.raises(CustomException): client.delete_ssh_public_key(name) @@ -127,8 +127,7 @@ def test_delete_ssh_public_key_exception(self): def test_get_login_profile(self): # Setup Expected Response name_2 = "name2-1052831874" - suspended = False - expected_response = {"name": name_2, "suspended": suspended} + expected_response = {"name": name_2} expected_response = oslogin_pb2.LoginProfile(**expected_response) # Mock the API response @@ -168,10 +167,12 @@ def test_get_ssh_public_key(self): key = "key106079" expiration_time_usec = 2058878882 fingerprint = "fingerprint-1375934236" + name_2 = "name2-1052831874" expected_response = { "key": key, "expiration_time_usec": expiration_time_usec, "fingerprint": fingerprint, + "name": name_2, } expected_response = common_pb2.SshPublicKey(**expected_response) @@ -183,7 +184,7 @@ def test_get_ssh_public_key(self): client = oslogin_v1.OsLoginServiceClient() # Setup Request - name = client.fingerprint_path("[USER]", "[FINGERPRINT]") + name = client.ssh_public_key_path("[USER]", "[FINGERPRINT]") response = client.get_ssh_public_key(name) assert expected_response == response @@ -202,7 +203,7 @@ def test_get_ssh_public_key_exception(self): client = oslogin_v1.OsLoginServiceClient() # Setup request - name = client.fingerprint_path("[USER]", "[FINGERPRINT]") + name = client.ssh_public_key_path("[USER]", "[FINGERPRINT]") with pytest.raises(CustomException): client.get_ssh_public_key(name) @@ -221,15 +222,12 @@ def test_import_ssh_public_key(self): # Setup Request parent = client.user_path("[USER]") - ssh_public_key = {} - response = client.import_ssh_public_key(parent, ssh_public_key) + response = client.import_ssh_public_key(parent) assert expected_response == response assert len(channel.requests) == 1 - expected_request = oslogin_pb2.ImportSshPublicKeyRequest( - parent=parent, ssh_public_key=ssh_public_key - ) + expected_request = oslogin_pb2.ImportSshPublicKeyRequest(parent=parent) actual_request = channel.requests[0][1] assert expected_request == actual_request @@ -243,20 +241,21 @@ def test_import_ssh_public_key_exception(self): # Setup request parent = client.user_path("[USER]") - ssh_public_key = {} with pytest.raises(CustomException): - client.import_ssh_public_key(parent, ssh_public_key) + client.import_ssh_public_key(parent) def test_update_ssh_public_key(self): # Setup Expected Response key = "key106079" expiration_time_usec = 2058878882 fingerprint = "fingerprint-1375934236" + name_2 = "name2-1052831874" expected_response = { "key": key, "expiration_time_usec": expiration_time_usec, "fingerprint": fingerprint, + "name": name_2, } expected_response = common_pb2.SshPublicKey(**expected_response) @@ -268,7 +267,7 @@ def test_update_ssh_public_key(self): client = oslogin_v1.OsLoginServiceClient() # Setup Request - name = client.fingerprint_path("[USER]", "[FINGERPRINT]") + name = client.ssh_public_key_path("[USER]", "[FINGERPRINT]") ssh_public_key = {} response = client.update_ssh_public_key(name, ssh_public_key) @@ -290,7 +289,7 @@ def test_update_ssh_public_key_exception(self): client = oslogin_v1.OsLoginServiceClient() # Setup request - name = client.fingerprint_path("[USER]", "[FINGERPRINT]") + name = client.ssh_public_key_path("[USER]", "[FINGERPRINT]") ssh_public_key = {} with pytest.raises(CustomException):