Skip to content

Commit ac5a9b5

Browse files
committed
SDK regen'd using latest swagger, manual ResponseConverter fix
1 parent 78e67c6 commit ac5a9b5

5 files changed

Lines changed: 25 additions & 37 deletions

File tree

modules/examples/pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,27 @@
3939
<plugin>
4040
<groupId>org.apache.maven.plugins</groupId>
4141
<artifactId>maven-shade-plugin</artifactId>
42+
<executions>
43+
<execution>
44+
<phase>package</phase>
45+
<goals>
46+
<goal>shade</goal>
47+
</goals>
48+
<configuration>
49+
<minimizeJar>true</minimizeJar>
50+
<filters>
51+
<filter>
52+
<artifact>*:*</artifact>
53+
<excludes>
54+
<exclude>META-INF/*.SF</exclude>
55+
<exclude>META-INF/*.DSA</exclude>
56+
<exclude>META-INF/*.RSA</exclude>
57+
</excludes>
58+
</filter>
59+
</filters>
60+
</configuration>
61+
</execution>
62+
</executions>
4263
</plugin>
4364
<plugin>
4465
<!-- Build an executable JAR -->

modules/ibm-cloud-code-engine/src/main/java/com/ibm/cloud/code_engine/ibm_cloud_code_engine/v1/IbmCloudCodeEngine.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,9 @@ public ServiceCall<String> listKubeconfig(ListKubeconfigOptions listKubeconfigOp
9494
for (Entry<String, String> header : sdkHeaders.entrySet()) {
9595
builder.header(header.getKey(), header.getValue());
9696
}
97+
builder.header("Accept", "text/plain");
9798
builder.header("Refresh-Token", listKubeconfigOptions.refreshToken());
98-
if (listKubeconfigOptions.accept() != null) {
99-
builder.header("Accept", listKubeconfigOptions.accept());
100-
}
101-
ResponseConverter<String> responseConverter =
102-
ResponseConverterUtils.getValue(new com.google.gson.reflect.TypeToken<String>() { }.getType());
99+
ResponseConverter<String> responseConverter = ResponseConverterUtils.getString();
103100
return createServiceCall(builder.build(), responseConverter);
104101
}
105102

modules/ibm-cloud-code-engine/src/main/java/com/ibm/cloud/code_engine/ibm_cloud_code_engine/v1/model/ListKubeconfigOptions.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,17 @@ public class ListKubeconfigOptions extends GenericModel {
2121

2222
protected String refreshToken;
2323
protected String id;
24-
protected String accept;
2524

2625
/**
2726
* Builder.
2827
*/
2928
public static class Builder {
3029
private String refreshToken;
3130
private String id;
32-
private String accept;
3331

3432
private Builder(ListKubeconfigOptions listKubeconfigOptions) {
3533
this.refreshToken = listKubeconfigOptions.refreshToken;
3634
this.id = listKubeconfigOptions.id;
37-
this.accept = listKubeconfigOptions.accept;
3835
}
3936

4037
/**
@@ -84,17 +81,6 @@ public Builder id(String id) {
8481
this.id = id;
8582
return this;
8683
}
87-
88-
/**
89-
* Set the accept.
90-
*
91-
* @param accept the accept
92-
* @return the ListKubeconfigOptions builder
93-
*/
94-
public Builder accept(String accept) {
95-
this.accept = accept;
96-
return this;
97-
}
9884
}
9985

10086
protected ListKubeconfigOptions(Builder builder) {
@@ -104,7 +90,6 @@ protected ListKubeconfigOptions(Builder builder) {
10490
"id cannot be empty");
10591
refreshToken = builder.refreshToken;
10692
id = builder.id;
107-
accept = builder.accept;
10893
}
10994

11095
/**
@@ -137,17 +122,5 @@ public String refreshToken() {
137122
public String id() {
138123
return id;
139124
}
140-
141-
/**
142-
* Gets the accept.
143-
*
144-
* The type of the response: text/html or application/json. A character encoding can be specified by including a
145-
* `charset` parameter. For example, 'text/html;charset=utf-8'.
146-
*
147-
* @return the accept
148-
*/
149-
public String accept() {
150-
return accept;
151-
}
152125
}
153126

modules/ibm-cloud-code-engine/src/test/java/com/ibm/cloud/code_engine/ibm_cloud_code_engine/v1/IbmCloudCodeEngineTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ public void testConstructorWithNullAuthenticator() throws Throwable {
8787
@Test
8888
public void testListKubeconfigWOptions() throws Throwable {
8989
// Schedule some responses.
90-
String mockResponseBody = "\"operationResponse\"";
90+
String mockResponseBody = "\"apiVersion: v1 clusters: - cluster: server: https://proxy.us-south.codeengine.test.cloud.ibm.com name: https://proxy.us-south.codeengine.test.cloud.ibm.com contexts: - context: cluster: https://proxy.us-south.codeengine.test.cloud.ibm.com user: <userID> namespace: <namespace> name: <namespace> current-context: <current namespace> kind: Config preferences: {} users: - name: <userID> user: auth-provider: name: oidc config: client-id: ce client-secret: ce id-token: <id-token> idp-issuer-url: https://iam.test.cloud.ibm.com/identity refresh-token: <refresh-token>\"";
9191
String listKubeconfigPath = java.net.URLEncoder.encode("/namespaces/testString/config", "UTF-8").replace("%2F", "/");
9292

9393
server.enqueue(new MockResponse()
94-
.setHeader("Content-type", "text/html")
94+
.setHeader("Content-type", "text/plain")
9595
.setResponseCode(200)
9696
.setBody(mockResponseBody));
9797

@@ -101,7 +101,6 @@ public void testListKubeconfigWOptions() throws Throwable {
101101
ListKubeconfigOptions listKubeconfigOptionsModel = new ListKubeconfigOptions.Builder()
102102
.refreshToken("testString")
103103
.id("testString")
104-
.accept("text/html")
105104
.build();
106105

107106
// Invoke operation with valid options model (positive test)

modules/ibm-cloud-code-engine/src/test/java/com/ibm/cloud/code_engine/ibm_cloud_code_engine/v1/model/ListKubeconfigOptionsTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ public void testListKubeconfigOptions() throws Throwable {
3737
ListKubeconfigOptions listKubeconfigOptionsModel = new ListKubeconfigOptions.Builder()
3838
.refreshToken("testString")
3939
.id("testString")
40-
.accept("text/html")
4140
.build();
4241
assertEquals(listKubeconfigOptionsModel.refreshToken(), "testString");
4342
assertEquals(listKubeconfigOptionsModel.id(), "testString");
44-
assertEquals(listKubeconfigOptionsModel.accept(), "text/html");
4543
}
4644

4745
@Test(expectedExceptions = IllegalArgumentException.class)

0 commit comments

Comments
 (0)