(workspaces())
REST APIs for managing Workspaces (speakeasy tenancy)
Creates a workspace
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.CreateWorkspaceResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import dev.speakeasyapi.javaclientsdk.models.shared.Workspace;
import java.lang.Exception;
import java.time.OffsetDateTime;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
Workspace req = Workspace.builder()
.createdAt(OffsetDateTime.parse("2023-06-18T07:14:55.338Z"))
.id("<id>")
.name("<value>")
.organizationId("<id>")
.slug("<value>")
.updatedAt(OffsetDateTime.parse("2023-12-01T17:06:07.804Z"))
.verified(true)
.build();
CreateWorkspaceResponse res = sdk.workspaces().create()
.request(req)
.call();
if (res.workspace().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
Workspace |
✔️ |
The request object to use for the request. |
CreateWorkspaceResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
4XX |
application/json |
models/errors/SDKError |
5XX |
*/* |
Create a token for a particular workspace
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.CreateWorkspaceTokenRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.CreateWorkspaceTokenResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import dev.speakeasyapi.javaclientsdk.models.shared.WorkspaceToken;
import java.lang.Exception;
import java.time.OffsetDateTime;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
CreateWorkspaceTokenRequest req = CreateWorkspaceTokenRequest.builder()
.workspaceToken(WorkspaceToken.builder()
.alg("<value>")
.createdAt(OffsetDateTime.parse("2022-08-16T02:33:00.784Z"))
.id("<id>")
.key("<key>")
.name("<value>")
.workspaceId("<id>")
.build())
.workspaceId("<id>")
.build();
CreateWorkspaceTokenResponse res = sdk.workspaces().createToken()
.request(req)
.call();
// handle response
}
}
CreateWorkspaceTokenResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
4XX |
application/json |
models/errors/SDKError |
5XX |
*/* |
Delete a token for a particular workspace
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.DeleteWorkspaceTokenRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.DeleteWorkspaceTokenResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
DeleteWorkspaceTokenRequest req = DeleteWorkspaceTokenRequest.builder()
.tokenID("<id>")
.workspaceId("<id>")
.build();
DeleteWorkspaceTokenResponse res = sdk.workspaces().deleteToken()
.request(req)
.call();
// handle response
}
}
DeleteWorkspaceTokenResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
4XX |
application/json |
models/errors/SDKError |
5XX |
*/* |
Get information about a particular workspace by context.
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.GetWorkspaceByContextResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
GetWorkspaceByContextResponse res = sdk.workspaces().get()
.call();
if (res.workspaceAndOrganization().isPresent()) {
// handle response
}
}
}
GetWorkspaceByContextResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
4XX |
application/json |
models/errors/SDKError |
5XX |
*/* |
Returns a list of workspaces a user has access too
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.GetWorkspacesResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
GetWorkspacesResponse res = sdk.workspaces().getAll()
.call();
if (res.workspaces().isPresent()) {
// handle response
}
}
}
GetWorkspacesResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
4XX |
application/json |
models/errors/SDKError |
5XX |
*/* |
Get information about a particular workspace.
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.GetWorkspaceRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetWorkspaceResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
GetWorkspaceRequest req = GetWorkspaceRequest.builder()
.workspaceId("<id>")
.build();
GetWorkspaceResponse res = sdk.workspaces().getByID()
.request(req)
.call();
if (res.workspace().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
GetWorkspaceRequest |
✔️ |
The request object to use for the request. |
GetWorkspaceResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
4XX |
application/json |
models/errors/SDKError |
5XX |
*/* |
Get workspace feature flags
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.GetWorkspaceFeatureFlagsRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetWorkspaceFeatureFlagsResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
GetWorkspaceFeatureFlagsRequest req = GetWorkspaceFeatureFlagsRequest.builder()
.workspaceId("<id>")
.build();
GetWorkspaceFeatureFlagsResponse res = sdk.workspaces().getFeatureFlags()
.request(req)
.call();
if (res.workspaceFeatureFlagResponse().isPresent()) {
// handle response
}
}
}
GetWorkspaceFeatureFlagsResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
5XX |
application/json |
models/errors/SDKError |
4XX |
*/* |
Get settings about a particular workspace.
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.GetWorkspaceSettingsRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetWorkspaceSettingsResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
GetWorkspaceSettingsRequest req = GetWorkspaceSettingsRequest.builder()
.workspaceId("<id>")
.build();
GetWorkspaceSettingsResponse res = sdk.workspaces().getSettings()
.request(req)
.call();
if (res.workspaceSettings().isPresent()) {
// handle response
}
}
}
GetWorkspaceSettingsResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
4XX |
application/json |
models/errors/SDKError |
5XX |
*/* |
Get team members for a particular workspace
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.GetWorkspaceTeamRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetWorkspaceTeamResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
GetWorkspaceTeamRequest req = GetWorkspaceTeamRequest.builder()
.workspaceId("<id>")
.build();
GetWorkspaceTeamResponse res = sdk.workspaces().getTeam()
.request(req)
.call();
if (res.workspaceTeamResponse().isPresent()) {
// handle response
}
}
}
GetWorkspaceTeamResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
4XX |
application/json |
models/errors/SDKError |
5XX |
*/* |
Get tokens for a particular workspace
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.GetWorkspaceTokensRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetWorkspaceTokensResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
GetWorkspaceTokensRequest req = GetWorkspaceTokensRequest.builder()
.workspaceId("<id>")
.build();
GetWorkspaceTokensResponse res = sdk.workspaces().getTokens()
.request(req)
.call();
if (res.classes().isPresent()) {
// handle response
}
}
}
GetWorkspaceTokensResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
4XX |
application/json |
models/errors/SDKError |
5XX |
*/* |
Grant a user access to a particular workspace
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.GrantUserAccessToWorkspaceRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.GrantUserAccessToWorkspaceResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
GrantUserAccessToWorkspaceRequest req = GrantUserAccessToWorkspaceRequest.builder()
.email("[email protected]")
.workspaceId("<id>")
.build();
GrantUserAccessToWorkspaceResponse res = sdk.workspaces().grantAccess()
.request(req)
.call();
if (res.workspaceInviteResponse().isPresent()) {
// handle response
}
}
}
GrantUserAccessToWorkspaceResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
4XX |
application/json |
models/errors/SDKError |
5XX |
*/* |
Revoke a user's access to a particular workspace
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.RevokeUserAccessToWorkspaceRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.RevokeUserAccessToWorkspaceResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
RevokeUserAccessToWorkspaceRequest req = RevokeUserAccessToWorkspaceRequest.builder()
.userId("<id>")
.workspaceId("<id>")
.build();
RevokeUserAccessToWorkspaceResponse res = sdk.workspaces().revokeAccess()
.request(req)
.call();
// handle response
}
}
RevokeUserAccessToWorkspaceResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
4XX |
application/json |
models/errors/SDKError |
5XX |
*/* |
Set workspace feature flags
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.SetWorkspaceFeatureFlagsResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import dev.speakeasyapi.javaclientsdk.models.shared.WorkspaceFeatureFlag;
import dev.speakeasyapi.javaclientsdk.models.shared.WorkspaceFeatureFlagRequest;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
WorkspaceFeatureFlagRequest req = WorkspaceFeatureFlagRequest.builder()
.featureFlags(List.of(
WorkspaceFeatureFlag.SKIP_SCHEMA_REGISTRY,
WorkspaceFeatureFlag.WEBHOOKS))
.build();
SetWorkspaceFeatureFlagsResponse res = sdk.workspaces().setFeatureFlags()
.request(req)
.call();
if (res.workspaceFeatureFlagResponse().isPresent()) {
// handle response
}
}
}
SetWorkspaceFeatureFlagsResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
5XX |
application/json |
models/errors/SDKError |
4XX |
*/* |
Update information about a particular workspace.
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.UpdateWorkspaceDetailsRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.UpdateWorkspaceDetailsResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import dev.speakeasyapi.javaclientsdk.models.shared.Workspace;
import java.lang.Exception;
import java.time.OffsetDateTime;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
UpdateWorkspaceDetailsRequest req = UpdateWorkspaceDetailsRequest.builder()
.workspace(Workspace.builder()
.createdAt(OffsetDateTime.parse("2024-07-28T19:04:48.565Z"))
.id("<id>")
.name("<value>")
.organizationId("<id>")
.slug("<value>")
.updatedAt(OffsetDateTime.parse("2023-10-17T10:52:42.015Z"))
.verified(true)
.build())
.workspaceId("<id>")
.build();
UpdateWorkspaceDetailsResponse res = sdk.workspaces().update()
.request(req)
.call();
// handle response
}
}
UpdateWorkspaceDetailsResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
4XX |
application/json |
models/errors/SDKError |
5XX |
*/* |
Update settings about a particular workspace.
package hello.world;
import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.errors.Error;
import dev.speakeasyapi.javaclientsdk.models.operations.UpdateWorkspaceSettingsRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.UpdateWorkspaceSettingsResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import dev.speakeasyapi.javaclientsdk.models.shared.WorkspaceSettings;
import java.lang.Exception;
import java.time.OffsetDateTime;
public class Application {
public static void main(String[] args) throws Error, Exception {
RyanTest sdk = RyanTest.builder()
.security(Security.builder()
.apiKey("<YOUR_API_KEY_HERE>")
.build())
.build();
UpdateWorkspaceSettingsRequest req = UpdateWorkspaceSettingsRequest.builder()
.workspaceSettings(WorkspaceSettings.builder()
.createdAt(OffsetDateTime.parse("2022-07-05T11:43:28.305Z"))
.updatedAt(OffsetDateTime.parse("2023-05-15T05:39:21.874Z"))
.webhookUrl("https://grown-pharmacopoeia.net")
.workspaceId("<id>")
.build())
.workspaceId("<id>")
.build();
UpdateWorkspaceSettingsResponse res = sdk.workspaces().updateSettings()
.request(req)
.call();
// handle response
}
}
UpdateWorkspaceSettingsResponse
Error Type |
Status Code |
Content Type |
models/errors/Error |
4XX |
application/json |
models/errors/SDKError |
5XX |
*/* |