Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [oslogin] add regions field to ImportSshPublicKeyRequest #10205

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion java-os-login/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-os-login.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-os-login/2.29.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-os-login/2.31.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,150 @@
* <p>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().
*
* <p>The surface of this class includes several types of Java methods for each of the API's
* methods:
*
* <ol>
* <li>A "flattened" method. With this type of method, the fields of the request type have been
* converted into function parameters. It may be the case that not all fields are available as
* parameters, and not every API method will have a flattened method entry point.
* <li>A "request object" method. This type of method only takes one parameter, a request object,
* which must be constructed before the call. Not every API method will have a request object
* method.
* <li>A "callable" method. This type of method takes no parameters and returns an immutable API
* callable object, which can be used to initiate calls to the service.
* </ol>
* <table>
* <tr>
* <th>Method</th>
* <th>Description</th>
* <th>Method Variants</th>
* <tr>
* <td>CreateSshPublicKey</td>
* <td><p> Create an SSH public key</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
* <li>createSshPublicKey(CreateSshPublicKeyRequest request)
* </ul>
* <p>"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.</p>
* <ul>
* <li>createSshPublicKey(UserName parent, OsLoginProto.SshPublicKey sshPublicKey)
* <li>createSshPublicKey(String parent, OsLoginProto.SshPublicKey sshPublicKey)
* </ul>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
* <li>createSshPublicKeyCallable()
* </ul>
* </td>
* </tr>
* <tr>
* <td>DeletePosixAccount</td>
* <td><p> Deletes a POSIX account.</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
* <li>deletePosixAccount(DeletePosixAccountRequest request)
* </ul>
* <p>"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.</p>
* <ul>
* <li>deletePosixAccount(ProjectName name)
* <li>deletePosixAccount(String name)
* </ul>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
* <li>deletePosixAccountCallable()
* </ul>
* </td>
* </tr>
* <tr>
* <td>DeleteSshPublicKey</td>
* <td><p> Deletes an SSH public key.</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
* <li>deleteSshPublicKey(DeleteSshPublicKeyRequest request)
* </ul>
* <p>"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.</p>
* <ul>
* <li>deleteSshPublicKey(FingerprintName name)
* <li>deleteSshPublicKey(String name)
* </ul>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
* <li>deleteSshPublicKeyCallable()
* </ul>
* </td>
* </tr>
* <tr>
* <td>GetLoginProfile</td>
* <td><p> Retrieves the profile information used for logging in to a virtual machine on Google Compute Engine.</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
* <li>getLoginProfile(GetLoginProfileRequest request)
* </ul>
* <p>"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.</p>
* <ul>
* <li>getLoginProfile(UserName name)
* <li>getLoginProfile(String name)
* </ul>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
* <li>getLoginProfileCallable()
* </ul>
* </td>
* </tr>
* <tr>
* <td>GetSshPublicKey</td>
* <td><p> Retrieves an SSH public key.</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
* <li>getSshPublicKey(GetSshPublicKeyRequest request)
* </ul>
* <p>"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.</p>
* <ul>
* <li>getSshPublicKey(FingerprintName name)
* <li>getSshPublicKey(String name)
* </ul>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
* <li>getSshPublicKeyCallable()
* </ul>
* </td>
* </tr>
* <tr>
* <td>ImportSshPublicKey</td>
* <td><p> 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.</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
* <li>importSshPublicKey(ImportSshPublicKeyRequest request)
* </ul>
* <p>"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.</p>
* <ul>
* <li>importSshPublicKey(UserName parent, OsLoginProto.SshPublicKey sshPublicKey)
* <li>importSshPublicKey(String parent, OsLoginProto.SshPublicKey sshPublicKey)
* <li>importSshPublicKey(UserName parent, OsLoginProto.SshPublicKey sshPublicKey, String projectId)
* <li>importSshPublicKey(String parent, OsLoginProto.SshPublicKey sshPublicKey, String projectId)
* </ul>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
* <li>importSshPublicKeyCallable()
* </ul>
* </td>
* </tr>
* <tr>
* <td>UpdateSshPublicKey</td>
* <td><p> Updates an SSH public key and returns the profile information. This method supports patch semantics.</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
* <li>updateSshPublicKey(UpdateSshPublicKeyRequest request)
* </ul>
* <p>"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.</p>
* <ul>
* <li>updateSshPublicKey(FingerprintName name, OsLoginProto.SshPublicKey sshPublicKey)
* <li>updateSshPublicKey(String name, OsLoginProto.SshPublicKey sshPublicKey)
* <li>updateSshPublicKey(FingerprintName name, OsLoginProto.SshPublicKey sshPublicKey, FieldMask updateMask)
* <li>updateSshPublicKey(String name, OsLoginProto.SshPublicKey sshPublicKey, FieldMask updateMask)
* </ul>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
* <li>updateSshPublicKeyCallable()
* </ul>
* </td>
* </tr>
* </tr>
* </table>
*
* <p>See the individual methods for example code.
*
Expand Down Expand Up @@ -926,6 +1057,7 @@ public final ImportSshPublicKeyResponse importSshPublicKey(
* .setParent(UserName.of("[USER]").toString())
* .setSshPublicKey(OsLoginProto.SshPublicKey.newBuilder().build())
* .setProjectId("projectId-894832108")
* .addAllRegions(new ArrayList<String>())
* .build();
* ImportSshPublicKeyResponse response = osLoginServiceClient.importSshPublicKey(request);
* }
Expand Down Expand Up @@ -957,6 +1089,7 @@ public final ImportSshPublicKeyResponse importSshPublicKey(ImportSshPublicKeyReq
* .setParent(UserName.of("[USER]").toString())
* .setSshPublicKey(OsLoginProto.SshPublicKey.newBuilder().build())
* .setProjectId("projectId-894832108")
* .addAllRegions(new ArrayList<String>())
* .build();
* ApiFuture<ImportSshPublicKeyResponse> future =
* osLoginServiceClient.importSshPublicKeyCallable().futureCall(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ public class HttpJsonOsLoginServiceStub extends OsLoginServiceStub {
ProtoRestSerializer<ImportSshPublicKeyRequest> serializer =
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "projectId", request.getProjectId());
serializer.putQueryParam(fields, "regions", request.getRegionsList());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ public OsLoginServiceStub createStub() throws IOException {
"Transport not supported: %s", getTransportChannelProvider().getTransportName()));
}

/** Returns the default service name. */
@Override
public String getServiceName() {
return "oslogin";
}

/** Returns a builder for the default ExecutorProvider for this service. */
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
return InstantiatingExecutorProvider.newBuilder();
Expand Down
Loading
Loading