Skip to content

Latest commit

 

History

History
551 lines (408 loc) · 26.8 KB

README.md

File metadata and controls

551 lines (408 loc) · 26.8 KB

OrganizationsV1

(OrganizationsV1)

Overview

Available Operations

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 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
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
opts []operations.Option The options for this request.

Response

*components.OrgsPage, error

Errors

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

GetUserPendingInvites

GetUserPendingInvites

Example Usage

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
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
opts []operations.Option The options for this request.

Response

*components.PendingOrgInvitesPage, error

Errors

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

GetOrgMembers

GetOrgMembers

Example Usage

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
    }
}

Parameters

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.

Response

*components.OrgMembersPage, error

Errors

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

InviteUser

InviteUser

Example Usage

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
    }
}

Parameters

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.

Response

*components.PendingOrgInvite, error

Errors

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

UpdateUserInvite

UpdateUserInvite

Example Usage

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
    }
}

Parameters

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.

Response

*bool, error

Errors

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

RescindInvite

RescindInvite

Example Usage

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)
    }
}

Parameters

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.

Response

error

Errors

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

GetOrgPendingInvites

GetOrgPendingInvites

Example Usage

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
    }
}

Parameters

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.

Response

*components.PendingOrgInvitesPage, error

Errors

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

AcceptInvite

AcceptInvite

Example Usage

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)
    }
}

Parameters

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.

Response

error

Errors

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

RejectInvite

RejectInvite

Example Usage

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)
    }
}

Parameters

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.

Response

error

Errors

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

GetUsageLimits

GetUsageLimits

Example Usage

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
    }
}

Parameters

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.

Response

*components.UsageLimits, error

Errors

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