Skip to content

Commit 5db491c

Browse files
feat(api): Updated java-sdk to adopt Code Engine API specification changes
1 parent 9dc4757 commit 5db491c

File tree

349 files changed

+2636
-634
lines changed

Some content is hidden

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

349 files changed

+2636
-634
lines changed

README.md

Lines changed: 191 additions & 9 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.30.0
4+
# IBM Cloud Code Engine Java SDK Version 5.0.0
55

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

@@ -25,6 +25,7 @@ Java client library to interact with the [Code Engine API](https://cloud.ibm.com
2525
* [Maven](#maven)
2626
* [Gradle](#gradle)
2727
- [Using the SDK](#using-the-sdk)
28+
- [Breaking Changes (March 2026)](#breaking-changes-march-2026)
2829
- [Questions](#questions)
2930
- [Issues](#issues)
3031
- [Open source @ IBM](#open-source--ibm)
@@ -39,19 +40,19 @@ The IBM Cloud Code Engine Java SDK allows developers to programmatically interac
3940

4041
Service Name | Artifact Coordinates
4142
--- | ---
42-
[Code Engine](https://cloud.ibm.com/apidocs/codeengine/codeengine-v2.0.0) | com.ibm.cloud.code-engine:4.30.0
43+
[Code Engine](https://cloud.ibm.com/apidocs/codeengine/codeengine-v2.0.0) | com.ibm.cloud.code-engine:5.0.0
4344

4445
## Prerequisites
4546

4647
[ibm-cloud-onboarding]: https://cloud.ibm.com/registration
4748

48-
* An [IBM Cloud][ibm-cloud-onboarding] account.
49-
* An IAM API key to allow the SDK to access your account. Create one [here](https://cloud.ibm.com/iam/apikeys).
50-
* Java 8 or above.
49+
- An [IBM Cloud][ibm-cloud-onboarding] account.
50+
- An IAM API key to allow the SDK to access your account. Create one [here](https://cloud.ibm.com/iam/apikeys).
51+
- Java 8 or above.
5152

5253
## Installation
5354

54-
The current version of this SDK is: 4.30.0
55+
The current version of this SDK is: 5.0.0
5556

5657
Each service's artifact coordinates are listed in the table above.
5758

@@ -70,14 +71,14 @@ Here are examples for maven and gradle:
7071
<dependency>
7172
<groupId>com.ibm.cloud</groupId>
7273
<artifactId>code-engine</artifactId>
73-
<version>4.30.0</version>
74+
<version>5.0.0</version>
7475
</dependency>
7576
```
7677

7778
### Gradle
7879

7980
```gradle
80-
compile 'com.ibm.cloud:code-engine:4.30.0'
81+
compile 'com.ibm.cloud:code-engine:5.0.0'
8182
```
8283

8384
## Using the SDK
@@ -86,6 +87,187 @@ Examples and a demo are available in the [module examples](/modules/examples) fo
8687

8788
For general SDK usage information, please see [this link](https://github.com/IBM/ibm-cloud-sdk-common/blob/master/README.md)
8889

90+
## Breaking Changes (March 2026)
91+
92+
- **Method renames (pluralization) in `CodeEngine` service**
93+
Update list calls and their option types:
94+
95+
```java
96+
// before
97+
ServiceCall<AllowedOutboundDestinationList> call = codeEngine.listAllowedOutboundDestination(new ListAllowedOutboundDestinationOptions.Builder(projectId).build());
98+
99+
// after
100+
ServiceCall<AllowedOutboundDestinationList> call = codeEngine.listAllowedOutboundDestinations(new ListAllowedOutboundDestinationsOptions.Builder(projectId).build());
101+
```
102+
103+
```java
104+
// before
105+
ServiceCall<PersistentDataStoreList> call = codeEngine.listPersistentDataStore(new ListPersistentDataStoreOptions.Builder(projectId).build());
106+
107+
// after
108+
ServiceCall<PersistentDataStoreList> call = codeEngine.listPersistentDataStores(new ListPersistentDataStoresOptions.Builder(projectId).build());
109+
```
110+
111+
- **Options classes renamed**
112+
Replace imports and usage:
113+
114+
```java
115+
// before
116+
import com.ibm.cloud.code_engine.code_engine.v2.model.ListAllowedOutboundDestinationOptions;
117+
ListAllowedOutboundDestinationOptions opts =
118+
new ListAllowedOutboundDestinationOptions.Builder(projectId)
119+
.limit(100)
120+
.start("token")
121+
.build();
122+
123+
// after
124+
import com.ibm.cloud.code_engine.code_engine.v2.model.ListAllowedOutboundDestinationsOptions;
125+
ListAllowedOutboundDestinationsOptions opts =
126+
new ListAllowedOutboundDestinationsOptions.Builder(projectId)
127+
.limit(100)
128+
.start("token")
129+
.build();
130+
```
131+
132+
```java
133+
// before
134+
import com.ibm.cloud.code_engine.code_engine.v2.model.ListPersistentDataStoreOptions;
135+
ListPersistentDataStoreOptions opts =
136+
new ListPersistentDataStoreOptions.Builder(projectId)
137+
.limit(100)
138+
.start("token")
139+
.build();
140+
141+
// after
142+
import com.ibm.cloud.code_engine.code_engine.v2.model.ListPersistentDataStoresOptions;
143+
ListPersistentDataStoresOptions opts =
144+
new ListPersistentDataStoresOptions.Builder(projectId)
145+
.limit(100)
146+
.start("token")
147+
.build();
148+
```
149+
150+
- **Pager classes renamed**
151+
Switch to the new pager types and constructors:
152+
153+
```java
154+
// before
155+
import com.ibm.cloud.code_engine.code_engine.v2.model.AllowedOutboundDestinationPager;
156+
AllowedOutboundDestinationPager pager = new AllowedOutboundDestinationPager(codeEngine, oldOpts);
157+
158+
// after
159+
import com.ibm.cloud.code_engine.code_engine.v2.model.AllowedOutboundDestinationsPager;
160+
AllowedOutboundDestinationsPager pager = new AllowedOutboundDestinationsPager(codeEngine, newOpts);
161+
```
162+
163+
```java
164+
// before
165+
import com.ibm.cloud.code_engine.code_engine.v2.model.PersistentDataStorePager;
166+
PersistentDataStorePager pager = new PersistentDataStorePager(codeEngine, oldOpts);
167+
168+
// after
169+
import com.ibm.cloud.code_engine.code_engine.v2.model.PersistentDataStoresPager;
170+
PersistentDataStoresPager pager = new PersistentDataStoresPager(codeEngine, newOpts);
171+
```
172+
173+
- **Builder parameter order changed for CIDR prototype**
174+
`AllowedOutboundDestinationPrototypeCidrBlockDataPrototype.Builder` required-args constructor signature changed:
175+
176+
```java
177+
// before: Builder(String type, String cidrBlock, String name)
178+
var proto = new AllowedOutboundDestinationPrototypeCidrBlockDataPrototype.Builder(
179+
"cidr_block", "10.0.0.0/24", "allow-egress"
180+
).build();
181+
182+
// after: Builder(String type, String name, String cidrBlock)
183+
var proto = new AllowedOutboundDestinationPrototypeCidrBlockDataPrototype.Builder(
184+
"cidr_block", "allow-egress", "10.0.0.0/24"
185+
).build();
186+
```
187+
188+
> Also note: `name` is now treated as required at the base prototype level and is explicitly present on the CIDR builder.
189+
190+
- **Patch model changes (remove `type`, new patch for Private Path)**
191+
Do **not** set `type` in patch payloads; the field and its builder setter were removed from CIDR patch:
192+
193+
```java
194+
// CIDR patch
195+
var patch = new AllowedOutboundDestinationPatchCidrBlockDataPatch.Builder()
196+
.cidrBlock("10.0.1.0/24")
197+
.build();
198+
```
199+
200+
New patch class for Private Path properties:
201+
202+
```java
203+
var ppPatch = new AllowedOutboundDestinationPatchPrivatePathServiceGatewayDataPatch.Builder()
204+
.isolationPolicy(AllowedOutboundDestinationPatchPrivatePathServiceGatewayDataPatch.IsolationPolicy.DEDICATED)
205+
.build();
206+
```
207+
208+
- **New prototype to create Private Path destinations**
209+
Use the new prototype when creating an allowed outbound destination that connects to a VPC Private Path service:
210+
211+
```java
212+
var ppProto =
213+
new AllowedOutboundDestinationPrototypePrivatePathServiceGatewayDataPrototype.Builder(
214+
AllowedOutboundDestinationPrototype.Type.PRIVATE_PATH_SERVICE_GATEWAY,
215+
"pps-to-service-x",
216+
"<private-path-service-gateway-crn>"
217+
)
218+
.isolationPolicy(AllowedOutboundDestinationPrototypePrivatePathServiceGatewayDataPrototype.IsolationPolicy.SHARED)
219+
.build();
220+
```
221+
222+
> Ensure your code handles both types: `"cidr_block"` and `"private_path_service_gateway"`.
223+
224+
- **Model/enums additions affecting branching/validation**
225+
If your client code switches on type/status/isolation policy strings, update cases to include the new values:
226+
227+
```java
228+
// AllowedOutboundDestination.Type
229+
CIDR_BLOCK
230+
PRIVATE_PATH_SERVICE_GATEWAY
231+
232+
// AllowedOutboundDestination.Status
233+
READY
234+
FAILED
235+
DEPLOYING
236+
237+
// AllowedOutboundDestination.IsolationPolicy
238+
SHARED
239+
DEDICATED
240+
```
241+
242+
New fields were added to `AllowedOutboundDestination`:
243+
244+
- `name`
245+
- `status`
246+
- `statusDetails` (with types `AllowedOutboundStatusDetails`, `AllowedOutboundStatusDetailsPrivatePathServiceGatewayStatusDetails`)
247+
- `privatePathServiceGatewayCrn`
248+
- `isolationPolicy`
249+
250+
And new helper models:
251+
252+
- `EndpointGatewayDetails`
253+
- `PrivatePathServiceGatewayDetails`
254+
255+
- **Examples updated (if you copy/paste from `CodeEngineExamples`)**
256+
- Method usage and region tags renamed:
257+
- `listAllowedOutboundDestination` → `listAllowedOutboundDestinations` (and `begin/end` tags)
258+
- `listPersistentDataStore` → `listPersistentDataStores` (and `begin/end` tags)
259+
- Pager classes updated to plural forms.
260+
- CIDR prototype builder now sets `.name(..)` before `.cidrBlock(..)` and matches the new constructor order.
261+
262+
> **Action checklist:**
263+
>
264+
> - [ ] Rename service methods: `listAllowedOutboundDestinations`, `listPersistentDataStores`.
265+
> - [ ] Replace options classes and imports with pluralized names.
266+
> - [ ] Replace pager classes with pluralized versions and update example region tags if referenced.
267+
> - [ ] Adjust CIDR prototype builder constructor order to `(type, name, cidrBlock)`.
268+
> - [ ] Remove any `type` usage from patch builders; use CIDR or Private Path patch models as appropriate.
269+
> - [ ] Use the new Private Path prototype for creating Private Path destinations; add handling for new enums (`PRIVATE_PATH_SERVICE_GATEWAY`, status, isolation policy).
270+
89271
## Questions
90272

91273
If you are having difficulties using this SDK or have a question about the IBM Cloud services,
@@ -109,4 +291,4 @@ See [CONTRIBUTING](CONTRIBUTING.md).
109291
## License
110292

111293
The IBM Cloud Code Engine Java SDK is released under the Apache 2.0 license.
112-
The license's full text can be found in [LICENSE](LICENSE).
294+
The license's full text can be found in [LICENSE](LICENSE).

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

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* (C) Copyright IBM Corp. 2025.
2+
* (C) Copyright IBM Corp. 2026.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -85,7 +85,7 @@
8585
import com.ibm.cloud.code_engine.code_engine.v2.model.JobList;
8686
import com.ibm.cloud.code_engine.code_engine.v2.model.JobRun;
8787
import com.ibm.cloud.code_engine.code_engine.v2.model.JobRunList;
88-
import com.ibm.cloud.code_engine.code_engine.v2.model.ListAllowedOutboundDestinationOptions;
88+
import com.ibm.cloud.code_engine.code_engine.v2.model.ListAllowedOutboundDestinationsOptions;
8989
import com.ibm.cloud.code_engine.code_engine.v2.model.ListAppInstancesOptions;
9090
import com.ibm.cloud.code_engine.code_engine.v2.model.ListAppRevisionsOptions;
9191
import com.ibm.cloud.code_engine.code_engine.v2.model.ListAppsOptions;
@@ -98,7 +98,7 @@
9898
import com.ibm.cloud.code_engine.code_engine.v2.model.ListFunctionsOptions;
9999
import com.ibm.cloud.code_engine.code_engine.v2.model.ListJobRunsOptions;
100100
import com.ibm.cloud.code_engine.code_engine.v2.model.ListJobsOptions;
101-
import com.ibm.cloud.code_engine.code_engine.v2.model.ListPersistentDataStoreOptions;
101+
import com.ibm.cloud.code_engine.code_engine.v2.model.ListPersistentDataStoresOptions;
102102
import com.ibm.cloud.code_engine.code_engine.v2.model.ListProjectsOptions;
103103
import com.ibm.cloud.code_engine.code_engine.v2.model.ListSecretsOptions;
104104
import com.ibm.cloud.code_engine.code_engine.v2.model.PersistentDataStore;
@@ -188,7 +188,7 @@ public CodeEngine(String serviceName, Authenticator authenticator) {
188188
* Gets the version.
189189
*
190190
* The API version, in format `YYYY-MM-DD`. For the API behavior documented here, specify any date between
191-
* `2021-03-31` and `2025-08-27`.
191+
* `2021-03-31` and `2026-02-23`.
192192
*
193193
* @return the version
194194
*/
@@ -340,25 +340,25 @@ public ServiceCall<Project> getProject(GetProjectOptions getProjectOptions) {
340340
*
341341
* List all allowed outbound destinations in a project.
342342
*
343-
* @param listAllowedOutboundDestinationOptions the {@link ListAllowedOutboundDestinationOptions} containing the options for the call
343+
* @param listAllowedOutboundDestinationsOptions the {@link ListAllowedOutboundDestinationsOptions} containing the options for the call
344344
* @return a {@link ServiceCall} with a result of type {@link AllowedOutboundDestinationList}
345345
*/
346-
public ServiceCall<AllowedOutboundDestinationList> listAllowedOutboundDestination(ListAllowedOutboundDestinationOptions listAllowedOutboundDestinationOptions) {
347-
com.ibm.cloud.sdk.core.util.Validator.notNull(listAllowedOutboundDestinationOptions,
348-
"listAllowedOutboundDestinationOptions cannot be null");
346+
public ServiceCall<AllowedOutboundDestinationList> listAllowedOutboundDestinations(ListAllowedOutboundDestinationsOptions listAllowedOutboundDestinationsOptions) {
347+
com.ibm.cloud.sdk.core.util.Validator.notNull(listAllowedOutboundDestinationsOptions,
348+
"listAllowedOutboundDestinationsOptions cannot be null");
349349
Map<String, String> pathParamsMap = new HashMap<String, String>();
350-
pathParamsMap.put("project_id", listAllowedOutboundDestinationOptions.projectId());
350+
pathParamsMap.put("project_id", listAllowedOutboundDestinationsOptions.projectId());
351351
RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/projects/{project_id}/allowed_outbound_destinations", pathParamsMap));
352-
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("code_engine", "v2", "listAllowedOutboundDestination");
352+
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("code_engine", "v2", "listAllowedOutboundDestinations");
353353
for (Entry<String, String> header : sdkHeaders.entrySet()) {
354354
builder.header(header.getKey(), header.getValue());
355355
}
356356
builder.header("Accept", "application/json");
357-
if (listAllowedOutboundDestinationOptions.limit() != null) {
358-
builder.query("limit", String.valueOf(listAllowedOutboundDestinationOptions.limit()));
357+
if (listAllowedOutboundDestinationsOptions.limit() != null) {
358+
builder.query("limit", String.valueOf(listAllowedOutboundDestinationsOptions.limit()));
359359
}
360-
if (listAllowedOutboundDestinationOptions.start() != null) {
361-
builder.query("start", String.valueOf(listAllowedOutboundDestinationOptions.start()));
360+
if (listAllowedOutboundDestinationsOptions.start() != null) {
361+
builder.query("start", String.valueOf(listAllowedOutboundDestinationsOptions.start()));
362362
}
363363
ResponseConverter<AllowedOutboundDestinationList> responseConverter =
364364
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<AllowedOutboundDestinationList>() { }.getType());
@@ -1502,7 +1502,7 @@ public ServiceCall<BindingList> listBindings(ListBindingsOptions listBindingsOpt
15021502
*
15031503
* Create a binding. Creating a service binding with a Code Engine app will update the app, creating a new revision.
15041504
* For more information see the
1505-
* [documentaion](https://cloud.ibm.com/docs/codeengine?topic=codeengine-service-binding).
1505+
* [documentation](https://cloud.ibm.com/docs/codeengine?topic=codeengine-service-binding).
15061506
*
15071507
* @param createBindingOptions the {@link CreateBindingOptions} containing the options for the call
15081508
* @return a {@link ServiceCall} with a result of type {@link Binding}
@@ -2399,28 +2399,28 @@ public ServiceCall<Secret> replaceSecret(ReplaceSecretOptions replaceSecretOptio
23992399
*
24002400
* List all persistent data stores in a project.
24012401
*
2402-
* @param listPersistentDataStoreOptions the {@link ListPersistentDataStoreOptions} containing the options for the call
2402+
* @param listPersistentDataStoresOptions the {@link ListPersistentDataStoresOptions} containing the options for the call
24032403
* @return a {@link ServiceCall} with a result of type {@link PersistentDataStoreList}
24042404
*/
2405-
public ServiceCall<PersistentDataStoreList> listPersistentDataStore(ListPersistentDataStoreOptions listPersistentDataStoreOptions) {
2406-
com.ibm.cloud.sdk.core.util.Validator.notNull(listPersistentDataStoreOptions,
2407-
"listPersistentDataStoreOptions cannot be null");
2405+
public ServiceCall<PersistentDataStoreList> listPersistentDataStores(ListPersistentDataStoresOptions listPersistentDataStoresOptions) {
2406+
com.ibm.cloud.sdk.core.util.Validator.notNull(listPersistentDataStoresOptions,
2407+
"listPersistentDataStoresOptions cannot be null");
24082408
Map<String, String> pathParamsMap = new HashMap<String, String>();
2409-
pathParamsMap.put("project_id", listPersistentDataStoreOptions.projectId());
2409+
pathParamsMap.put("project_id", listPersistentDataStoresOptions.projectId());
24102410
RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/projects/{project_id}/persistent_data_stores", pathParamsMap));
2411-
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("code_engine", "v2", "listPersistentDataStore");
2411+
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("code_engine", "v2", "listPersistentDataStores");
24122412
for (Entry<String, String> header : sdkHeaders.entrySet()) {
24132413
builder.header(header.getKey(), header.getValue());
24142414
}
24152415
builder.header("Accept", "application/json");
24162416
if (this.version != null) {
24172417
builder.query("version", String.valueOf(this.version));
24182418
}
2419-
if (listPersistentDataStoreOptions.limit() != null) {
2420-
builder.query("limit", String.valueOf(listPersistentDataStoreOptions.limit()));
2419+
if (listPersistentDataStoresOptions.limit() != null) {
2420+
builder.query("limit", String.valueOf(listPersistentDataStoresOptions.limit()));
24212421
}
2422-
if (listPersistentDataStoreOptions.start() != null) {
2423-
builder.query("start", String.valueOf(listPersistentDataStoreOptions.start()));
2422+
if (listPersistentDataStoresOptions.start() != null) {
2423+
builder.query("start", String.valueOf(listPersistentDataStoresOptions.start()));
24242424
}
24252425
ResponseConverter<PersistentDataStoreList> responseConverter =
24262426
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<PersistentDataStoreList>() { }.getType());

0 commit comments

Comments
 (0)