(OrganizationsV1)
- GetOrgs - GetOrgs
- GetUserPendingInvites - GetUserPendingInvites
- GetOrgMembers - GetOrgMembers
- InviteUser - InviteUser
- UpdateUserInvite - UpdateUserInvite
- RescindInvite - RescindInvite
- GetOrgPendingInvites - GetOrgPendingInvites
- AcceptInvite - AcceptInvite
- RejectInvite - RejectInvite
- GetUsageLimits - GetUsageLimits
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
.
package main
import(
"context"
hathoracloud "github.com/hathora/cloud-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := hathoracloud.New(
hathoracloud.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
hathoracloud.WithOrgID("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"),
hathoracloud.WithAppID("app-af469a92-5b45-4565-b3c4-b79878de67d2"),
)
res, err := s.OrganizationsV1.GetOrgs(ctx)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*components.OrgsPage, error
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 401, 404, 429 | application/json |
errors.SDKError | 4XX, 5XX | */* |
GetUserPendingInvites
package main
import(
"context"
hathoracloud "github.com/hathora/cloud-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := hathoracloud.New(
hathoracloud.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
hathoracloud.WithOrgID("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"),
hathoracloud.WithAppID("app-af469a92-5b45-4565-b3c4-b79878de67d2"),
)
res, err := s.OrganizationsV1.GetUserPendingInvites(ctx)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*components.PendingOrgInvitesPage, error
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 401, 429 | application/json |
errors.SDKError | 4XX, 5XX | */* |
GetOrgMembers
package main
import(
"context"
hathoracloud "github.com/hathora/cloud-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := hathoracloud.New(
hathoracloud.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
hathoracloud.WithOrgID("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"),
hathoracloud.WithAppID("app-af469a92-5b45-4565-b3c4-b79878de67d2"),
)
res, err := s.OrganizationsV1.GetOrgMembers(ctx, "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
orgID |
string | ✔️ | N/A | org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
opts |
[]operations.Option | ➖ | The options for this request. |
*components.OrgMembersPage, error
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 401, 429 | application/json |
errors.SDKError | 4XX, 5XX | */* |
InviteUser
package main
import(
"context"
hathoracloud "github.com/hathora/cloud-sdk-go"
"github.com/hathora/cloud-sdk-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := hathoracloud.New(
hathoracloud.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
hathoracloud.WithOrgID("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"),
hathoracloud.WithAppID("app-af469a92-5b45-4565-b3c4-b79878de67d2"),
)
res, err := s.OrganizationsV1.InviteUser(ctx, "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39", components.CreateUserInvite{
UserEmail: "[email protected]",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
orgID |
string | ✔️ | N/A | org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
createUserInvite |
components.CreateUserInvite | ✔️ | N/A | |
opts |
[]operations.Option | ➖ | The options for this request. |
*components.PendingOrgInvite, error
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 401, 422, 429 | application/json |
errors.SDKError | 4XX, 5XX | */* |
UpdateUserInvite
package main
import(
"context"
hathoracloud "github.com/hathora/cloud-sdk-go"
"github.com/hathora/cloud-sdk-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := hathoracloud.New(
hathoracloud.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
hathoracloud.WithOrgID("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"),
hathoracloud.WithAppID("app-af469a92-5b45-4565-b3c4-b79878de67d2"),
)
res, err := s.OrganizationsV1.UpdateUserInvite(ctx, "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39", components.UpdateUserInvite{
Scopes: components.CreateUpdateUserInviteScopesUserRole(
components.UserRoleViewer,
),
UserEmail: "[email protected]",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
orgID |
string | ✔️ | N/A | org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
updateUserInvite |
components.UpdateUserInvite | ✔️ | N/A | |
opts |
[]operations.Option | ➖ | The options for this request. |
*bool, error
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 401, 422, 429 | application/json |
errors.SDKError | 4XX, 5XX | */* |
RescindInvite
package main
import(
"context"
hathoracloud "github.com/hathora/cloud-sdk-go"
"github.com/hathora/cloud-sdk-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := hathoracloud.New(
hathoracloud.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
hathoracloud.WithOrgID("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"),
hathoracloud.WithAppID("app-af469a92-5b45-4565-b3c4-b79878de67d2"),
)
err := s.OrganizationsV1.RescindInvite(ctx, "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39", components.RescindUserInvite{
UserEmail: "[email protected]",
})
if err != nil {
log.Fatal(err)
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
orgID |
string | ✔️ | N/A | org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
rescindUserInvite |
components.RescindUserInvite | ✔️ | N/A | |
opts |
[]operations.Option | ➖ | The options for this request. |
error
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 401, 404, 422, 429, 500 | application/json |
errors.SDKError | 4XX, 5XX | */* |
GetOrgPendingInvites
package main
import(
"context"
hathoracloud "github.com/hathora/cloud-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := hathoracloud.New(
hathoracloud.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
hathoracloud.WithOrgID("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"),
hathoracloud.WithAppID("app-af469a92-5b45-4565-b3c4-b79878de67d2"),
)
res, err := s.OrganizationsV1.GetOrgPendingInvites(ctx, "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
orgID |
string | ✔️ | N/A | org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
opts |
[]operations.Option | ➖ | The options for this request. |
*components.PendingOrgInvitesPage, error
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 401, 429 | application/json |
errors.SDKError | 4XX, 5XX | */* |
AcceptInvite
package main
import(
"context"
hathoracloud "github.com/hathora/cloud-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := hathoracloud.New(
hathoracloud.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
hathoracloud.WithOrgID("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"),
hathoracloud.WithAppID("app-af469a92-5b45-4565-b3c4-b79878de67d2"),
)
err := s.OrganizationsV1.AcceptInvite(ctx, "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
if err != nil {
log.Fatal(err)
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
orgID |
string | ✔️ | N/A | org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
opts |
[]operations.Option | ➖ | The options for this request. |
error
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 401, 404, 429 | application/json |
errors.SDKError | 4XX, 5XX | */* |
RejectInvite
package main
import(
"context"
hathoracloud "github.com/hathora/cloud-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := hathoracloud.New(
hathoracloud.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
hathoracloud.WithOrgID("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"),
hathoracloud.WithAppID("app-af469a92-5b45-4565-b3c4-b79878de67d2"),
)
err := s.OrganizationsV1.RejectInvite(ctx, "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
if err != nil {
log.Fatal(err)
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
orgID |
string | ✔️ | N/A | org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
opts |
[]operations.Option | ➖ | The options for this request. |
error
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 401, 404, 429 | application/json |
errors.SDKError | 4XX, 5XX | */* |
GetUsageLimits
package main
import(
"context"
hathoracloud "github.com/hathora/cloud-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := hathoracloud.New(
hathoracloud.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
hathoracloud.WithOrgID("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"),
hathoracloud.WithAppID("app-af469a92-5b45-4565-b3c4-b79878de67d2"),
)
res, err := s.OrganizationsV1.GetUsageLimits(ctx, hathoracloud.String("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"))
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
orgID |
*string | ➖ | N/A | org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
opts |
[]operations.Option | ➖ | The options for this request. |
*components.UsageLimits, error
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 401, 404, 429, 500 | application/json |
errors.SDKError | 4XX, 5XX | */* |