Skip to content

Commit cbe6843

Browse files
feat(api): Updated java-sdk to adopt Code Engine API specification changes
1 parent 0684d63 commit cbe6843

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1065
-157
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Build Status](https://travis-ci.com/IBM/code-engine-java-sdk.svg?branch=main)](https://travis-ci.com/IBM/code-engine-java-sdk)
22
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
33

4-
# IBM Cloud Code Engine Java SDK Version 4.22.1
4+
# IBM Cloud Code Engine Java SDK Version 4.27.1
55

66
Java client library to interact with the [Code Engine API](https://cloud.ibm.com/apidocs/codeengine).
77

@@ -39,7 +39,7 @@ The IBM Cloud Code Engine Java SDK allows developers to programmatically interac
3939

4040
Service Name | Artifact Coordinates
4141
--- | ---
42-
[Code Engine](https://cloud.ibm.com/apidocs/codeengine/codeengine-v2.0.0) | com.ibm.cloud.code-engine:4.22.1
42+
[Code Engine](https://cloud.ibm.com/apidocs/codeengine/codeengine-v2.0.0) | com.ibm.cloud.code-engine:4.27.1
4343

4444
## Prerequisites
4545

@@ -51,7 +51,7 @@ Service Name | Artifact Coordinates
5151

5252
## Installation
5353

54-
The current version of this SDK is: 4.22.1
54+
The current version of this SDK is: 4.27.1
5555

5656
Each service's artifact coordinates are listed in the table above.
5757

@@ -70,14 +70,14 @@ Here are examples for maven and gradle:
7070
<dependency>
7171
<groupId>com.ibm.cloud</groupId>
7272
<artifactId>code-engine</artifactId>
73-
<version>4.22.1</version>
73+
<version>4.27.1</version>
7474
</dependency>
7575
```
7676

7777
### Gradle
7878

7979
```gradle
80-
compile 'com.ibm.cloud:code-engine:4.22.1'
80+
compile 'com.ibm.cloud:code-engine:4.27.1'
8181
```
8282

8383
## Using the SDK

modules/code-engine/src/main/java/com/ibm/cloud/code_engine/code_engine/v2/CodeEngine.java

Lines changed: 133 additions & 1 deletion
Large diffs are not rendered by default.

modules/code-engine/src/main/java/com/ibm/cloud/code_engine/code_engine/v2/model/App.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ public interface Status {
114114
protected Long runAsUser;
115115
@SerializedName("run_commands")
116116
protected List<String> runCommands;
117+
@SerializedName("run_compute_resource_token_enabled")
118+
protected Boolean runComputeResourceTokenEnabled;
117119
@SerializedName("run_env_variables")
118120
protected List<EnvVar> runEnvVariables;
119121
@SerializedName("run_service_account")
@@ -401,6 +403,17 @@ public List<String> getRunCommands() {
401403
return runCommands;
402404
}
403405

406+
/**
407+
* Gets the runComputeResourceTokenEnabled.
408+
*
409+
* Optional flag to enable the use of a compute resource token mounted to the container file system.
410+
*
411+
* @return the runComputeResourceTokenEnabled
412+
*/
413+
public Boolean isRunComputeResourceTokenEnabled() {
414+
return runComputeResourceTokenEnabled;
415+
}
416+
404417
/**
405418
* Gets the runEnvVariables.
406419
*

modules/code-engine/src/main/java/com/ibm/cloud/code_engine/code_engine/v2/model/AppPatch.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ public interface RunServiceAccount {
7575
protected Long runAsUser;
7676
@SerializedName("run_commands")
7777
protected List<String> runCommands;
78+
@SerializedName("run_compute_resource_token_enabled")
79+
protected Boolean runComputeResourceTokenEnabled;
7880
@SerializedName("run_env_variables")
7981
protected List<EnvVarPrototype> runEnvVariables;
8082
@SerializedName("run_service_account")
@@ -115,6 +117,7 @@ public static class Builder {
115117
private List<String> runArguments;
116118
private Long runAsUser;
117119
private List<String> runCommands;
120+
private Boolean runComputeResourceTokenEnabled;
118121
private List<EnvVarPrototype> runEnvVariables;
119122
private String runServiceAccount;
120123
private List<VolumeMountPrototype> runVolumeMounts;
@@ -144,6 +147,7 @@ private Builder(AppPatch appPatch) {
144147
this.runArguments = appPatch.runArguments;
145148
this.runAsUser = appPatch.runAsUser;
146149
this.runCommands = appPatch.runCommands;
150+
this.runComputeResourceTokenEnabled = appPatch.runComputeResourceTokenEnabled;
147151
this.runEnvVariables = appPatch.runEnvVariables;
148152
this.runServiceAccount = appPatch.runServiceAccount;
149153
this.runVolumeMounts = appPatch.runVolumeMounts;
@@ -339,6 +343,17 @@ public Builder runCommands(List<String> runCommands) {
339343
return this;
340344
}
341345

346+
/**
347+
* Set the runComputeResourceTokenEnabled.
348+
*
349+
* @param runComputeResourceTokenEnabled the runComputeResourceTokenEnabled
350+
* @return the AppPatch builder
351+
*/
352+
public Builder runComputeResourceTokenEnabled(Boolean runComputeResourceTokenEnabled) {
353+
this.runComputeResourceTokenEnabled = runComputeResourceTokenEnabled;
354+
return this;
355+
}
356+
342357
/**
343358
* Set the runEnvVariables.
344359
* Existing runEnvVariables will be replaced.
@@ -497,6 +512,7 @@ protected AppPatch(Builder builder) {
497512
runArguments = builder.runArguments;
498513
runAsUser = builder.runAsUser;
499514
runCommands = builder.runCommands;
515+
runComputeResourceTokenEnabled = builder.runComputeResourceTokenEnabled;
500516
runEnvVariables = builder.runEnvVariables;
501517
runServiceAccount = builder.runServiceAccount;
502518
runVolumeMounts = builder.runVolumeMounts;
@@ -630,6 +646,17 @@ public List<String> runCommands() {
630646
return runCommands;
631647
}
632648

649+
/**
650+
* Gets the runComputeResourceTokenEnabled.
651+
*
652+
* Optional flag to enable the use of a compute resource token mounted to the container file system.
653+
*
654+
* @return the runComputeResourceTokenEnabled
655+
*/
656+
public Boolean runComputeResourceTokenEnabled() {
657+
return runComputeResourceTokenEnabled;
658+
}
659+
633660
/**
634661
* Gets the runEnvVariables.
635662
*

modules/code-engine/src/main/java/com/ibm/cloud/code_engine/code_engine/v2/model/AppRevision.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ public interface Status {
9292
protected Long runAsUser;
9393
@SerializedName("run_commands")
9494
protected List<String> runCommands;
95+
@SerializedName("run_compute_resource_token_enabled")
96+
protected Boolean runComputeResourceTokenEnabled;
9597
@SerializedName("run_env_variables")
9698
protected List<EnvVar> runEnvVariables;
9799
@SerializedName("run_service_account")
@@ -321,6 +323,17 @@ public List<String> getRunCommands() {
321323
return runCommands;
322324
}
323325

326+
/**
327+
* Gets the runComputeResourceTokenEnabled.
328+
*
329+
* Optional flag to enable the use of a compute resource token mounted to the container file system.
330+
*
331+
* @return the runComputeResourceTokenEnabled
332+
*/
333+
public Boolean isRunComputeResourceTokenEnabled() {
334+
return runComputeResourceTokenEnabled;
335+
}
336+
324337
/**
325338
* Gets the runEnvVariables.
326339
*

modules/code-engine/src/main/java/com/ibm/cloud/code_engine/code_engine/v2/model/CreateAppOptions.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public interface RunServiceAccount {
6565
protected List<String> runArguments;
6666
protected Long runAsUser;
6767
protected List<String> runCommands;
68+
protected Boolean runComputeResourceTokenEnabled;
6869
protected List<EnvVarPrototype> runEnvVariables;
6970
protected String runServiceAccount;
7071
protected List<VolumeMountPrototype> runVolumeMounts;
@@ -94,6 +95,7 @@ public static class Builder {
9495
private List<String> runArguments;
9596
private Long runAsUser;
9697
private List<String> runCommands;
98+
private Boolean runComputeResourceTokenEnabled;
9799
private List<EnvVarPrototype> runEnvVariables;
98100
private String runServiceAccount;
99101
private List<VolumeMountPrototype> runVolumeMounts;
@@ -125,6 +127,7 @@ private Builder(CreateAppOptions createAppOptions) {
125127
this.runArguments = createAppOptions.runArguments;
126128
this.runAsUser = createAppOptions.runAsUser;
127129
this.runCommands = createAppOptions.runCommands;
130+
this.runComputeResourceTokenEnabled = createAppOptions.runComputeResourceTokenEnabled;
128131
this.runEnvVariables = createAppOptions.runEnvVariables;
129132
this.runServiceAccount = createAppOptions.runServiceAccount;
130133
this.runVolumeMounts = createAppOptions.runVolumeMounts;
@@ -355,6 +358,17 @@ public Builder runCommands(List<String> runCommands) {
355358
return this;
356359
}
357360

361+
/**
362+
* Set the runComputeResourceTokenEnabled.
363+
*
364+
* @param runComputeResourceTokenEnabled the runComputeResourceTokenEnabled
365+
* @return the CreateAppOptions builder
366+
*/
367+
public Builder runComputeResourceTokenEnabled(Boolean runComputeResourceTokenEnabled) {
368+
this.runComputeResourceTokenEnabled = runComputeResourceTokenEnabled;
369+
return this;
370+
}
371+
358372
/**
359373
* Set the runEnvVariables.
360374
* Existing runEnvVariables will be replaced.
@@ -521,6 +535,7 @@ protected CreateAppOptions(Builder builder) {
521535
runArguments = builder.runArguments;
522536
runAsUser = builder.runAsUser;
523537
runCommands = builder.runCommands;
538+
runComputeResourceTokenEnabled = builder.runComputeResourceTokenEnabled;
524539
runEnvVariables = builder.runEnvVariables;
525540
runServiceAccount = builder.runServiceAccount;
526541
runVolumeMounts = builder.runVolumeMounts;
@@ -676,6 +691,17 @@ public List<String> runCommands() {
676691
return runCommands;
677692
}
678693

694+
/**
695+
* Gets the runComputeResourceTokenEnabled.
696+
*
697+
* Optional flag to enable the use of a compute resource token mounted to the container file system.
698+
*
699+
* @return the runComputeResourceTokenEnabled
700+
*/
701+
public Boolean runComputeResourceTokenEnabled() {
702+
return runComputeResourceTokenEnabled;
703+
}
704+
679705
/**
680706
* Gets the runEnvVariables.
681707
*

modules/code-engine/src/main/java/com/ibm/cloud/code_engine/code_engine/v2/model/CreateFunctionOptions.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public interface ManagedDomainMappings {
4545
protected String codeMain;
4646
protected String codeSecret;
4747
protected String managedDomainMappings;
48+
protected Boolean runComputeResourceTokenEnabled;
4849
protected List<EnvVarPrototype> runEnvVariables;
4950
protected Long scaleConcurrency;
5051
protected String scaleCpuLimit;
@@ -64,6 +65,7 @@ public static class Builder {
6465
private String codeMain;
6566
private String codeSecret;
6667
private String managedDomainMappings;
68+
private Boolean runComputeResourceTokenEnabled;
6769
private List<EnvVarPrototype> runEnvVariables;
6870
private Long scaleConcurrency;
6971
private String scaleCpuLimit;
@@ -85,6 +87,7 @@ private Builder(CreateFunctionOptions createFunctionOptions) {
8587
this.codeMain = createFunctionOptions.codeMain;
8688
this.codeSecret = createFunctionOptions.codeSecret;
8789
this.managedDomainMappings = createFunctionOptions.managedDomainMappings;
90+
this.runComputeResourceTokenEnabled = createFunctionOptions.runComputeResourceTokenEnabled;
8891
this.runEnvVariables = createFunctionOptions.runEnvVariables;
8992
this.scaleConcurrency = createFunctionOptions.scaleConcurrency;
9093
this.scaleCpuLimit = createFunctionOptions.scaleCpuLimit;
@@ -227,6 +230,17 @@ public Builder managedDomainMappings(String managedDomainMappings) {
227230
return this;
228231
}
229232

233+
/**
234+
* Set the runComputeResourceTokenEnabled.
235+
*
236+
* @param runComputeResourceTokenEnabled the runComputeResourceTokenEnabled
237+
* @return the CreateFunctionOptions builder
238+
*/
239+
public Builder runComputeResourceTokenEnabled(Boolean runComputeResourceTokenEnabled) {
240+
this.runComputeResourceTokenEnabled = runComputeResourceTokenEnabled;
241+
return this;
242+
}
243+
230244
/**
231245
* Set the runEnvVariables.
232246
* Existing runEnvVariables will be replaced.
@@ -314,6 +328,7 @@ protected CreateFunctionOptions(Builder builder) {
314328
codeMain = builder.codeMain;
315329
codeSecret = builder.codeSecret;
316330
managedDomainMappings = builder.managedDomainMappings;
331+
runComputeResourceTokenEnabled = builder.runComputeResourceTokenEnabled;
317332
runEnvVariables = builder.runEnvVariables;
318333
scaleConcurrency = builder.scaleConcurrency;
319334
scaleCpuLimit = builder.scaleCpuLimit;
@@ -425,6 +440,17 @@ public String managedDomainMappings() {
425440
return managedDomainMappings;
426441
}
427442

443+
/**
444+
* Gets the runComputeResourceTokenEnabled.
445+
*
446+
* Optional flag to enable the use of a compute resource token mounted to the container file system.
447+
*
448+
* @return the runComputeResourceTokenEnabled
449+
*/
450+
public Boolean runComputeResourceTokenEnabled() {
451+
return runComputeResourceTokenEnabled;
452+
}
453+
428454
/**
429455
* Gets the runEnvVariables.
430456
*

modules/code-engine/src/main/java/com/ibm/cloud/code_engine/code_engine/v2/model/CreateJobOptions.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public interface RunServiceAccount {
5959
protected List<String> runArguments;
6060
protected Long runAsUser;
6161
protected List<String> runCommands;
62+
protected Boolean runComputeResourceTokenEnabled;
6263
protected List<EnvVarPrototype> runEnvVariables;
6364
protected String runMode;
6465
protected String runServiceAccount;
@@ -81,6 +82,7 @@ public static class Builder {
8182
private List<String> runArguments;
8283
private Long runAsUser;
8384
private List<String> runCommands;
85+
private Boolean runComputeResourceTokenEnabled;
8486
private List<EnvVarPrototype> runEnvVariables;
8587
private String runMode;
8688
private String runServiceAccount;
@@ -105,6 +107,7 @@ private Builder(CreateJobOptions createJobOptions) {
105107
this.runArguments = createJobOptions.runArguments;
106108
this.runAsUser = createJobOptions.runAsUser;
107109
this.runCommands = createJobOptions.runCommands;
110+
this.runComputeResourceTokenEnabled = createJobOptions.runComputeResourceTokenEnabled;
108111
this.runEnvVariables = createJobOptions.runEnvVariables;
109112
this.runMode = createJobOptions.runMode;
110113
this.runServiceAccount = createJobOptions.runServiceAccount;
@@ -288,6 +291,17 @@ public Builder runCommands(List<String> runCommands) {
288291
return this;
289292
}
290293

294+
/**
295+
* Set the runComputeResourceTokenEnabled.
296+
*
297+
* @param runComputeResourceTokenEnabled the runComputeResourceTokenEnabled
298+
* @return the CreateJobOptions builder
299+
*/
300+
public Builder runComputeResourceTokenEnabled(Boolean runComputeResourceTokenEnabled) {
301+
this.runComputeResourceTokenEnabled = runComputeResourceTokenEnabled;
302+
return this;
303+
}
304+
291305
/**
292306
* Set the runEnvVariables.
293307
* Existing runEnvVariables will be replaced.
@@ -417,6 +431,7 @@ protected CreateJobOptions(Builder builder) {
417431
runArguments = builder.runArguments;
418432
runAsUser = builder.runAsUser;
419433
runCommands = builder.runCommands;
434+
runComputeResourceTokenEnabled = builder.runComputeResourceTokenEnabled;
420435
runEnvVariables = builder.runEnvVariables;
421436
runMode = builder.runMode;
422437
runServiceAccount = builder.runServiceAccount;
@@ -523,6 +538,17 @@ public List<String> runCommands() {
523538
return runCommands;
524539
}
525540

541+
/**
542+
* Gets the runComputeResourceTokenEnabled.
543+
*
544+
* Optional flag to enable the use of a compute resource token mounted to the container file system.
545+
*
546+
* @return the runComputeResourceTokenEnabled
547+
*/
548+
public Boolean runComputeResourceTokenEnabled() {
549+
return runComputeResourceTokenEnabled;
550+
}
551+
526552
/**
527553
* Gets the runEnvVariables.
528554
*

0 commit comments

Comments
 (0)