Skip to content

Latest commit

 

History

History
565 lines (406 loc) · 22.6 KB

File metadata and controls

565 lines (406 loc) · 22.6 KB

OrganizationsV1

(organizationsV1())

Overview

Available Operations

acceptInvite

AcceptInvite

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.AcceptInviteResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        AcceptInviteResponse res = sdk.organizationsV1().acceptInvite()
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description Example
orgId String ✔️ N/A org-6f706e83-0ec1-437a-9a46-7d4281eb2f39

Response

AcceptInviteResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 429 application/json
models/errors/SDKError 4XX, 5XX */*

getOrgMembers

GetOrgMembers

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetOrgMembersResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        GetOrgMembersResponse res = sdk.organizationsV1().getOrgMembers()
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
                .call();

        if (res.orgMembersPage().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
orgId String ✔️ N/A org-6f706e83-0ec1-437a-9a46-7d4281eb2f39

Response

GetOrgMembersResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 429 application/json
models/errors/SDKError 4XX, 5XX */*

getOrgPendingInvites

GetOrgPendingInvites

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetOrgPendingInvitesResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        GetOrgPendingInvitesResponse res = sdk.organizationsV1().getOrgPendingInvites()
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
                .call();

        if (res.pendingOrgInvitesPage().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
orgId String ✔️ N/A org-6f706e83-0ec1-437a-9a46-7d4281eb2f39

Response

GetOrgPendingInvitesResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 429 application/json
models/errors/SDKError 4XX, 5XX */*

getOrgs

Returns an unsorted list of all organizations that you are a member of (an accepted membership invite). An organization is uniquely identified by an orgId.

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetOrgsResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        GetOrgsResponse res = sdk.organizationsV1().getOrgs()
                .call();

        if (res.orgsPage().isPresent()) {
            // handle response
        }
    }
}

Response

GetOrgsResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 429 application/json
models/errors/SDKError 4XX, 5XX */*

getUsageLimits

GetUsageLimits

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetUsageLimitsResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        GetUsageLimitsResponse res = sdk.organizationsV1().getUsageLimits()
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
                .call();

        if (res.usageLimits().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
orgId Optional<String> N/A org-6f706e83-0ec1-437a-9a46-7d4281eb2f39

Response

GetUsageLimitsResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 429, 500 application/json
models/errors/SDKError 4XX, 5XX */*

getUserPendingInvites

GetUserPendingInvites

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetUserPendingInvitesResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        GetUserPendingInvitesResponse res = sdk.organizationsV1().getUserPendingInvites()
                .call();

        if (res.pendingOrgInvitesPage().isPresent()) {
            // handle response
        }
    }
}

Response

GetUserPendingInvitesResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 429 application/json
models/errors/SDKError 4XX, 5XX */*

inviteUser

InviteUser

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.InviteUserResponse;
import dev.hathora.cloud_sdk.models.shared.CreateUserInvite;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        InviteUserResponse res = sdk.organizationsV1().inviteUser()
                .createUserInvite(CreateUserInvite.builder()
                    .userEmail("[email protected]")
                    .build())
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
                .call();

        if (res.pendingOrgInvite().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
createUserInvite CreateUserInvite ✔️ N/A
orgId String ✔️ N/A org-6f706e83-0ec1-437a-9a46-7d4281eb2f39

Response

InviteUserResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 422, 429 application/json
models/errors/SDKError 4XX, 5XX */*

rejectInvite

RejectInvite

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.RejectInviteResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        RejectInviteResponse res = sdk.organizationsV1().rejectInvite()
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description Example
orgId String ✔️ N/A org-6f706e83-0ec1-437a-9a46-7d4281eb2f39

Response

RejectInviteResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 429 application/json
models/errors/SDKError 4XX, 5XX */*

rescindInvite

RescindInvite

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.RescindInviteResponse;
import dev.hathora.cloud_sdk.models.shared.RescindUserInvite;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        RescindInviteResponse res = sdk.organizationsV1().rescindInvite()
                .rescindUserInvite(RescindUserInvite.builder()
                    .userEmail("[email protected]")
                    .build())
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description Example
rescindUserInvite RescindUserInvite ✔️ N/A
orgId String ✔️ N/A org-6f706e83-0ec1-437a-9a46-7d4281eb2f39

Response

RescindInviteResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 422, 429, 500 application/json
models/errors/SDKError 4XX, 5XX */*

updateUserInvite

UpdateUserInvite

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.UpdateUserInviteResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import dev.hathora.cloud_sdk.models.shared.UpdateUserInvite;
import dev.hathora.cloud_sdk.models.shared.UpdateUserInviteScopes;
import dev.hathora.cloud_sdk.models.shared.UserRole;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws ApiError, Exception {

        HathoraCloud sdk = HathoraCloud.builder()
                .security(Security.builder()
                    .hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
                    .build())
                .appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
            .build();

        UpdateUserInviteResponse res = sdk.organizationsV1().updateUserInvite()
                .updateUserInvite(UpdateUserInvite.builder()
                    .scopes(UpdateUserInviteScopes.of(UserRole.VIEWER))
                    .userEmail("[email protected]")
                    .build())
                .orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
                .call();

        if (res.boolean_().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
updateUserInvite UpdateUserInvite ✔️ N/A
orgId String ✔️ N/A org-6f706e83-0ec1-437a-9a46-7d4281eb2f39

Response

UpdateUserInviteResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 422, 429 application/json
models/errors/SDKError 4XX, 5XX */*