|
18 | 18 | package com.ibm.cloud.code_engine.code_engine.v2;
|
19 | 19 |
|
20 | 20 | import com.google.gson.JsonObject;
|
| 21 | +import com.ibm.cloud.code_engine.code_engine.v2.model.AllowedOutboundDestination; |
| 22 | +import com.ibm.cloud.code_engine.code_engine.v2.model.AllowedOutboundDestinationList; |
21 | 23 | import com.ibm.cloud.code_engine.code_engine.v2.model.App;
|
22 | 24 | import com.ibm.cloud.code_engine.code_engine.v2.model.AppInstanceList;
|
23 | 25 | import com.ibm.cloud.code_engine.code_engine.v2.model.AppList;
|
|
31 | 33 | import com.ibm.cloud.code_engine.code_engine.v2.model.BuildRunList;
|
32 | 34 | import com.ibm.cloud.code_engine.code_engine.v2.model.ConfigMap;
|
33 | 35 | import com.ibm.cloud.code_engine.code_engine.v2.model.ConfigMapList;
|
| 36 | +import com.ibm.cloud.code_engine.code_engine.v2.model.CreateAllowedOutboundDestinationOptions; |
34 | 37 | import com.ibm.cloud.code_engine.code_engine.v2.model.CreateAppOptions;
|
35 | 38 | import com.ibm.cloud.code_engine.code_engine.v2.model.CreateBindingOptions;
|
36 | 39 | import com.ibm.cloud.code_engine.code_engine.v2.model.CreateBuildOptions;
|
|
42 | 45 | import com.ibm.cloud.code_engine.code_engine.v2.model.CreateJobRunOptions;
|
43 | 46 | import com.ibm.cloud.code_engine.code_engine.v2.model.CreateProjectOptions;
|
44 | 47 | import com.ibm.cloud.code_engine.code_engine.v2.model.CreateSecretOptions;
|
| 48 | +import com.ibm.cloud.code_engine.code_engine.v2.model.DeleteAllowedOutboundDestinationOptions; |
45 | 49 | import com.ibm.cloud.code_engine.code_engine.v2.model.DeleteAppOptions;
|
46 | 50 | import com.ibm.cloud.code_engine.code_engine.v2.model.DeleteAppRevisionOptions;
|
47 | 51 | import com.ibm.cloud.code_engine.code_engine.v2.model.DeleteBindingOptions;
|
|
59 | 63 | import com.ibm.cloud.code_engine.code_engine.v2.model.Function;
|
60 | 64 | import com.ibm.cloud.code_engine.code_engine.v2.model.FunctionList;
|
61 | 65 | import com.ibm.cloud.code_engine.code_engine.v2.model.FunctionRuntimeList;
|
| 66 | +import com.ibm.cloud.code_engine.code_engine.v2.model.GetAllowedOutboundDestinationOptions; |
62 | 67 | import com.ibm.cloud.code_engine.code_engine.v2.model.GetAppOptions;
|
63 | 68 | import com.ibm.cloud.code_engine.code_engine.v2.model.GetAppRevisionOptions;
|
64 | 69 | import com.ibm.cloud.code_engine.code_engine.v2.model.GetBindingOptions;
|
|
77 | 82 | import com.ibm.cloud.code_engine.code_engine.v2.model.JobList;
|
78 | 83 | import com.ibm.cloud.code_engine.code_engine.v2.model.JobRun;
|
79 | 84 | import com.ibm.cloud.code_engine.code_engine.v2.model.JobRunList;
|
| 85 | +import com.ibm.cloud.code_engine.code_engine.v2.model.ListAllowedOutboundDestinationOptions; |
80 | 86 | import com.ibm.cloud.code_engine.code_engine.v2.model.ListAppInstancesOptions;
|
81 | 87 | import com.ibm.cloud.code_engine.code_engine.v2.model.ListAppRevisionsOptions;
|
82 | 88 | import com.ibm.cloud.code_engine.code_engine.v2.model.ListAppsOptions;
|
|
99 | 105 | import com.ibm.cloud.code_engine.code_engine.v2.model.ReplaceSecretOptions;
|
100 | 106 | import com.ibm.cloud.code_engine.code_engine.v2.model.Secret;
|
101 | 107 | import com.ibm.cloud.code_engine.code_engine.v2.model.SecretList;
|
| 108 | +import com.ibm.cloud.code_engine.code_engine.v2.model.UpdateAllowedOutboundDestinationOptions; |
102 | 109 | import com.ibm.cloud.code_engine.code_engine.v2.model.UpdateAppOptions;
|
103 | 110 | import com.ibm.cloud.code_engine.code_engine.v2.model.UpdateBuildOptions;
|
104 | 111 | import com.ibm.cloud.code_engine.code_engine.v2.model.UpdateDomainMappingOptions;
|
@@ -175,7 +182,7 @@ public CodeEngine(String serviceName, Authenticator authenticator) {
|
175 | 182 | * Gets the version.
|
176 | 183 | *
|
177 | 184 | * The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between
|
178 |
| - * `2021-03-31` and `2024-09-27`. |
| 185 | + * `2021-03-31` and `2024-11-18`. |
179 | 186 | *
|
180 | 187 | * @return the version
|
181 | 188 | */
|
@@ -310,6 +317,148 @@ public ServiceCall<Void> deleteProject(DeleteProjectOptions deleteProjectOptions
|
310 | 317 | return createServiceCall(builder.build(), responseConverter);
|
311 | 318 | }
|
312 | 319 |
|
| 320 | + /** |
| 321 | + * List allowed outbound destinations. |
| 322 | + * |
| 323 | + * List all allowed outbound destinations in a project. |
| 324 | + * |
| 325 | + * @param listAllowedOutboundDestinationOptions the {@link ListAllowedOutboundDestinationOptions} containing the options for the call |
| 326 | + * @return a {@link ServiceCall} with a result of type {@link AllowedOutboundDestinationList} |
| 327 | + */ |
| 328 | + public ServiceCall<AllowedOutboundDestinationList> listAllowedOutboundDestination(ListAllowedOutboundDestinationOptions listAllowedOutboundDestinationOptions) { |
| 329 | + com.ibm.cloud.sdk.core.util.Validator.notNull(listAllowedOutboundDestinationOptions, |
| 330 | + "listAllowedOutboundDestinationOptions cannot be null"); |
| 331 | + Map<String, String> pathParamsMap = new HashMap<String, String>(); |
| 332 | + pathParamsMap.put("project_id", listAllowedOutboundDestinationOptions.projectId()); |
| 333 | + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/projects/{project_id}/allowed_outbound_destinations", pathParamsMap)); |
| 334 | + Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("code_engine", "v2", "listAllowedOutboundDestination"); |
| 335 | + for (Entry<String, String> header : sdkHeaders.entrySet()) { |
| 336 | + builder.header(header.getKey(), header.getValue()); |
| 337 | + } |
| 338 | + builder.header("Accept", "application/json"); |
| 339 | + if (listAllowedOutboundDestinationOptions.limit() != null) { |
| 340 | + builder.query("limit", String.valueOf(listAllowedOutboundDestinationOptions.limit())); |
| 341 | + } |
| 342 | + if (listAllowedOutboundDestinationOptions.start() != null) { |
| 343 | + builder.query("start", String.valueOf(listAllowedOutboundDestinationOptions.start())); |
| 344 | + } |
| 345 | + ResponseConverter<AllowedOutboundDestinationList> responseConverter = |
| 346 | + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<AllowedOutboundDestinationList>() { }.getType()); |
| 347 | + return createServiceCall(builder.build(), responseConverter); |
| 348 | + } |
| 349 | + |
| 350 | + /** |
| 351 | + * Create an allowed outbound destination. |
| 352 | + * |
| 353 | + * Create an allowed outbound destination. |
| 354 | + * |
| 355 | + * @param createAllowedOutboundDestinationOptions the {@link CreateAllowedOutboundDestinationOptions} containing the options for the call |
| 356 | + * @return a {@link ServiceCall} with a result of type {@link AllowedOutboundDestination} |
| 357 | + */ |
| 358 | + public ServiceCall<AllowedOutboundDestination> createAllowedOutboundDestination(CreateAllowedOutboundDestinationOptions createAllowedOutboundDestinationOptions) { |
| 359 | + com.ibm.cloud.sdk.core.util.Validator.notNull(createAllowedOutboundDestinationOptions, |
| 360 | + "createAllowedOutboundDestinationOptions cannot be null"); |
| 361 | + Map<String, String> pathParamsMap = new HashMap<String, String>(); |
| 362 | + pathParamsMap.put("project_id", createAllowedOutboundDestinationOptions.projectId()); |
| 363 | + RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/projects/{project_id}/allowed_outbound_destinations", pathParamsMap)); |
| 364 | + Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("code_engine", "v2", "createAllowedOutboundDestination"); |
| 365 | + for (Entry<String, String> header : sdkHeaders.entrySet()) { |
| 366 | + builder.header(header.getKey(), header.getValue()); |
| 367 | + } |
| 368 | + builder.header("Accept", "application/json"); |
| 369 | + if (this.version != null) { |
| 370 | + builder.query("version", String.valueOf(this.version)); |
| 371 | + } |
| 372 | + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithoutPrettyPrinting().toJson(createAllowedOutboundDestinationOptions.allowedOutboundDestination()), "application/json"); |
| 373 | + ResponseConverter<AllowedOutboundDestination> responseConverter = |
| 374 | + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<AllowedOutboundDestination>() { }.getType()); |
| 375 | + return createServiceCall(builder.build(), responseConverter); |
| 376 | + } |
| 377 | + |
| 378 | + /** |
| 379 | + * Get an allowed outbound destination. |
| 380 | + * |
| 381 | + * Display the details of an allowed outbound destination. |
| 382 | + * |
| 383 | + * @param getAllowedOutboundDestinationOptions the {@link GetAllowedOutboundDestinationOptions} containing the options for the call |
| 384 | + * @return a {@link ServiceCall} with a result of type {@link AllowedOutboundDestination} |
| 385 | + */ |
| 386 | + public ServiceCall<AllowedOutboundDestination> getAllowedOutboundDestination(GetAllowedOutboundDestinationOptions getAllowedOutboundDestinationOptions) { |
| 387 | + com.ibm.cloud.sdk.core.util.Validator.notNull(getAllowedOutboundDestinationOptions, |
| 388 | + "getAllowedOutboundDestinationOptions cannot be null"); |
| 389 | + Map<String, String> pathParamsMap = new HashMap<String, String>(); |
| 390 | + pathParamsMap.put("project_id", getAllowedOutboundDestinationOptions.projectId()); |
| 391 | + pathParamsMap.put("name", getAllowedOutboundDestinationOptions.name()); |
| 392 | + RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/projects/{project_id}/allowed_outbound_destinations/{name}", pathParamsMap)); |
| 393 | + Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("code_engine", "v2", "getAllowedOutboundDestination"); |
| 394 | + for (Entry<String, String> header : sdkHeaders.entrySet()) { |
| 395 | + builder.header(header.getKey(), header.getValue()); |
| 396 | + } |
| 397 | + builder.header("Accept", "application/json"); |
| 398 | + if (this.version != null) { |
| 399 | + builder.query("version", String.valueOf(this.version)); |
| 400 | + } |
| 401 | + ResponseConverter<AllowedOutboundDestination> responseConverter = |
| 402 | + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<AllowedOutboundDestination>() { }.getType()); |
| 403 | + return createServiceCall(builder.build(), responseConverter); |
| 404 | + } |
| 405 | + |
| 406 | + /** |
| 407 | + * Delete an allowed outbound destination. |
| 408 | + * |
| 409 | + * Delete an allowed outbound destination. |
| 410 | + * |
| 411 | + * @param deleteAllowedOutboundDestinationOptions the {@link DeleteAllowedOutboundDestinationOptions} containing the options for the call |
| 412 | + * @return a {@link ServiceCall} with a void result |
| 413 | + */ |
| 414 | + public ServiceCall<Void> deleteAllowedOutboundDestination(DeleteAllowedOutboundDestinationOptions deleteAllowedOutboundDestinationOptions) { |
| 415 | + com.ibm.cloud.sdk.core.util.Validator.notNull(deleteAllowedOutboundDestinationOptions, |
| 416 | + "deleteAllowedOutboundDestinationOptions cannot be null"); |
| 417 | + Map<String, String> pathParamsMap = new HashMap<String, String>(); |
| 418 | + pathParamsMap.put("project_id", deleteAllowedOutboundDestinationOptions.projectId()); |
| 419 | + pathParamsMap.put("name", deleteAllowedOutboundDestinationOptions.name()); |
| 420 | + RequestBuilder builder = RequestBuilder.delete(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/projects/{project_id}/allowed_outbound_destinations/{name}", pathParamsMap)); |
| 421 | + Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("code_engine", "v2", "deleteAllowedOutboundDestination"); |
| 422 | + for (Entry<String, String> header : sdkHeaders.entrySet()) { |
| 423 | + builder.header(header.getKey(), header.getValue()); |
| 424 | + } |
| 425 | + if (this.version != null) { |
| 426 | + builder.query("version", String.valueOf(this.version)); |
| 427 | + } |
| 428 | + ResponseConverter<Void> responseConverter = ResponseConverterUtils.getVoid(); |
| 429 | + return createServiceCall(builder.build(), responseConverter); |
| 430 | + } |
| 431 | + |
| 432 | + /** |
| 433 | + * Update an allowed outbound destination. |
| 434 | + * |
| 435 | + * Update an allowed outbound destination. |
| 436 | + * |
| 437 | + * @param updateAllowedOutboundDestinationOptions the {@link UpdateAllowedOutboundDestinationOptions} containing the options for the call |
| 438 | + * @return a {@link ServiceCall} with a result of type {@link AllowedOutboundDestination} |
| 439 | + */ |
| 440 | + public ServiceCall<AllowedOutboundDestination> updateAllowedOutboundDestination(UpdateAllowedOutboundDestinationOptions updateAllowedOutboundDestinationOptions) { |
| 441 | + com.ibm.cloud.sdk.core.util.Validator.notNull(updateAllowedOutboundDestinationOptions, |
| 442 | + "updateAllowedOutboundDestinationOptions cannot be null"); |
| 443 | + Map<String, String> pathParamsMap = new HashMap<String, String>(); |
| 444 | + pathParamsMap.put("project_id", updateAllowedOutboundDestinationOptions.projectId()); |
| 445 | + pathParamsMap.put("name", updateAllowedOutboundDestinationOptions.name()); |
| 446 | + RequestBuilder builder = RequestBuilder.patch(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/projects/{project_id}/allowed_outbound_destinations/{name}", pathParamsMap)); |
| 447 | + Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("code_engine", "v2", "updateAllowedOutboundDestination"); |
| 448 | + for (Entry<String, String> header : sdkHeaders.entrySet()) { |
| 449 | + builder.header(header.getKey(), header.getValue()); |
| 450 | + } |
| 451 | + builder.header("Accept", "application/json"); |
| 452 | + builder.header("If-Match", updateAllowedOutboundDestinationOptions.ifMatch()); |
| 453 | + if (this.version != null) { |
| 454 | + builder.query("version", String.valueOf(this.version)); |
| 455 | + } |
| 456 | + builder.bodyContent(com.ibm.cloud.sdk.core.util.GsonSingleton.getGsonWithSerializeNulls().toJson(updateAllowedOutboundDestinationOptions.allowedOutboundDestination()), "application/merge-patch+json"); |
| 457 | + ResponseConverter<AllowedOutboundDestination> responseConverter = |
| 458 | + ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<AllowedOutboundDestination>() { }.getType()); |
| 459 | + return createServiceCall(builder.build(), responseConverter); |
| 460 | + } |
| 461 | + |
313 | 462 | /**
|
314 | 463 | * List egress IP addresses.
|
315 | 464 | *
|
|
0 commit comments