diff --git a/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1/OsLoginServiceClient.java b/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1/OsLoginServiceClient.java index d5820e66..cb626ae2 100644 --- a/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1/OsLoginServiceClient.java +++ b/google-cloud-os-login/src/main/java/com/google/cloud/oslogin/v1/OsLoginServiceClient.java @@ -38,6 +38,13 @@ *
This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * ProjectName name = ProjectName.of("[USER]", "[PROJECT]"); + * osLoginServiceClient.deletePosixAccount(name); + * } + * }+ * *
Note: close() needs to be called on the OsLoginServiceClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * @@ -84,8 +91,7 @@ * *
Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@BetaApi -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class OsLoginServiceClient implements BackgroundResource { private final OsLoginServiceSettings settings; private final OsLoginServiceStub stub; @@ -142,6 +148,15 @@ public OsLoginServiceStub getStub() { /** * Deletes a POSIX account. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * ProjectName name = ProjectName.of("[USER]", "[PROJECT]"); + * osLoginServiceClient.deletePosixAccount(name); + * } + * }+ * * @param name 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}`. @@ -159,6 +174,15 @@ public final void deletePosixAccount(ProjectName name) { /** * Deletes a POSIX account. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * String name = ProjectName.of("[USER]", "[PROJECT]").toString(); + * osLoginServiceClient.deletePosixAccount(name); + * } + * }+ * * @param name 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}`. @@ -174,6 +198,18 @@ public final void deletePosixAccount(String name) { /** * Deletes a POSIX account. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * DeletePosixAccountRequest request = + * DeletePosixAccountRequest.newBuilder() + * .setName(ProjectName.of("[USER]", "[PROJECT]").toString()) + * .build(); + * osLoginServiceClient.deletePosixAccount(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -186,6 +222,19 @@ public final void deletePosixAccount(DeletePosixAccountRequest request) { * Deletes a POSIX account. * *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * DeletePosixAccountRequest request = + * DeletePosixAccountRequest.newBuilder() + * .setName(ProjectName.of("[USER]", "[PROJECT]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * osLoginServiceClient.deletePosixAccountCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + * osLoginServiceClient.deleteSshPublicKey(name); + * } + * }+ * * @param name 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}`. @@ -212,6 +270,15 @@ public final void deleteSshPublicKey(FingerprintName name) { /** * Deletes an SSH public key. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * String name = FingerprintName.of("[USER]", "[FINGERPRINT]").toString(); + * osLoginServiceClient.deleteSshPublicKey(name); + * } + * }+ * * @param name 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}`. @@ -227,6 +294,18 @@ public final void deleteSshPublicKey(String name) { /** * Deletes an SSH public key. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * DeleteSshPublicKeyRequest request = + * DeleteSshPublicKeyRequest.newBuilder() + * .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + * .build(); + * osLoginServiceClient.deleteSshPublicKey(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -239,6 +318,19 @@ public final void deleteSshPublicKey(DeleteSshPublicKeyRequest request) { * Deletes an SSH public key. * *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * DeleteSshPublicKeyRequest request = + * DeleteSshPublicKeyRequest.newBuilder() + * .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * osLoginServiceClient.deleteSshPublicKeyCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * UserName name = UserName.of("[USER]"); + * LoginProfile response = osLoginServiceClient.getLoginProfile(name); + * } + * }+ * * @param name Required. The unique ID for the user in format `users/{user}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -263,6 +364,15 @@ public final LoginProfile getLoginProfile(UserName name) { * Retrieves the profile information used for logging in to a virtual machine on Google Compute * Engine. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * String name = ProjectName.of("[USER]", "[PROJECT]").toString(); + * LoginProfile response = osLoginServiceClient.getLoginProfile(name); + * } + * }+ * * @param name Required. The unique ID for the user in format `users/{user}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -276,6 +386,20 @@ public final LoginProfile getLoginProfile(String name) { * Retrieves the profile information used for logging in to a virtual machine on Google Compute * Engine. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * GetLoginProfileRequest request = + * GetLoginProfileRequest.newBuilder() + * .setName(ProjectName.of("[USER]", "[PROJECT]").toString()) + * .setProjectId("projectId-894832108") + * .setSystemId("systemId1976085418") + * .build(); + * LoginProfile response = osLoginServiceClient.getLoginProfile(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -289,6 +413,21 @@ public final LoginProfile getLoginProfile(GetLoginProfileRequest request) { * Engine. * *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * GetLoginProfileRequest request = + * GetLoginProfileRequest.newBuilder() + * .setName(ProjectName.of("[USER]", "[PROJECT]").toString()) + * .setProjectId("projectId-894832108") + * .setSystemId("systemId1976085418") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * osLoginServiceClient.getLoginProfileCallable().futureCall(request); + * // Do something. + * LoginProfile response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + * OsLoginProto.SshPublicKey response = osLoginServiceClient.getSshPublicKey(name); + * } + * }+ * * @param name 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}`. @@ -313,6 +461,15 @@ public final OsLoginProto.SshPublicKey getSshPublicKey(FingerprintName name) { /** * Retrieves an SSH public key. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * String name = FingerprintName.of("[USER]", "[FINGERPRINT]").toString(); + * OsLoginProto.SshPublicKey response = osLoginServiceClient.getSshPublicKey(name); + * } + * }+ * * @param name 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}`. @@ -327,6 +484,18 @@ public final OsLoginProto.SshPublicKey getSshPublicKey(String name) { /** * Retrieves an SSH public key. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * GetSshPublicKeyRequest request = + * GetSshPublicKeyRequest.newBuilder() + * .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + * .build(); + * OsLoginProto.SshPublicKey response = osLoginServiceClient.getSshPublicKey(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -339,6 +508,19 @@ public final OsLoginProto.SshPublicKey getSshPublicKey(GetSshPublicKeyRequest re * Retrieves an SSH public key. * *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * GetSshPublicKeyRequest request = + * GetSshPublicKeyRequest.newBuilder() + * .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * osLoginServiceClient.getSshPublicKeyCallable().futureCall(request); + * // Do something. + * OsLoginProto.SshPublicKey response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * UserName parent = UserName.of("[USER]"); + * OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + * ImportSshPublicKeyResponse response = + * osLoginServiceClient.importSshPublicKey(parent, sshPublicKey); + * } + * }+ * * @param parent Required. The unique ID for the user in format `users/{user}`. * @param sshPublicKey Optional. The SSH public key and expiration time. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -369,6 +562,17 @@ public final ImportSshPublicKeyResponse importSshPublicKey( * 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. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * String parent = FingerprintName.of("[USER]", "[FINGERPRINT]").toString(); + * OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + * ImportSshPublicKeyResponse response = + * osLoginServiceClient.importSshPublicKey(parent, sshPublicKey); + * } + * }+ * * @param parent Required. The unique ID for the user in format `users/{user}`. * @param sshPublicKey Optional. The SSH public key and expiration time. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -388,6 +592,18 @@ public final ImportSshPublicKeyResponse importSshPublicKey( * 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. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * UserName parent = UserName.of("[USER]"); + * OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + * String projectId = "projectId-894832108"; + * ImportSshPublicKeyResponse response = + * osLoginServiceClient.importSshPublicKey(parent, sshPublicKey, projectId); + * } + * }+ * * @param parent Required. The unique ID for the user in format `users/{user}`. * @param sshPublicKey Optional. The SSH public key and expiration time. * @param projectId The project ID of the Google Cloud Platform project. @@ -409,6 +625,18 @@ public final ImportSshPublicKeyResponse importSshPublicKey( * 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. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * String parent = FingerprintName.of("[USER]", "[FINGERPRINT]").toString(); + * OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + * String projectId = "projectId-894832108"; + * ImportSshPublicKeyResponse response = + * osLoginServiceClient.importSshPublicKey(parent, sshPublicKey, projectId); + * } + * }+ * * @param parent Required. The unique ID for the user in format `users/{user}`. * @param sshPublicKey Optional. The SSH public key and expiration time. * @param projectId The project ID of the Google Cloud Platform project. @@ -430,6 +658,19 @@ public final ImportSshPublicKeyResponse importSshPublicKey( * 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. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * ImportSshPublicKeyRequest request = + * ImportSshPublicKeyRequest.newBuilder() + * .setParent(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + * .setProjectId("projectId-894832108") + * .build(); + * ImportSshPublicKeyResponse response = osLoginServiceClient.importSshPublicKey(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -443,6 +684,20 @@ public final ImportSshPublicKeyResponse importSshPublicKey(ImportSshPublicKeyReq * is set when no username and UID exist as part of the login profile. * *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * ImportSshPublicKeyRequest request = + * ImportSshPublicKeyRequest.newBuilder() + * .setParent(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + * .setProjectId("projectId-894832108") + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * osLoginServiceClient.importSshPublicKeyCallable().futureCall(request); + * // Do something. + * ImportSshPublicKeyResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + * OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + * OsLoginProto.SshPublicKey response = + * osLoginServiceClient.updateSshPublicKey(name, sshPublicKey); + * } + * }+ * * @param name 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}`. @@ -475,6 +741,17 @@ public final OsLoginProto.SshPublicKey updateSshPublicKey( * Updates an SSH public key and returns the profile information. This method supports patch * semantics. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * String name = FingerprintName.of("[USER]", "[FINGERPRINT]").toString(); + * OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + * OsLoginProto.SshPublicKey response = + * osLoginServiceClient.updateSshPublicKey(name, sshPublicKey); + * } + * }+ * * @param name 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}`. @@ -493,6 +770,18 @@ public final OsLoginProto.SshPublicKey updateSshPublicKey( * Updates an SSH public key and returns the profile information. This method supports patch * semantics. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * FingerprintName name = FingerprintName.of("[USER]", "[FINGERPRINT]"); + * OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * OsLoginProto.SshPublicKey response = + * osLoginServiceClient.updateSshPublicKey(name, sshPublicKey, updateMask); + * } + * }+ * * @param name 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}`. @@ -516,6 +805,18 @@ public final OsLoginProto.SshPublicKey updateSshPublicKey( * Updates an SSH public key and returns the profile information. This method supports patch * semantics. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * String name = FingerprintName.of("[USER]", "[FINGERPRINT]").toString(); + * OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * OsLoginProto.SshPublicKey response = + * osLoginServiceClient.updateSshPublicKey(name, sshPublicKey, updateMask); + * } + * }+ * * @param name 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}`. @@ -539,6 +840,19 @@ public final OsLoginProto.SshPublicKey updateSshPublicKey( * Updates an SSH public key and returns the profile information. This method supports patch * semantics. * + *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * UpdateSshPublicKeyRequest request = + * UpdateSshPublicKeyRequest.newBuilder() + * .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * OsLoginProto.SshPublicKey response = osLoginServiceClient.updateSshPublicKey(request); + * } + * }+ * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -552,6 +866,20 @@ public final OsLoginProto.SshPublicKey updateSshPublicKey(UpdateSshPublicKeyRequ * semantics. * *
Sample code: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * UpdateSshPublicKeyRequest request = + * UpdateSshPublicKeyRequest.newBuilder() + * .setName(FingerprintName.of("[USER]", "[FINGERPRINT]").toString()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture*/ public final UnaryCallablefuture = + * osLoginServiceClient.updateSshPublicKeyCallable().futureCall(request); + * // Do something. + * OsLoginProto.SshPublicKey response = future.get(); + * } + * }
Sample for OsLoginServiceClient: + * + *
{@code + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { + * PosixAccountName name = PosixAccountName.of("[USER]", "[PROJECT]"); + * osLoginServiceClient.deletePosixAccount(name); + * } + * }*/ @Generated("by gapic-generator-java") package com.google.cloud.oslogin.v1; diff --git a/synth.metadata b/synth.metadata index 70e46a87..830fed53 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-os-login.git", - "sha": "4e46ddf01e79c950e88c6c819c9d2d095e02f560" + "sha": "adbe4e6d08f6268123f16165fa8d613c8f2e6ef0" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3", - "internalRef": "350949863" + "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", + "internalRef": "356341083" } }, {