(apis() )
REST APIs for managing Api entities
Delete a particular version of an Api. The will also delete all associated ApiEndpoints, Metadata, Schemas & Request Logs (if using a Postgres datastore).
package hello .world ;
import dev .speakeasyapi .javaclientsdk .RyanTest ;
import dev .speakeasyapi .javaclientsdk .models .operations .DeleteApiRequest ;
import dev .speakeasyapi .javaclientsdk .models .operations .DeleteApiResponse ;
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 ();
DeleteApiRequest req = DeleteApiRequest .builder ()
.apiID ("<id>" )
.versionID ("<id>" )
.build ();
DeleteApiResponse res = sdk .apis ().deleteApi ()
.request (req )
.call ();
// handle response
}
}
Parameter
Type
Required
Description
request
DeleteApiRequest
✔️
The request object to use for the request.
DeleteApiResponse
Error Type
Status Code
Content Type
models/errors/SDKError
4XX, 5XX
*/*
This endpoint will generate any missing operations in any registered OpenAPI document if the operation does not already exist in the document.
Returns the original document and the newly generated document allowing a diff to be performed to see what has changed.
package hello .world ;
import dev .speakeasyapi .javaclientsdk .RyanTest ;
import dev .speakeasyapi .javaclientsdk .models .operations .GenerateOpenApiSpecRequest ;
import dev .speakeasyapi .javaclientsdk .models .operations .GenerateOpenApiSpecResponse ;
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 ();
GenerateOpenApiSpecRequest req = GenerateOpenApiSpecRequest .builder ()
.apiID ("<id>" )
.versionID ("<id>" )
.build ();
GenerateOpenApiSpecResponse res = sdk .apis ().generateOpenApiSpec ()
.request (req )
.call ();
if (res .generateOpenApiSpecDiff ().isPresent ()) {
// handle response
}
}
}
GenerateOpenApiSpecResponse
Error Type
Status Code
Content Type
models/errors/SDKError
4XX, 5XX
*/*
generatePostmanCollection
Generates a postman collection containing all endpoints for a particular API. Includes variables produced for any path/query/header parameters included in the OpenAPI document.
package hello .world ;
import dev .speakeasyapi .javaclientsdk .RyanTest ;
import dev .speakeasyapi .javaclientsdk .models .operations .GeneratePostmanCollectionRequest ;
import dev .speakeasyapi .javaclientsdk .models .operations .GeneratePostmanCollectionResponse ;
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 ();
GeneratePostmanCollectionRequest req = GeneratePostmanCollectionRequest .builder ()
.apiID ("<id>" )
.versionID ("<id>" )
.build ();
GeneratePostmanCollectionResponse res = sdk .apis ().generatePostmanCollection ()
.request (req )
.call ();
if (res .postmanCollection ().isPresent ()) {
// handle response
}
}
}
GeneratePostmanCollectionResponse
Error Type
Status Code
Content Type
models/errors/SDKError
4XX, 5XX
*/*
Get all Api versions for a particular ApiEndpoint.
Supports filtering the versions based on metadata attributes.
package hello .world ;
import dev .speakeasyapi .javaclientsdk .RyanTest ;
import dev .speakeasyapi .javaclientsdk .models .operations .GetAllApiVersionsRequest ;
import dev .speakeasyapi .javaclientsdk .models .operations .GetAllApiVersionsResponse ;
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 ();
GetAllApiVersionsRequest req = GetAllApiVersionsRequest .builder ()
.apiID ("<id>" )
.build ();
GetAllApiVersionsResponse res = sdk .apis ().getAllApiVersions ()
.request (req )
.call ();
if (res .apis ().isPresent ()) {
// handle response
}
}
}
GetAllApiVersionsResponse
Error Type
Status Code
Content Type
models/errors/SDKError
4XX, 5XX
*/*
Get a list of all Apis and their versions for a given workspace.
Supports filtering the APIs based on metadata attributes. Abc
package hello .world ;
import dev .speakeasyapi .javaclientsdk .RyanTest ;
import dev .speakeasyapi .javaclientsdk .models .operations .GetApisRequest ;
import dev .speakeasyapi .javaclientsdk .models .operations .GetApisResponse ;
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 ();
GetApisRequest req = GetApisRequest .builder ()
.build ();
GetApisResponse res = sdk .apis ().getApis ()
.request (req )
.call ();
if (res .apis ().isPresent ()) {
// handle response
}
}
}
Parameter
Type
Required
Description
request
GetApisRequest
✔️
The request object to use for the request.
GetApisResponse
Error Type
Status Code
Content Type
models/errors/SDKError
4XX, 5XX
*/*
Upsert an Api. If the Api does not exist, it will be created.
If the Api exists, it will be updated.
package hello .world ;
import dev .speakeasyapi .javaclientsdk .RyanTest ;
import dev .speakeasyapi .javaclientsdk .models .operations .UpsertApiRequest ;
import dev .speakeasyapi .javaclientsdk .models .operations .UpsertApiResponse ;
import dev .speakeasyapi .javaclientsdk .models .shared .ApiInput ;
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 ();
UpsertApiRequest req = UpsertApiRequest .builder ()
.api (ApiInput .builder ()
.apiId ("<id>" )
.description ("consequently brr happily yowza however gosh investigate joyfully direct" )
.versionId ("<id>" )
.build ())
.apiID ("<id>" )
.build ();
UpsertApiResponse res = sdk .apis ().upsertApi ()
.request (req )
.call ();
if (res .api ().isPresent ()) {
// handle response
}
}
}
Parameter
Type
Required
Description
request
UpsertApiRequest
✔️
The request object to use for the request.
UpsertApiResponse
Error Type
Status Code
Content Type
models/errors/SDKError
4XX, 5XX
*/*