(schemas())
REST APIs for managing Schema entities
Delete a particular schema revision for an Api.
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.operations.DeleteSchemaRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.DeleteSchemaResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
DeleteSchemaRequest req = DeleteSchemaRequest.builder()
.apiID("<id>")
.revisionID("<id>")
.versionID("<id>")
.build();
DeleteSchemaResponse res = sdk.schemas().deleteSchema()
.request(req)
.call();
// handle response
}
}
Parameter |
Type |
Required |
Description |
request |
DeleteSchemaRequest |
✔️ |
The request object to use for the request. |
DeleteSchemaResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Download the latest schema for a particular apiID.
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.operations.DownloadSchemaRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.DownloadSchemaResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
DownloadSchemaRequest req = DownloadSchemaRequest.builder()
.apiID("<id>")
.versionID("<id>")
.build();
DownloadSchemaResponse res = sdk.schemas().downloadSchema()
.request(req)
.call();
if (res.twoHundredApplicationJsonSchema().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
DownloadSchemaRequest |
✔️ |
The request object to use for the request. |
DownloadSchemaResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Download a particular schema revision for an Api.
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.operations.DownloadSchemaRevisionRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.DownloadSchemaRevisionResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
DownloadSchemaRevisionRequest req = DownloadSchemaRevisionRequest.builder()
.apiID("<id>")
.revisionID("<id>")
.versionID("<id>")
.build();
DownloadSchemaRevisionResponse res = sdk.schemas().downloadSchemaRevision()
.request(req)
.call();
if (res.twoHundredApplicationJsonSchema().isPresent()) {
// handle response
}
}
}
DownloadSchemaRevisionResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Returns information about the last uploaded schema for a particular API version.
This won't include the schema itself, that can be retrieved via the downloadSchema operation.
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetSchemaRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetSchemaResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
GetSchemaRequest req = GetSchemaRequest.builder()
.apiID("<id>")
.versionID("<id>")
.build();
GetSchemaResponse res = sdk.schemas().getSchema()
.request(req)
.call();
if (res.schema().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
GetSchemaRequest |
✔️ |
The request object to use for the request. |
GetSchemaResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Get a diff of two schema revisions for an Api.
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetSchemaDiffRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetSchemaDiffResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
GetSchemaDiffRequest req = GetSchemaDiffRequest.builder()
.apiID("<id>")
.baseRevisionID("<id>")
.targetRevisionID("<id>")
.versionID("<id>")
.build();
GetSchemaDiffResponse res = sdk.schemas().getSchemaDiff()
.request(req)
.call();
if (res.schemaDiff().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
GetSchemaDiffRequest |
✔️ |
The request object to use for the request. |
GetSchemaDiffResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Returns information about the last uploaded schema for a particular schema revision.
This won't include the schema itself, that can be retrieved via the downloadSchema operation.
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetSchemaRevisionRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetSchemaRevisionResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
GetSchemaRevisionRequest req = GetSchemaRevisionRequest.builder()
.apiID("<id>")
.revisionID("<id>")
.versionID("<id>")
.build();
GetSchemaRevisionResponse res = sdk.schemas().getSchemaRevision()
.request(req)
.call();
if (res.schema().isPresent()) {
// handle response
}
}
}
GetSchemaRevisionResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Returns information the schemas associated with a particular apiID.
This won't include the schemas themselves, they can be retrieved via the downloadSchema operation.
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetSchemasRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetSchemasResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
GetSchemasRequest req = GetSchemasRequest.builder()
.apiID("<id>")
.versionID("<id>")
.build();
GetSchemasResponse res = sdk.schemas().getSchemas()
.request(req)
.call();
if (res.classes().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
GetSchemasRequest |
✔️ |
The request object to use for the request. |
GetSchemasResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |
Allows uploading a schema for a particular API version.
This will be used to populate ApiEndpoints and used as a base for any schema generation if present.
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.operations.File;
import dev.speakeasyapi.javaclientsdk.models.operations.RegisterSchemaRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.RegisterSchemaRequestBody;
import dev.speakeasyapi.javaclientsdk.models.operations.RegisterSchemaResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
import java.nio.charset.StandardCharsets;
public class Application {
public static void main(String[] args) throws Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
RegisterSchemaRequest req = RegisterSchemaRequest.builder()
.requestBody(RegisterSchemaRequestBody.builder()
.file(File.builder()
.content("0xCFA30D144c".getBytes(StandardCharsets.UTF_8))
.fileName("example.file")
.build())
.build())
.apiID("<id>")
.versionID("<id>")
.build();
RegisterSchemaResponse res = sdk.schemas().registerSchema()
.request(req)
.call();
// handle response
}
}
Parameter |
Type |
Required |
Description |
request |
RegisterSchemaRequest |
✔️ |
The request object to use for the request. |
RegisterSchemaResponse
Error Type |
Status Code |
Content Type |
models/errors/SDKError |
4XX, 5XX |
*/* |