@ahmttyydn/java-integration 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +762 -0
- package/README.md +37 -0
- package/package.json +46 -0
- package/pom.xml +242 -0
- package/scalar-core/pom.xml +92 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/ScalarConstants.java +26 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/ScalarHtmlRenderer.java +135 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/ScalarProperties.java +596 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/authentication/ScalarAuthenticationOptions.java +235 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/authentication/flows/AuthorizationCodeFlow.java +160 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/authentication/flows/ClientCredentialsFlow.java +88 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/authentication/flows/ImplicitFlow.java +64 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/authentication/flows/OAuthFlow.java +185 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/authentication/flows/PasswordFlow.java +134 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/authentication/flows/ScalarFlows.java +113 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/authentication/schemes/ScalarApiKeySecurityScheme.java +77 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/authentication/schemes/ScalarHttpSecurityScheme.java +115 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/authentication/schemes/ScalarOAuth2SecurityScheme.java +75 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/authentication/schemes/ScalarSecurityScheme.java +45 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/config/DefaultHttpClient.java +77 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/config/ScalarAgentOptions.java +68 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/config/ScalarServer.java +197 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/config/ScalarSource.java +151 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/enums/CredentialsLocation.java +52 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/enums/DeveloperToolsVisibility.java +58 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/enums/DocumentDownloadType.java +67 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/enums/OperationSorter.java +52 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/enums/OperationTitleSource.java +52 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/enums/Pkce.java +57 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/enums/PropertyOrder.java +53 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/enums/ScalarClient.java +208 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/enums/ScalarLayout.java +52 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/enums/ScalarTarget.java +158 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/enums/ScalarTheme.java +102 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/enums/TagSorter.java +47 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/enums/ThemeMode.java +52 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/internal/ScalarConfiguration.java +425 -0
- package/scalar-core/src/main/java/com/scalar/maven/core/internal/ScalarConfigurationMapper.java +69 -0
- package/scalar-core/src/main/resources/META-INF/resources/webjars/scalar/index.html +22 -0
- package/scalar-core/src/test/java/com/scalar/maven/core/ScalarConfigurationTest.java +144 -0
- package/scalar-core/src/test/java/com/scalar/maven/core/ScalarHtmlRendererTest.java +104 -0
- package/scalar-core/src/test/java/com/scalar/maven/core/ScalarPropertiesTest.java +525 -0
- package/scalar-core/src/test/java/com/scalar/maven/core/config/DefaultHttpClientTest.java +61 -0
- package/scalar-core/src/test/java/com/scalar/maven/core/config/ScalarAgentOptionsTest.java +80 -0
- package/scalar-core/src/test/java/com/scalar/maven/core/config/ScalarServerTest.java +118 -0
- package/scalar-core/src/test/java/com/scalar/maven/core/config/ScalarSourceTest.java +105 -0
- package/scalar-playground-webflux/pom.xml +52 -0
- package/scalar-playground-webflux/src/main/java/com/scalar/maven/playground/CustomScalarWebFluxController.java +34 -0
- package/scalar-playground-webflux/src/main/java/com/scalar/maven/playground/PlaygroundApplication.java +27 -0
- package/scalar-playground-webflux/src/main/resources/application.properties +7 -0
- package/scalar-playground-webmvc/pom.xml +52 -0
- package/scalar-playground-webmvc/src/main/java/com/scalar/maven/playground/CustomScalarWebMvcController.java +34 -0
- package/scalar-playground-webmvc/src/main/java/com/scalar/maven/playground/PlaygroundApplication.java +27 -0
- package/scalar-playground-webmvc/src/main/resources/application.properties +7 -0
- package/scalar-webflux/pom.xml +110 -0
- package/scalar-webflux/src/main/java/com/scalar/maven/webflux/ScalarWebFluxActuatorEndpoint.java +103 -0
- package/scalar-webflux/src/main/java/com/scalar/maven/webflux/ScalarWebFluxAutoConfiguration.java +63 -0
- package/scalar-webflux/src/main/java/com/scalar/maven/webflux/ScalarWebFluxController.java +109 -0
- package/scalar-webflux/src/main/java/com/scalar/maven/webflux/SpringBootScalarProperties.java +43 -0
- package/scalar-webflux/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +2 -0
- package/scalar-webflux/src/test/java/com/scalar/maven/webflux/ScalarWebFluxActuatorEndpointTest.java +136 -0
- package/scalar-webflux/src/test/java/com/scalar/maven/webflux/ScalarWebFluxControllerTest.java +162 -0
- package/scalar-webmvc/pom.xml +103 -0
- package/scalar-webmvc/src/main/java/com/scalar/maven/webmvc/ScalarWebMvcActuatorEndpoint.java +97 -0
- package/scalar-webmvc/src/main/java/com/scalar/maven/webmvc/ScalarWebMvcAutoConfiguration.java +63 -0
- package/scalar-webmvc/src/main/java/com/scalar/maven/webmvc/ScalarWebMvcController.java +103 -0
- package/scalar-webmvc/src/main/java/com/scalar/maven/webmvc/SpringBootScalarProperties.java +43 -0
- package/scalar-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +2 -0
- package/scalar-webmvc/src/test/java/com/scalar/maven/webmvc/ScalarWebMvcActuatorEndpointTest.java +128 -0
- package/scalar-webmvc/src/test/java/com/scalar/maven/webmvc/ScalarWebMvcControllerTest.java +154 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
package com.scalar.maven.core.enums;
|
|
2
|
+
|
|
3
|
+
import com.fasterxml.jackson.annotation.JsonCreator;
|
|
4
|
+
import com.fasterxml.jackson.annotation.JsonValue;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents the sorting method for operations in the Scalar API Reference.
|
|
8
|
+
*/
|
|
9
|
+
public enum OperationSorter {
|
|
10
|
+
/**
|
|
11
|
+
* Sort operations alphabetically.
|
|
12
|
+
*/
|
|
13
|
+
ALPHA("alpha"),
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Sort operations by HTTP method.
|
|
17
|
+
*/
|
|
18
|
+
METHOD("method");
|
|
19
|
+
|
|
20
|
+
private final String value;
|
|
21
|
+
|
|
22
|
+
OperationSorter(String value) {
|
|
23
|
+
this.value = value;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Creates an OperationSorter from a string value.
|
|
28
|
+
*
|
|
29
|
+
* @param value the string value
|
|
30
|
+
* @return the corresponding OperationSorter
|
|
31
|
+
* @throws IllegalArgumentException if the value is not recognized
|
|
32
|
+
*/
|
|
33
|
+
@JsonCreator
|
|
34
|
+
public static OperationSorter fromValue(String value) {
|
|
35
|
+
for (OperationSorter sorter : values()) {
|
|
36
|
+
if (sorter.value.equals(value)) {
|
|
37
|
+
return sorter;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
throw new IllegalArgumentException("Unknown operation sorter: " + value);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Gets the string value for JSON serialization.
|
|
45
|
+
*
|
|
46
|
+
* @return the string value
|
|
47
|
+
*/
|
|
48
|
+
@JsonValue
|
|
49
|
+
public String getValue() {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
package com.scalar.maven.core.enums;
|
|
2
|
+
|
|
3
|
+
import com.fasterxml.jackson.annotation.JsonCreator;
|
|
4
|
+
import com.fasterxml.jackson.annotation.JsonValue;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents the source for operation titles in the Scalar API Reference.
|
|
8
|
+
*/
|
|
9
|
+
public enum OperationTitleSource {
|
|
10
|
+
/**
|
|
11
|
+
* Use the operation summary as the title.
|
|
12
|
+
*/
|
|
13
|
+
SUMMARY("summary"),
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Use the operation path as the title.
|
|
17
|
+
*/
|
|
18
|
+
PATH("path");
|
|
19
|
+
|
|
20
|
+
private final String value;
|
|
21
|
+
|
|
22
|
+
OperationTitleSource(String value) {
|
|
23
|
+
this.value = value;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Creates an OperationTitleSource from a string value.
|
|
28
|
+
*
|
|
29
|
+
* @param value the string value
|
|
30
|
+
* @return the corresponding OperationTitleSource
|
|
31
|
+
* @throws IllegalArgumentException if the value is not recognized
|
|
32
|
+
*/
|
|
33
|
+
@JsonCreator
|
|
34
|
+
public static OperationTitleSource fromValue(String value) {
|
|
35
|
+
for (OperationTitleSource source : values()) {
|
|
36
|
+
if (source.value.equals(value)) {
|
|
37
|
+
return source;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
throw new IllegalArgumentException("Unknown operation title source: " + value);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Gets the string value for JSON serialization.
|
|
45
|
+
*
|
|
46
|
+
* @return the string value
|
|
47
|
+
*/
|
|
48
|
+
@JsonValue
|
|
49
|
+
public String getValue() {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
package com.scalar.maven.core.enums;
|
|
2
|
+
|
|
3
|
+
import com.fasterxml.jackson.annotation.JsonCreator;
|
|
4
|
+
import com.fasterxml.jackson.annotation.JsonValue;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents PKCE (Proof Key for Code Exchange) options for OAuth2 flows.
|
|
8
|
+
*/
|
|
9
|
+
public enum Pkce {
|
|
10
|
+
/**
|
|
11
|
+
* Use SHA-256 for PKCE.
|
|
12
|
+
*/
|
|
13
|
+
SHA_256("SHA-256"),
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Use plain text for PKCE.
|
|
17
|
+
*/
|
|
18
|
+
PLAIN("plain"),
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Do not use PKCE.
|
|
22
|
+
*/
|
|
23
|
+
NO("no");
|
|
24
|
+
|
|
25
|
+
private final String value;
|
|
26
|
+
|
|
27
|
+
Pkce(String value) {
|
|
28
|
+
this.value = value;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Creates a Pkce from a string value.
|
|
33
|
+
*
|
|
34
|
+
* @param value the string value
|
|
35
|
+
* @return the corresponding Pkce
|
|
36
|
+
* @throws IllegalArgumentException if the value is not recognized
|
|
37
|
+
*/
|
|
38
|
+
@JsonCreator
|
|
39
|
+
public static Pkce fromValue(String value) {
|
|
40
|
+
for (Pkce pkce : values()) {
|
|
41
|
+
if (pkce.value.equals(value)) {
|
|
42
|
+
return pkce;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
throw new IllegalArgumentException("Unknown PKCE value: " + value);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Gets the string value for JSON serialization.
|
|
50
|
+
*
|
|
51
|
+
* @return the string value
|
|
52
|
+
*/
|
|
53
|
+
@JsonValue
|
|
54
|
+
public String getValue() {
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
package com.scalar.maven.core.enums;
|
|
2
|
+
|
|
3
|
+
import com.fasterxml.jackson.annotation.JsonCreator;
|
|
4
|
+
import com.fasterxml.jackson.annotation.JsonValue;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents the ordering method for schema properties in the Scalar API
|
|
8
|
+
* Reference.
|
|
9
|
+
*/
|
|
10
|
+
public enum PropertyOrder {
|
|
11
|
+
/**
|
|
12
|
+
* Sort properties alphabetically.
|
|
13
|
+
*/
|
|
14
|
+
ALPHA("alpha"),
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Preserve the original order from the OpenAPI document.
|
|
18
|
+
*/
|
|
19
|
+
PRESERVE("preserve");
|
|
20
|
+
|
|
21
|
+
private final String value;
|
|
22
|
+
|
|
23
|
+
PropertyOrder(String value) {
|
|
24
|
+
this.value = value;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Creates a PropertyOrder from a string value.
|
|
29
|
+
*
|
|
30
|
+
* @param value the string value
|
|
31
|
+
* @return the corresponding PropertyOrder
|
|
32
|
+
* @throws IllegalArgumentException if the value is not recognized
|
|
33
|
+
*/
|
|
34
|
+
@JsonCreator
|
|
35
|
+
public static PropertyOrder fromValue(String value) {
|
|
36
|
+
for (PropertyOrder order : values()) {
|
|
37
|
+
if (order.value.equals(value)) {
|
|
38
|
+
return order;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
throw new IllegalArgumentException("Unknown property order: " + value);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Gets the string value for JSON serialization.
|
|
46
|
+
*
|
|
47
|
+
* @return the string value
|
|
48
|
+
*/
|
|
49
|
+
@JsonValue
|
|
50
|
+
public String getValue() {
|
|
51
|
+
return value;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
//------------------------------------------------------------------------------
|
|
2
|
+
// <auto-generated>
|
|
3
|
+
// This code was generated by the Scalar Java enum generator.
|
|
4
|
+
// Source: /packages/snippetz/src/clients.ts
|
|
5
|
+
// Command: pnpm generate:java-enums
|
|
6
|
+
//
|
|
7
|
+
// Changes to this file may cause incorrect behavior and will be lost if
|
|
8
|
+
// the code is regenerated.
|
|
9
|
+
// </auto-generated>
|
|
10
|
+
//------------------------------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
package com.scalar.maven.core.enums;
|
|
13
|
+
|
|
14
|
+
import com.fasterxml.jackson.annotation.JsonCreator;
|
|
15
|
+
import com.fasterxml.jackson.annotation.JsonValue;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Represents the different clients available in Scalar.
|
|
19
|
+
*/
|
|
20
|
+
public enum ScalarClient {
|
|
21
|
+
/**
|
|
22
|
+
* AsyncHttp client.
|
|
23
|
+
*/
|
|
24
|
+
ASYNC_HTTP("asynchttp"),
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Axios client.
|
|
28
|
+
*/
|
|
29
|
+
AXIOS("axios"),
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* clj-http client.
|
|
33
|
+
*/
|
|
34
|
+
CLJ_HTTP("clj_http"),
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Cohttp client.
|
|
38
|
+
*/
|
|
39
|
+
CO_HTTP("cohttp"),
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Curl client.
|
|
43
|
+
*/
|
|
44
|
+
CURL("curl"),
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Fetch client.
|
|
48
|
+
*/
|
|
49
|
+
FETCH("fetch"),
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Guzzle client.
|
|
53
|
+
*/
|
|
54
|
+
GUZZLE("guzzle"),
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Http client.
|
|
58
|
+
*/
|
|
59
|
+
HTTP("http"),
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* HTTP/1.1 client.
|
|
63
|
+
*/
|
|
64
|
+
HTTP_11("http1.1"),
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* HttpClient client.
|
|
68
|
+
*/
|
|
69
|
+
HTTP_CLIENT("httpclient"),
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* HTTPie client.
|
|
73
|
+
*/
|
|
74
|
+
HTTPIE("httpie"),
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* HTTPX (Async) client.
|
|
78
|
+
*/
|
|
79
|
+
HTTPX_ASYNC("httpx_async"),
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* HTTPX (Sync) client.
|
|
83
|
+
*/
|
|
84
|
+
HTTPX_SYNC("httpx_sync"),
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* httr client.
|
|
88
|
+
*/
|
|
89
|
+
HTTR("httr"),
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* jQuery client.
|
|
93
|
+
*/
|
|
94
|
+
J_QUERY("jquery"),
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Libcurl client.
|
|
98
|
+
*/
|
|
99
|
+
LIBCURL("libcurl"),
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* net::http client.
|
|
103
|
+
*/
|
|
104
|
+
NATIVE("native"),
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* java.net.http client.
|
|
108
|
+
*/
|
|
109
|
+
NET_HTTP("nethttp"),
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* NSURLSession client.
|
|
113
|
+
*/
|
|
114
|
+
NSURL_SESSION("nsurlsession"),
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* ofetch client.
|
|
118
|
+
*/
|
|
119
|
+
O_FETCH("ofetch"),
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* OkHttp client.
|
|
123
|
+
*/
|
|
124
|
+
OK_HTTP("okhttp"),
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* http.client client.
|
|
128
|
+
*/
|
|
129
|
+
PYTHON3("python3"),
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Requests client.
|
|
133
|
+
*/
|
|
134
|
+
REQUESTS("requests"),
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* reqwest client.
|
|
138
|
+
*/
|
|
139
|
+
REQWEST("reqwest"),
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Invoke-RestMethod client.
|
|
143
|
+
*/
|
|
144
|
+
REST_METHOD("restmethod"),
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* RestSharp client.
|
|
148
|
+
*/
|
|
149
|
+
REST_SHARP("restsharp"),
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* undici client.
|
|
153
|
+
*/
|
|
154
|
+
UNDICI("undici"),
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Unirest client.
|
|
158
|
+
*/
|
|
159
|
+
UNIREST("unirest"),
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Invoke-WebRequest client.
|
|
163
|
+
*/
|
|
164
|
+
WEB_REQUEST("webrequest"),
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Wget client.
|
|
168
|
+
*/
|
|
169
|
+
WGET("wget"),
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* XHR client.
|
|
173
|
+
*/
|
|
174
|
+
XHR("xhr");
|
|
175
|
+
|
|
176
|
+
private final String value;
|
|
177
|
+
|
|
178
|
+
ScalarClient(String value) {
|
|
179
|
+
this.value = value;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Creates a ScalarClient from a string value.
|
|
184
|
+
*
|
|
185
|
+
* @param value the string value
|
|
186
|
+
* @return the corresponding ScalarClient
|
|
187
|
+
* @throws IllegalArgumentException if the value is not recognized
|
|
188
|
+
*/
|
|
189
|
+
@JsonCreator
|
|
190
|
+
public static ScalarClient fromValue(String value) {
|
|
191
|
+
for (ScalarClient client : values()) {
|
|
192
|
+
if (client.value.equals(value)) {
|
|
193
|
+
return client;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
throw new IllegalArgumentException("Unknown client: " + value);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Gets the string value for JSON serialization.
|
|
201
|
+
*
|
|
202
|
+
* @return the string value
|
|
203
|
+
*/
|
|
204
|
+
@JsonValue
|
|
205
|
+
public String getValue() {
|
|
206
|
+
return value;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
package com.scalar.maven.core.enums;
|
|
2
|
+
|
|
3
|
+
import com.fasterxml.jackson.annotation.JsonCreator;
|
|
4
|
+
import com.fasterxml.jackson.annotation.JsonValue;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Represents the layout for the Scalar API Reference.
|
|
8
|
+
*/
|
|
9
|
+
public enum ScalarLayout {
|
|
10
|
+
/**
|
|
11
|
+
* Modern layout style.
|
|
12
|
+
*/
|
|
13
|
+
MODERN("modern"),
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Classic layout style.
|
|
17
|
+
*/
|
|
18
|
+
CLASSIC("classic");
|
|
19
|
+
|
|
20
|
+
private final String value;
|
|
21
|
+
|
|
22
|
+
ScalarLayout(String value) {
|
|
23
|
+
this.value = value;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Creates a ScalarLayout from a string value.
|
|
28
|
+
*
|
|
29
|
+
* @param value the string value
|
|
30
|
+
* @return the corresponding ScalarLayout
|
|
31
|
+
* @throws IllegalArgumentException if the value is not recognized
|
|
32
|
+
*/
|
|
33
|
+
@JsonCreator
|
|
34
|
+
public static ScalarLayout fromValue(String value) {
|
|
35
|
+
for (ScalarLayout layout : values()) {
|
|
36
|
+
if (layout.value.equals(value)) {
|
|
37
|
+
return layout;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
throw new IllegalArgumentException("Unknown layout: " + value);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Gets the string value for JSON serialization.
|
|
45
|
+
*
|
|
46
|
+
* @return the string value
|
|
47
|
+
*/
|
|
48
|
+
@JsonValue
|
|
49
|
+
public String getValue() {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
//------------------------------------------------------------------------------
|
|
2
|
+
// <auto-generated>
|
|
3
|
+
// This code was generated by the Scalar Java enum generator.
|
|
4
|
+
// Source: /packages/snippetz/src/clients.ts
|
|
5
|
+
// Command: pnpm generate:java-enums
|
|
6
|
+
//
|
|
7
|
+
// Changes to this file may cause incorrect behavior and will be lost if
|
|
8
|
+
// the code is regenerated.
|
|
9
|
+
// </auto-generated>
|
|
10
|
+
//------------------------------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
package com.scalar.maven.core.enums;
|
|
13
|
+
|
|
14
|
+
import com.fasterxml.jackson.annotation.JsonCreator;
|
|
15
|
+
import com.fasterxml.jackson.annotation.JsonValue;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Represents the different targets available in Scalar.
|
|
19
|
+
*/
|
|
20
|
+
public enum ScalarTarget {
|
|
21
|
+
/**
|
|
22
|
+
* C.
|
|
23
|
+
*/
|
|
24
|
+
C("c"),
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Clojure.
|
|
28
|
+
*/
|
|
29
|
+
CLOJURE("clojure"),
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* C#.
|
|
33
|
+
*/
|
|
34
|
+
CSHARP("csharp"),
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Dart.
|
|
38
|
+
*/
|
|
39
|
+
DART("dart"),
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* F#.
|
|
43
|
+
*/
|
|
44
|
+
FSHARP("fsharp"),
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Go.
|
|
48
|
+
*/
|
|
49
|
+
GO("go"),
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* HTTP.
|
|
53
|
+
*/
|
|
54
|
+
HTTP("http"),
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Java.
|
|
58
|
+
*/
|
|
59
|
+
JAVA("java"),
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* JavaScript.
|
|
63
|
+
*/
|
|
64
|
+
JAVASCRIPT("js"),
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Kotlin.
|
|
68
|
+
*/
|
|
69
|
+
KOTLIN("kotlin"),
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Node.js.
|
|
73
|
+
*/
|
|
74
|
+
NODE("node"),
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Objective-C.
|
|
78
|
+
*/
|
|
79
|
+
OBJC("objc"),
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* OCaml.
|
|
83
|
+
*/
|
|
84
|
+
OCAML("ocaml"),
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* PHP.
|
|
88
|
+
*/
|
|
89
|
+
PHP("php"),
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* PowerShell.
|
|
93
|
+
*/
|
|
94
|
+
POWERSHELL("powershell"),
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Python.
|
|
98
|
+
*/
|
|
99
|
+
PYTHON("python"),
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* R.
|
|
103
|
+
*/
|
|
104
|
+
R("r"),
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Ruby.
|
|
108
|
+
*/
|
|
109
|
+
RUBY("ruby"),
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Rust.
|
|
113
|
+
*/
|
|
114
|
+
RUST("rust"),
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Shell.
|
|
118
|
+
*/
|
|
119
|
+
SHELL("shell"),
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Swift.
|
|
123
|
+
*/
|
|
124
|
+
SWIFT("swift");
|
|
125
|
+
|
|
126
|
+
private final String value;
|
|
127
|
+
|
|
128
|
+
ScalarTarget(String value) {
|
|
129
|
+
this.value = value;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Creates a ScalarTarget from a string value.
|
|
134
|
+
*
|
|
135
|
+
* @param value the string value
|
|
136
|
+
* @return the corresponding ScalarTarget
|
|
137
|
+
* @throws IllegalArgumentException if the value is not recognized
|
|
138
|
+
*/
|
|
139
|
+
@JsonCreator
|
|
140
|
+
public static ScalarTarget fromValue(String value) {
|
|
141
|
+
for (ScalarTarget target : values()) {
|
|
142
|
+
if (target.value.equals(value)) {
|
|
143
|
+
return target;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
throw new IllegalArgumentException("Unknown target: " + value);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Gets the string value for JSON serialization.
|
|
151
|
+
*
|
|
152
|
+
* @return the string value
|
|
153
|
+
*/
|
|
154
|
+
@JsonValue
|
|
155
|
+
public String getValue() {
|
|
156
|
+
return value;
|
|
157
|
+
}
|
|
158
|
+
}
|