|
44 | 44 | * // - It may require specifying regional endpoints when creating the service client as shown in
|
45 | 45 | * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
|
46 | 46 | * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) {
|
47 |
| - * ProjectName name = ProjectName.of("[USER]", "[PROJECT]"); |
48 |
| - * osLoginServiceClient.deletePosixAccount(name); |
| 47 | + * UserName parent = UserName.of("[USER]"); |
| 48 | + * OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); |
| 49 | + * OsLoginProto.SshPublicKey response = |
| 50 | + * osLoginServiceClient.createSshPublicKey(parent, sshPublicKey); |
49 | 51 | * }
|
50 | 52 | * }</pre>
|
51 | 53 | *
|
@@ -169,6 +171,133 @@ public OsLoginServiceStub getStub() {
|
169 | 171 | return stub;
|
170 | 172 | }
|
171 | 173 |
|
| 174 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 175 | + /** |
| 176 | + * Create an SSH public key |
| 177 | + * |
| 178 | + * <p>Sample code: |
| 179 | + * |
| 180 | + * <pre>{@code |
| 181 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 182 | + * // It will require modifications to work: |
| 183 | + * // - It may require correct/in-range values for request initialization. |
| 184 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 185 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 186 | + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { |
| 187 | + * UserName parent = UserName.of("[USER]"); |
| 188 | + * OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); |
| 189 | + * OsLoginProto.SshPublicKey response = |
| 190 | + * osLoginServiceClient.createSshPublicKey(parent, sshPublicKey); |
| 191 | + * } |
| 192 | + * }</pre> |
| 193 | + * |
| 194 | + * @param parent Required. The unique ID for the user in format `users/{user}`. |
| 195 | + * @param sshPublicKey Required. The SSH public key and expiration time. |
| 196 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 197 | + */ |
| 198 | + public final OsLoginProto.SshPublicKey createSshPublicKey( |
| 199 | + UserName parent, OsLoginProto.SshPublicKey sshPublicKey) { |
| 200 | + CreateSshPublicKeyRequest request = |
| 201 | + CreateSshPublicKeyRequest.newBuilder() |
| 202 | + .setParent(parent == null ? null : parent.toString()) |
| 203 | + .setSshPublicKey(sshPublicKey) |
| 204 | + .build(); |
| 205 | + return createSshPublicKey(request); |
| 206 | + } |
| 207 | + |
| 208 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 209 | + /** |
| 210 | + * Create an SSH public key |
| 211 | + * |
| 212 | + * <p>Sample code: |
| 213 | + * |
| 214 | + * <pre>{@code |
| 215 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 216 | + * // It will require modifications to work: |
| 217 | + * // - It may require correct/in-range values for request initialization. |
| 218 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 219 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 220 | + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { |
| 221 | + * String parent = UserName.of("[USER]").toString(); |
| 222 | + * OsLoginProto.SshPublicKey sshPublicKey = OsLoginProto.SshPublicKey.newBuilder().build(); |
| 223 | + * OsLoginProto.SshPublicKey response = |
| 224 | + * osLoginServiceClient.createSshPublicKey(parent, sshPublicKey); |
| 225 | + * } |
| 226 | + * }</pre> |
| 227 | + * |
| 228 | + * @param parent Required. The unique ID for the user in format `users/{user}`. |
| 229 | + * @param sshPublicKey Required. The SSH public key and expiration time. |
| 230 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 231 | + */ |
| 232 | + public final OsLoginProto.SshPublicKey createSshPublicKey( |
| 233 | + String parent, OsLoginProto.SshPublicKey sshPublicKey) { |
| 234 | + CreateSshPublicKeyRequest request = |
| 235 | + CreateSshPublicKeyRequest.newBuilder() |
| 236 | + .setParent(parent) |
| 237 | + .setSshPublicKey(sshPublicKey) |
| 238 | + .build(); |
| 239 | + return createSshPublicKey(request); |
| 240 | + } |
| 241 | + |
| 242 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 243 | + /** |
| 244 | + * Create an SSH public key |
| 245 | + * |
| 246 | + * <p>Sample code: |
| 247 | + * |
| 248 | + * <pre>{@code |
| 249 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 250 | + * // It will require modifications to work: |
| 251 | + * // - It may require correct/in-range values for request initialization. |
| 252 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 253 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 254 | + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { |
| 255 | + * CreateSshPublicKeyRequest request = |
| 256 | + * CreateSshPublicKeyRequest.newBuilder() |
| 257 | + * .setParent(UserName.of("[USER]").toString()) |
| 258 | + * .setSshPublicKey(OsLoginProto.SshPublicKey.newBuilder().build()) |
| 259 | + * .build(); |
| 260 | + * OsLoginProto.SshPublicKey response = osLoginServiceClient.createSshPublicKey(request); |
| 261 | + * } |
| 262 | + * }</pre> |
| 263 | + * |
| 264 | + * @param request The request object containing all of the parameters for the API call. |
| 265 | + * @throws com.google.api.gax.rpc.ApiException if the remote call fails |
| 266 | + */ |
| 267 | + public final OsLoginProto.SshPublicKey createSshPublicKey(CreateSshPublicKeyRequest request) { |
| 268 | + return createSshPublicKeyCallable().call(request); |
| 269 | + } |
| 270 | + |
| 271 | + // AUTO-GENERATED DOCUMENTATION AND METHOD. |
| 272 | + /** |
| 273 | + * Create an SSH public key |
| 274 | + * |
| 275 | + * <p>Sample code: |
| 276 | + * |
| 277 | + * <pre>{@code |
| 278 | + * // This snippet has been automatically generated and should be regarded as a code template only. |
| 279 | + * // It will require modifications to work: |
| 280 | + * // - It may require correct/in-range values for request initialization. |
| 281 | + * // - It may require specifying regional endpoints when creating the service client as shown in |
| 282 | + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library |
| 283 | + * try (OsLoginServiceClient osLoginServiceClient = OsLoginServiceClient.create()) { |
| 284 | + * CreateSshPublicKeyRequest request = |
| 285 | + * CreateSshPublicKeyRequest.newBuilder() |
| 286 | + * .setParent(UserName.of("[USER]").toString()) |
| 287 | + * .setSshPublicKey(OsLoginProto.SshPublicKey.newBuilder().build()) |
| 288 | + * .build(); |
| 289 | + * ApiFuture<OsLoginProto.SshPublicKey> future = |
| 290 | + * osLoginServiceClient.createSshPublicKeyCallable().futureCall(request); |
| 291 | + * // Do something. |
| 292 | + * OsLoginProto.SshPublicKey response = future.get(); |
| 293 | + * } |
| 294 | + * }</pre> |
| 295 | + */ |
| 296 | + public final UnaryCallable<CreateSshPublicKeyRequest, OsLoginProto.SshPublicKey> |
| 297 | + createSshPublicKeyCallable() { |
| 298 | + return stub.createSshPublicKeyCallable(); |
| 299 | + } |
| 300 | + |
172 | 301 | // AUTO-GENERATED DOCUMENTATION AND METHOD.
|
173 | 302 | /**
|
174 | 303 | * Deletes a POSIX account.
|
|
0 commit comments