Skip to content

Commit 36b34c0

Browse files
SDK regeneration (#333)
1 parent cd7d0ea commit 36b34c0

Some content is hidden

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

50 files changed

+5397
-609
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ java {
4444

4545
group = 'io.intercom'
4646

47-
version = '3.0.0-alpha0'
47+
version = '3.0.0-alpha4'
4848

4949
jar {
5050
dependsOn(":generatePomFileForMavenPublication")
@@ -71,7 +71,7 @@ publishing {
7171
maven(MavenPublication) {
7272
groupId = 'io.intercom'
7373
artifactId = 'intercom-java'
74-
version = '3.0.0-alpha0'
74+
version = '3.0.0-alpha4'
7575
from components.java
7676
pom {
7777
licenses {

src/main/java/com/intercom/api/core/ApiVersion.java

Lines changed: 208 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,240 @@
33
*/
44
package com.intercom.api.core;
55

6+
import com.fasterxml.jackson.annotation.JsonCreator;
67
import com.fasterxml.jackson.annotation.JsonValue;
78

8-
public enum ApiVersion {
9-
_1_0("1.0"),
9+
public final class ApiVersion {
10+
public static final ApiVersion _2_1 = new ApiVersion(Value._2_1, "2.1");
1011

11-
_1_1("1.1"),
12+
public static final ApiVersion _2_2 = new ApiVersion(Value._2_2, "2.2");
1213

13-
_1_2("1.2"),
14+
public static final ApiVersion _1_0 = new ApiVersion(Value._1_0, "1.0");
1415

15-
_1_3("1.3"),
16+
public static final ApiVersion _2_3 = new ApiVersion(Value._2_3, "2.3");
1617

17-
_1_4("1.4"),
18+
public static final ApiVersion _1_1 = new ApiVersion(Value._1_1, "1.1");
1819

19-
_2_0("2.0"),
20+
public static final ApiVersion _2_4 = new ApiVersion(Value._2_4, "2.4");
2021

21-
_2_1("2.1"),
22+
public static final ApiVersion _1_2 = new ApiVersion(Value._1_2, "1.2");
2223

23-
_2_2("2.2"),
24+
public static final ApiVersion _2_5 = new ApiVersion(Value._2_5, "2.5");
2425

25-
_2_3("2.3"),
26+
public static final ApiVersion _1_3 = new ApiVersion(Value._1_3, "1.3");
2627

27-
_2_4("2.4"),
28+
public static final ApiVersion _2_6 = new ApiVersion(Value._2_6, "2.6");
2829

29-
_2_5("2.5"),
30+
public static final ApiVersion _1_4 = new ApiVersion(Value._1_4, "1.4");
3031

31-
_2_6("2.6"),
32+
public static final ApiVersion _2_7 = new ApiVersion(Value._2_7, "2.7");
3233

33-
_2_7("2.7"),
34+
public static final ApiVersion _2_8 = new ApiVersion(Value._2_8, "2.8");
3435

35-
_2_8("2.8"),
36+
public static final ApiVersion _2_10 = new ApiVersion(Value._2_10, "2.10");
3637

37-
_2_9("2.9"),
38+
public static final ApiVersion _2_9 = new ApiVersion(Value._2_9, "2.9");
3839

39-
_2_10("2.10"),
40+
public static final ApiVersion _2_11 = new ApiVersion(Value._2_11, "2.11");
4041

41-
_2_11("2.11"),
42+
public static final ApiVersion UNSTABLE = new ApiVersion(Value.UNSTABLE, "Unstable");
4243

43-
UNSTABLE("Unstable"),
44+
public static final ApiVersion _2_0 = new ApiVersion(Value._2_0, "2.0");
4445

45-
CURRENT("2.11");
46+
private final Value value;
4647

47-
private final String value;
48+
private final String string;
4849

49-
ApiVersion(String value) {
50+
ApiVersion(Value value, String string) {
5051
this.value = value;
52+
this.string = string;
53+
}
54+
55+
public Value getEnumValue() {
56+
return value;
5157
}
5258

53-
@JsonValue
5459
@java.lang.Override
60+
@JsonValue
5561
public String toString() {
56-
return this.value;
62+
return this.string;
63+
}
64+
65+
@java.lang.Override
66+
public boolean equals(Object other) {
67+
return (this == other) || (other instanceof ApiVersion && this.string.equals(((ApiVersion) other).string));
68+
}
69+
70+
@java.lang.Override
71+
public int hashCode() {
72+
return this.string.hashCode();
73+
}
74+
75+
public <T> T visit(Visitor<T> visitor) {
76+
switch (value) {
77+
case _2_1:
78+
return visitor.visit_21();
79+
case _2_2:
80+
return visitor.visit_22();
81+
case _1_0:
82+
return visitor.visit_10();
83+
case _2_3:
84+
return visitor.visit_23();
85+
case _1_1:
86+
return visitor.visit_11();
87+
case _2_4:
88+
return visitor.visit_24();
89+
case _1_2:
90+
return visitor.visit_12();
91+
case _2_5:
92+
return visitor.visit_25();
93+
case _1_3:
94+
return visitor.visit_13();
95+
case _2_6:
96+
return visitor.visit_26();
97+
case _1_4:
98+
return visitor.visit_14();
99+
case _2_7:
100+
return visitor.visit_27();
101+
case _2_8:
102+
return visitor.visit_28();
103+
case _2_10:
104+
return visitor.visit_210();
105+
case _2_9:
106+
return visitor.visit_29();
107+
case _2_11:
108+
return visitor.visit_211();
109+
case UNSTABLE:
110+
return visitor.visitUnstable();
111+
case _2_0:
112+
return visitor.visit_20();
113+
case UNKNOWN:
114+
default:
115+
return visitor.visitUnknown(string);
116+
}
117+
}
118+
119+
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
120+
public static ApiVersion valueOf(String value) {
121+
switch (value) {
122+
case "2.1":
123+
return _2_1;
124+
case "2.2":
125+
return _2_2;
126+
case "1.0":
127+
return _1_0;
128+
case "2.3":
129+
return _2_3;
130+
case "1.1":
131+
return _1_1;
132+
case "2.4":
133+
return _2_4;
134+
case "1.2":
135+
return _1_2;
136+
case "2.5":
137+
return _2_5;
138+
case "1.3":
139+
return _1_3;
140+
case "2.6":
141+
return _2_6;
142+
case "1.4":
143+
return _1_4;
144+
case "2.7":
145+
return _2_7;
146+
case "2.8":
147+
return _2_8;
148+
case "2.10":
149+
return _2_10;
150+
case "2.9":
151+
return _2_9;
152+
case "2.11":
153+
return _2_11;
154+
case "Unstable":
155+
return UNSTABLE;
156+
case "2.0":
157+
return _2_0;
158+
default:
159+
return new ApiVersion(Value.UNKNOWN, value);
160+
}
161+
}
162+
163+
public enum Value {
164+
_1_0,
165+
166+
_1_1,
167+
168+
_1_2,
169+
170+
_1_3,
171+
172+
_1_4,
173+
174+
_2_0,
175+
176+
_2_1,
177+
178+
_2_2,
179+
180+
_2_3,
181+
182+
_2_4,
183+
184+
_2_5,
185+
186+
_2_6,
187+
188+
_2_7,
189+
190+
_2_8,
191+
192+
_2_9,
193+
194+
_2_10,
195+
196+
_2_11,
197+
198+
UNSTABLE,
199+
200+
UNKNOWN
201+
}
202+
203+
public interface Visitor<T> {
204+
T visit_10();
205+
206+
T visit_11();
207+
208+
T visit_12();
209+
210+
T visit_13();
211+
212+
T visit_14();
213+
214+
T visit_20();
215+
216+
T visit_21();
217+
218+
T visit_22();
219+
220+
T visit_23();
221+
222+
T visit_24();
223+
224+
T visit_25();
225+
226+
T visit_26();
227+
228+
T visit_27();
229+
230+
T visit_28();
231+
232+
T visit_29();
233+
234+
T visit_210();
235+
236+
T visit_211();
237+
238+
T visitUnstable();
239+
240+
T visitUnknown(String unknownType);
57241
}
58242
}

src/main/java/com/intercom/api/core/ClientOptions.java

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,7 @@ public final class ClientOptions {
2727
private final ApiVersion version;
2828

2929
/**
30-
* @param version Defaults to "{\n"
31-
* + " \"name\" : {\n"
32-
* + " \"wireValue\" : \"2.11\",\n"
33-
* + " \"name\" : {\n"
34-
* + " \"originalName\" : \"2.11\",\n"
35-
* + " \"camelCase\" : {\n"
36-
* + " \"unsafeName\" : \"211\",\n"
37-
* + " \"safeName\" : \"_211\"\n"
38-
* + " },\n"
39-
* + " \"pascalCase\" : {\n"
40-
* + " \"unsafeName\" : \"211\",\n"
41-
* + " \"safeName\" : \"_211\"\n"
42-
* + " },\n"
43-
* + " \"snakeCase\" : {\n"
44-
* + " \"unsafeName\" : \"2_11\",\n"
45-
* + " \"safeName\" : \"_2_11\"\n"
46-
* + " },\n"
47-
* + " \"screamingSnakeCase\" : {\n"
48-
* + " \"unsafeName\" : \"2_11\",\n"
49-
* + " \"safeName\" : \"_2_11\"\n"
50-
* + " }\n"
51-
* + " }\n"
52-
* + " }\n"
53-
* + "}" if empty
30+
* @param version Defaults to "2.11" if empty
5431
*/
5532
private ClientOptions(
5633
Environment environment,
@@ -64,16 +41,16 @@ private ClientOptions(
6441
this.headers.putAll(headers);
6542
this.headers.putAll(new HashMap<String, String>() {
6643
{
67-
put("User-Agent", "io.intercom:intercom-java/3.0.0-alpha0");
44+
put("User-Agent", "io.intercom:intercom-java/3.0.0-alpha4");
6845
put("X-Fern-Language", "JAVA");
6946
put("X-Fern-SDK-Name", "com.intercom.fern:api-sdk");
70-
put("X-Fern-SDK-Version", "3.0.0-alpha0");
47+
put("X-Fern-SDK-Version", "3.0.0-alpha4");
7148
}
7249
});
7350
this.headerSuppliers = headerSuppliers;
7451
this.httpClient = httpClient;
7552
this.timeout = timeout;
76-
this.version = version.orElse(ApiVersion.CURRENT);
53+
this.version = version.orElse(ApiVersion._2_11);
7754
this.headers.put("Intercom-Version", this.version.toString());
7855
}
7956

0 commit comments

Comments
 (0)