API Reference of GS2-Account SDK

Model

Namespace

Namespace

Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.

Therefore, it is necessary to create a namespace before starting to use each service.

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsNamespace GRN
namestring~ 32 charsNamespace name
descriptionstring~ 1024 charsDescription
changePasswordIfTakeOverboolfalseWhether to change the password when taking over the account
differentUserIdForLoginAndDataRetentionboolfalseWhether to use different user IDs for login and data retention
createAccountScriptScriptSettingScript to run when creating an account
authenticationScriptScriptSettingScript to run when authenticated
createTakeOverScriptScriptSettingScript to run when creating a takeover
doTakeOverScriptScriptSettingScript to run when taking over
logSettingLogSettingLog output settings
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision

Account

Game Player Account

An entity of identity information that identifies a game player. Game player accounts are anonymous accounts and consist of a user ID (UUID) and password (a random 32-character string), so game players do not need to enter their email address or other information.

The issued game player account is stored in the device’s local storage and is used for future logins.

TypeConditionRequireDefaultLimitationDescription
accountIdstring~ 1024 charsGame Player Account GRN
userIdstringUUID~ 128 charsUser Id
passwordstring~ 128 charsPassword
timeOffsetint0~ 315360000Time offset from current time(in seconds)
banStatusesList<BanStatus>~ 10 itemsList of account BAN information
bannedboolfalseWhether the account is currently BAN
lastAuthenticatedAtlongLast authenticated time
createdAtlongDatetime of creation
revisionlong0~ 9223372036854775805Revision

TakeOver

Takeover Setting

Takeover Setting is information used when changing device models or moving/sharing accounts between platforms. It consists of a unique string of characters that identifies an individual and a password, the appropriate combination of which can be entered to obtain an Account (anonymous account).

Multiple takeover setting can be set up for one Account. To set up multiple handover information, you must specify different slots for each. The number of slots can be from 0 to 1024, which means that a maximum of 1025 different takeover setting can be set.

For example, 0 can be used to store Twitter account information, 1 to store Sign-in Apple account information, and 2 to store Google account information. The following usage is assumed. This takeover setting is only a data holder, and the authentication mechanism with social accounts needs to be prepared separately.

TypeConditionRequireDefaultLimitationDescription
takeOverIdstring~ 1024 charsTakeover setting GRN
userIdstring~ 128 charsUser Id
typeint~ 1024Slot Number
userIdentifierstring~ 1024 charsUser ID for takeover
passwordstring~ 128 charsPassword
createdAtlongDatetime of creation
revisionlong0~ 9223372036854775805Revision

DataOwner

The data owner is used when User ID used for login and user ID used for data retention should be different is specified in the namespace settings. The user ID that can be obtained when a Data Owner ID that is different from the user ID is issued and an access token is received through the GS2-Account authentication process is the Data Owner ID.

TypeConditionRequireDefaultLimitationDescription
dataOwnerIdstring~ 1024 charsData Owner setting GRN
userIdstring~ 128 charsUser Id
namestringUUID~ 36 charsData owner name
createdAtlongDatetime of creation
revisionlong0~ 9223372036854775805Revision

BanStatus

Account BAN information

Represents information about the BAN (access restriction) status applied to a game player account. This type includes detailed information such as the reason for the BAN, the name of the BAN, and the scheduled date and time for the BAN to be lifted. BAN status can be applied to an account for various reasons, such as cheating or violation of the terms of service, and this type helps to manage that status. The system uses this information to control the account’s access permissions and to restrict or release access as necessary.

TypeConditionRequireDefaultLimitationDescription
namestringUUID~ 36 charsBAN status name
reasonstring~ 256 charsReason for BAN
releaseTimestamplongDate and time when the BAN will be released

ScriptSetting

Script settings

In GS2, you can associate custom scripts with microservice events and execute them. This model holds the settings for triggering script execution.

There are two main ways to execute a script: synchronous execution and asynchronous execution. Synchronous execution blocks processing until the script has finished executing. Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API.

On the other hand, asynchronous execution does not block processing until the script has finished executing. Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API. However, asynchronous execution does not block processing until the script has finished executing, so it is generally recommended to use asynchronous execution.

There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge. By using Amazon EventBridge, you can write processing in languages other than Lua.

TypeConditionRequireDefaultLimitationDescription
triggerScriptIdstring~ 1024 charsScript GRN of synchronous execution script
doneTriggerTargetTypeenum [
“none”,
“gs2_script”,
“aws”
]
“none”~ 128 charsHow to execute asynchronous scripts
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsScript GRN of asynchronous execution script
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsGS2-JobQueue namespace to execute asynchronous execution scripts

LogSetting

Log setting

This type manages log output settings. This type holds the identifier of the log namespace used to output log data. The log namespace ID specifies the GS2-Log namespace to aggregate and store the log data. Through this setting, API request and response log data under this namespace will be output to the target GS2-Log. GS2-Log provides logs in real time, which can be used for system monitoring, analysis, debugging, etc.

TypeConditionRequireDefaultLimitationDescription
loggingNamespaceIdstring~ 1024 charsNamespace GRN

Methods

describeNamespaces

Get list of namespaces

Get a list of all namespaces in the project. You can use the optional page token to start acquiring data from a specific location in the list. You can also limit the number of namespaces to be acquired.

Request

TypeConditionRequireDefaultLimitationDescription
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<Namespace>List of Namespace
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &account.DescribeNamespacesRequest {
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeNamespacesRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeNamespaces(
        (new DescribeNamespacesRequest())
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeNamespacesRequest;
import io.gs2.account.result.DescribeNamespacesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    DescribeNamespacesResult result = client.describeNamespaces(
        new DescribeNamespacesRequest()
            .withPageToken(null)
            .withLimit(null)
    );
    List<Namespace> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.DescribeNamespacesRequest;
using Gs2.Gs2Account.Result.DescribeNamespacesResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Account.Request.DescribeNamespacesRequest()
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.describeNamespaces(
        new Gs2Account.DescribeNamespacesRequest()
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.describe_namespaces(
        account.DescribeNamespacesRequest()
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.describe_namespaces({
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createNamespace

Create new namespace

You must specify detailed information including the name, description, and various settings of the namespace.

Request

TypeConditionRequireDefaultLimitationDescription
namestring~ 32 charsNamespace name
descriptionstring~ 1024 charsDescription
changePasswordIfTakeOverboolfalseWhether to change the password when taking over the account
differentUserIdForLoginAndDataRetentionboolfalseWhether to use different user IDs for login and data retention
createAccountScriptScriptSettingScript to run when creating an account
authenticationScriptScriptSettingScript to run when authenticated
createTakeOverScriptScriptSettingScript to run when creating a takeover
doTakeOverScriptScriptSettingScript to run when taking over
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceNamespace created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &account.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        ChangePasswordIfTakeOver: pointy.Bool(false),
        DifferentUserIdForLoginAndDataRetention: nil,
        CreateAccountScript: nil,
        AuthenticationScript: nil,
        CreateTakeOverScript: nil,
        DoTakeOverScript: nil,
        LogSetting: &account.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName(self::namespace1)
            ->withDescription(null)
            ->withChangePasswordIfTakeOver(False)
            ->withDifferentUserIdForLoginAndDataRetention(null)
            ->withCreateAccountScript(null)
            ->withAuthenticationScript(null)
            ->withCreateTakeOverScript(null)
            ->withDoTakeOverScript(null)
            ->withLogSetting((new \Gs2\Account\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateNamespaceRequest;
import io.gs2.account.result.CreateNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withChangePasswordIfTakeOver(false)
            .withDifferentUserIdForLoginAndDataRetention(null)
            .withCreateAccountScript(null)
            .withAuthenticationScript(null)
            .withCreateTakeOverScript(null)
            .withDoTakeOverScript(null)
            .withLogSetting(new io.gs2.account.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.CreateNamespaceRequest;
using Gs2.Gs2Account.Result.CreateNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Account.Request.CreateNamespaceRequest()
        .WithName("namespace1")
        .WithDescription(null)
        .WithChangePasswordIfTakeOver(false)
        .WithDifferentUserIdForLoginAndDataRetention(null)
        .WithCreateAccountScript(null)
        .WithAuthenticationScript(null)
        .WithCreateTakeOverScript(null)
        .WithDoTakeOverScript(null)
        .WithLogSetting(new Gs2.Gs2Account.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.createNamespace(
        new Gs2Account.CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withChangePasswordIfTakeOver(false)
            .withDifferentUserIdForLoginAndDataRetention(null)
            .withCreateAccountScript(null)
            .withAuthenticationScript(null)
            .withCreateTakeOverScript(null)
            .withDoTakeOverScript(null)
            .withLogSetting(new Gs2Account.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.create_namespace(
        account.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_change_password_if_take_over(False)
            .with_different_user_id_for_login_and_data_retention(None)
            .with_create_account_script(None)
            .with_authentication_script(None)
            .with_create_take_over_script(None)
            .with_do_take_over_script(None)
            .with_log_setting(
                account.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.create_namespace({
    name="namespace1",
    description=nil,
    changePasswordIfTakeOver=false,
    differentUserIdForLoginAndDataRetention=nil,
    createAccountScript=nil,
    authenticationScript=nil,
    createTakeOverScript=nil,
    doTakeOverScript=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getNamespaceStatus

Get namespace status

Get the current status of the specified namespace. This includes whether the namespace is active, pending, or in some other state.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
statusstring

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &account.GetNamespaceStatusRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetNamespaceStatusRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName(self::namespace1)
    );
    $status = $result->getStatus();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetNamespaceStatusRequest;
import io.gs2.account.result.GetNamespaceStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    GetNamespaceStatusResult result = client.getNamespaceStatus(
        new GetNamespaceStatusRequest()
            .withNamespaceName("namespace1")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Account.Result.GetNamespaceStatusResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Account.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.getNamespaceStatus(
        new Gs2Account.GetNamespaceStatusRequest()
            .withNamespaceName("namespace1")
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.get_namespace_status(
        account.GetNamespaceStatusRequest()
            .with_namespace_name(self.hash1)
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.get_namespace_status({
    namespaceName="namespace1",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
status = result.status;

getNamespace

Get namespace

Get detailed information about the specified namespace. This includes the name, description, and other settings of the namespace.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemNamespaceNamespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &account.GetNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetNamespaceRequest;
import io.gs2.account.result.GetNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    GetNamespaceResult result = client.getNamespace(
        new GetNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.GetNamespaceRequest;
using Gs2.Gs2Account.Result.GetNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Account.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.getNamespace(
        new Gs2Account.GetNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.get_namespace(
        account.GetNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.get_namespace({
    namespaceName="namespace1",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

updateNamespace

Update namespace

Update the settings of the specified namespace. You can change the description of the namespace and specific settings.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
descriptionstring~ 1024 charsDescription
changePasswordIfTakeOverboolfalseWhether to change the password when taking over the account
createAccountScriptScriptSettingScript to run when creating an account
authenticationScriptScriptSettingScript to run when authenticated
createTakeOverScriptScriptSettingScript to run when creating a takeover
doTakeOverScriptScriptSettingScript to run when taking over
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceUpdated namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &account.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        ChangePasswordIfTakeOver: pointy.Bool(true),
        CreateAccountScript: &account.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1001"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002"),
        },
        AuthenticationScript: &account.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004"),
        },
        CreateTakeOverScript: &account.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1005"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1006"),
        },
        DoTakeOverScript: &account.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1007"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1008"),
        },
        LogSetting: &account.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName(self::namespace1)
            ->withDescription("description1")
            ->withChangePasswordIfTakeOver(True)
            ->withCreateAccountScript((new \Gs2\Account\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-1001")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-1002"))
            ->withAuthenticationScript((new \Gs2\Account\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-1003")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-1004"))
            ->withCreateTakeOverScript((new \Gs2\Account\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-1005")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-1006"))
            ->withDoTakeOverScript((new \Gs2\Account\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-1007")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-1008"))
            ->withLogSetting((new \Gs2\Account\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateNamespaceRequest;
import io.gs2.account.result.UpdateNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withChangePasswordIfTakeOver(true)
            .withCreateAccountScript(new io.gs2.account.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1001")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002"))
            .withAuthenticationScript(new io.gs2.account.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004"))
            .withCreateTakeOverScript(new io.gs2.account.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1005")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1006"))
            .withDoTakeOverScript(new io.gs2.account.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1007")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1008"))
            .withLogSetting(new io.gs2.account.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.UpdateNamespaceRequest;
using Gs2.Gs2Account.Result.UpdateNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Account.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace1")
        .WithDescription("description1")
        .WithChangePasswordIfTakeOver(true)
        .WithCreateAccountScript(new Gs2.Gs2Account.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1001")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002"))
        .WithAuthenticationScript(new Gs2.Gs2Account.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004"))
        .WithCreateTakeOverScript(new Gs2.Gs2Account.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1005")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1006"))
        .WithDoTakeOverScript(new Gs2.Gs2Account.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1007")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1008"))
        .WithLogSetting(new Gs2.Gs2Account.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.updateNamespace(
        new Gs2Account.UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withChangePasswordIfTakeOver(true)
            .withCreateAccountScript(new Gs2Account.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1001")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002"))
            .withAuthenticationScript(new Gs2Account.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004"))
            .withCreateTakeOverScript(new Gs2Account.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1005")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1006"))
            .withDoTakeOverScript(new Gs2Account.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1007")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1008"))
            .withLogSetting(new Gs2Account.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.update_namespace(
        account.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_change_password_if_take_over(True)
            .with_create_account_script(
                account.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1001')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002'))
            .with_authentication_script(
                account.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004'))
            .with_create_take_over_script(
                account.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1005')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1006'))
            .with_do_take_over_script(
                account.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1007')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1008'))
            .with_log_setting(
                account.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.update_namespace({
    namespaceName="namespace1",
    description="description1",
    changePasswordIfTakeOver=true,
    createAccountScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1001",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002",
    },
    authenticationScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004",
    },
    createTakeOverScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1005",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1006",
    },
    doTakeOverScript={
        triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1007",
        doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1008",
    },
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

deleteNamespace

Delete namespace

Delete the specified namespace. This operation is irreversible and all data associated with the deleted namespace will be lost.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemNamespaceDeleted namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &account.DeleteNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteNamespaceRequest;
import io.gs2.account.result.DeleteNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    DeleteNamespaceResult result = client.deleteNamespace(
        new DeleteNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.DeleteNamespaceRequest;
using Gs2.Gs2Account.Result.DeleteNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Account.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.deleteNamespace(
        new Gs2Account.DeleteNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.delete_namespace(
        account.DeleteNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.delete_namespace({
    namespaceName="namespace1",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

dumpUserDataByUserId

Get dump data of the data associated with the specified user ID

Can be used to meet legal requirements for the protection of personal information, or to back up or migrate data.

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &account.DumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DumpUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->dumpUserDataByUserId(
        (new DumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DumpUserDataByUserIdRequest;
import io.gs2.account.result.DumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
        new DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Account.Result.DumpUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Account.Request.DumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.dumpUserDataByUserId(
        new Gs2Account.DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.dump_user_data_by_user_id(
        account.DumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result

checkDumpUserDataByUserId

Check if the dump of the data associated with the specified user ID is complete

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL of output data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &account.CheckDumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CheckDumpUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkDumpUserDataByUserId(
        (new CheckDumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.account.result.CheckDumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
        new CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Account.Result.CheckDumpUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Account.Request.CheckDumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.checkDumpUserDataByUserId(
        new Gs2Account.CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.check_dump_user_data_by_user_id(
        account.CheckDumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.check_dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
url = result.url;

cleanUserDataByUserId

Delete user data

Execute cleaning of data associated with the specified user ID This allows you to safely delete specific user data from the project.

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &account.CleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CleanUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->cleanUserDataByUserId(
        (new CleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CleanUserDataByUserIdRequest;
import io.gs2.account.result.CleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
        new CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Account.Result.CleanUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Account.Request.CleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.cleanUserDataByUserId(
        new Gs2Account.CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.clean_user_data_by_user_id(
        account.CleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result

checkCleanUserDataByUserId

Check if the cleaning of the data associated with the specified user ID is complete

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &account.CheckCleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CheckCleanUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkCleanUserDataByUserId(
        (new CheckCleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.account.result.CheckCleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
        new CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Account.Result.CheckCleanUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Account.Request.CheckCleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.checkCleanUserDataByUserId(
        new Gs2Account.CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.check_clean_user_data_by_user_id(
        account.CheckCleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.check_clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result

prepareImportUserDataByUserId

Execute import of data associated with the specified user ID

The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.

You can start the actual import process by uploading the exported zip file to the URL returned in the return value of this API and calling importUserDataByUserId.

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
uploadTokenstringToken used to reflect results after upload
uploadUrlstringURL used to upload user data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &account.PrepareImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\PrepareImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareImportUserDataByUserId(
        (new PrepareImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.account.result.PrepareImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
        new PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Account.Result.PrepareImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Account.Request.PrepareImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.prepareImportUserDataByUserId(
        new Gs2Account.PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.prepare_import_user_data_by_user_id(
        account.PrepareImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.prepare_import_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

importUserDataByUserId

Execute import of data associated with the specified user ID

The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.

Before calling this API, you must call prepareImportUserDataByUserId to complete the upload preparation.

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
uploadTokenstring~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &account.ImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\ImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->importUserDataByUserId(
        (new ImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.ImportUserDataByUserIdRequest;
import io.gs2.account.result.ImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    ImportUserDataByUserIdResult result = client.importUserDataByUserId(
        new ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Account.Result.ImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2Account.Request.ImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.importUserDataByUserId(
        new Gs2Account.ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.import_user_data_by_user_id(
        account.ImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result

checkImportUserDataByUserId

Check if the import of the data associated with the specified user ID is complete

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
uploadTokenstring~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL of log data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &account.CheckImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CheckImportUserDataByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkImportUserDataByUserId(
        (new CheckImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CheckImportUserDataByUserIdRequest;
import io.gs2.account.result.CheckImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
        new CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Account.Result.CheckImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2Account.Request.CheckImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.checkImportUserDataByUserId(
        new Gs2Account.CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.check_import_user_data_by_user_id(
        account.CheckImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.check_import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
url = result.url;

describeAccounts

Get list of game player accounts

Get a list of all game player accounts in the specified namespace. The information for the accounts retrieved includes the account ID, status, and creation date. Supports pagination, limits the number of accounts that can be retrieved at one time, and provides a token for the next page.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<Account>List of Game Player Account
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DescribeAccounts(
    &account.DescribeAccountsRequest {
        NamespaceName: pointy.String("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeAccountsRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeAccounts(
        (new DescribeAccountsRequest())
            ->withNamespaceName(self::namespace1)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeAccountsRequest;
import io.gs2.account.result.DescribeAccountsResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    DescribeAccountsResult result = client.describeAccounts(
        new DescribeAccountsRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Account> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.DescribeAccountsRequest;
using Gs2.Gs2Account.Result.DescribeAccountsResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DescribeAccountsResult> asyncResult = null;
yield return client.DescribeAccounts(
    new Gs2.Gs2Account.Request.DescribeAccountsRequest()
        .WithNamespaceName("namespace1")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.describeAccounts(
        new Gs2Account.DescribeAccountsRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.describe_accounts(
        account.DescribeAccountsRequest()
            .with_namespace_name(self.hash1)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.describe_accounts({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createAccount

Create a new game player account

This method creates a new game player account. No user ID or password is required to create an account. The user ID and password are automatically generated. When the creation is successful, the details of the newly created account are returned as a response.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

Result

TypeDescription
itemAccountGame player account created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CreateAccount(
    &account.CreateAccountRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateAccountRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createAccount(
        (new CreateAccountRequest())
            ->withNamespaceName(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateAccountRequest;
import io.gs2.account.result.CreateAccountResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    CreateAccountResult result = client.createAccount(
        new CreateAccountRequest()
            .withNamespaceName("namespace1")
    );
    Account item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.CreateAccountRequest;
using Gs2.Gs2Account.Result.CreateAccountResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateAccountResult> asyncResult = null;
yield return client.CreateAccount(
    new Gs2.Gs2Account.Request.CreateAccountRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.createAccount(
        new Gs2Account.CreateAccountRequest()
            .withNamespaceName("namespace1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.create_account(
        account.CreateAccountRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.create_account({
    namespaceName="namespace1",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

updateTimeOffset

Update the correction value for the current time of the game player’s account

Update the correction value for the current time of the specified game player’s account. This time correction can be used to test future event schedules in advance.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
timeOffsetint0~ 315360000Time offset from current time(in seconds)
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemAccountUpdated game player account

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.UpdateTimeOffset(
    &account.UpdateTimeOffsetRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("$account1.userId"),
        TimeOffset: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateTimeOffsetRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateTimeOffset(
        (new UpdateTimeOffsetRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId(self::$account1.userId)
            ->withTimeOffset(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateTimeOffsetRequest;
import io.gs2.account.result.UpdateTimeOffsetResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    UpdateTimeOffsetResult result = client.updateTimeOffset(
        new UpdateTimeOffsetRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withTimeOffset(null)
            .withTimeOffsetToken(null)
    );
    Account item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.UpdateTimeOffsetRequest;
using Gs2.Gs2Account.Result.UpdateTimeOffsetResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.UpdateTimeOffsetResult> asyncResult = null;
yield return client.UpdateTimeOffset(
    new Gs2.Gs2Account.Request.UpdateTimeOffsetRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("$account1.userId")
        .WithTimeOffset(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.updateTimeOffset(
        new Gs2Account.UpdateTimeOffsetRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withTimeOffset(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.update_time_offset(
        account.UpdateTimeOffsetRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
            .with_time_offset(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.update_time_offset({
    namespaceName="namespace1",
    userId="$account1.userId",
    timeOffset=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

updateBanned

Update on account ban status of game player account

This is used to update the BAN (access restriction) status of a specific game player account. The BAN status of an account can be enabled or disabled, which restricts the account’s use in the game. Specify the account ID and the new BAN status to update.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
bannedboolfalseWhether the account is currently BAN
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemAccountUpdated game player account

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.UpdateBanned(
    &account.UpdateBannedRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("$account1.userId"),
        Banned: pointy.Bool(true),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateBannedRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateBanned(
        (new UpdateBannedRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId(self::$account1.userId)
            ->withBanned(True)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateBannedRequest;
import io.gs2.account.result.UpdateBannedResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    UpdateBannedResult result = client.updateBanned(
        new UpdateBannedRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withBanned(true)
            .withTimeOffsetToken(null)
    );
    Account item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.UpdateBannedRequest;
using Gs2.Gs2Account.Result.UpdateBannedResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.UpdateBannedResult> asyncResult = null;
yield return client.UpdateBanned(
    new Gs2.Gs2Account.Request.UpdateBannedRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("$account1.userId")
        .WithBanned(true)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.updateBanned(
        new Gs2Account.UpdateBannedRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withBanned(true)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.update_banned(
        account.UpdateBannedRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
            .with_banned(True)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.update_banned({
    namespaceName="namespace1",
    userId="$account1.userId",
    banned=true,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

addBan

Update on account ban status of game player account

This is used to add a new BAN status to a specific game player account. A temporary or permanent access ban can be set for a specific account. To add a BAN, you need to specify the account ID and the BAN status (including the reason and period).

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
banStatusBanStatusBan status
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemAccountUpdated game player account

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.AddBan(
    &account.AddBanRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("$account1.userId"),
        BanStatus: &account.BanStatus{
            Name: pointy.String("feature1"),
            Reason: pointy.String("reason"),
            ReleaseTimestamp: pointy.Int64(1000000000000),
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\AddBanRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->addBan(
        (new AddBanRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId(self::$account1.userId)
            ->withBanStatus((new BanStatus())
                ->withName("feature1")
                ->withReason("reason")
                ->withReleaseTimestamp(1000000000000)
            )
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.AddBanRequest;
import io.gs2.account.result.AddBanResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    AddBanResult result = client.addBan(
        new AddBanRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withBanStatus(new BanStatus()
                .withName("feature1")
                .withReason("reason")
                .withReleaseTimestamp(1000000000000L)
            )
            .withTimeOffsetToken(null)
    );
    Account item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.AddBanRequest;
using Gs2.Gs2Account.Result.AddBanResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.AddBanResult> asyncResult = null;
yield return client.AddBan(
    new Gs2.Gs2Account.Request.AddBanRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("$account1.userId")
        .WithBanStatus(new Gs2.Gs2Account.Model.BanStatus()
            .WithName("feature1")
            .WithReason("reason")
            .WithReleaseTimestamp(1000000000000L)
        )
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.addBan(
        new Gs2Account.AddBanRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withBanStatus(new Gs2Account.model.BanStatus()
                .withName("feature1")
                .withReason("reason")
                .withReleaseTimestamp(1000000000000)
            )
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.add_ban(
        account.AddBanRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
            .with_ban_status(account.BanStatus()
                .with_name('feature1')
                .with_reason('reason')
                .with_release_timestamp(1000000000000)
            )
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.add_ban({
    namespaceName="namespace1",
    userId="$account1.userId",
    banStatus={
        name="feature1",
        reason="reason",
        release_timestamp=1000000000000,
    },
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

removeBan

Delete account ban status of game player account

This is used to delete the BAN status applied to a specific game player account. To delete, specify the account ID and the name of the BAN status to be deleted.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
banStatusNamestring~ 36 charsBan status name
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemAccountUpdated game player account

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.RemoveBan(
    &account.RemoveBanRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("$account1.userId"),
        BanStatusName: pointy.String("status-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\RemoveBanRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->removeBan(
        (new RemoveBanRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId(self::$account1.userId)
            ->withBanStatusName("status-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.RemoveBanRequest;
import io.gs2.account.result.RemoveBanResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    RemoveBanResult result = client.removeBan(
        new RemoveBanRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withBanStatusName("status-0001")
            .withTimeOffsetToken(null)
    );
    Account item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.RemoveBanRequest;
using Gs2.Gs2Account.Result.RemoveBanResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.RemoveBanResult> asyncResult = null;
yield return client.RemoveBan(
    new Gs2.Gs2Account.Request.RemoveBanRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("$account1.userId")
        .WithBanStatusName("status-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.removeBan(
        new Gs2Account.RemoveBanRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withBanStatusName("status-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.remove_ban(
        account.RemoveBanRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
            .with_ban_status_name('status-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.remove_ban({
    namespaceName="namespace1",
    userId="$account1.userId",
    banStatusName="status-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getAccount

Get a game player account

Get detailed information about a specific game player account with the specified ID. The information retrieved includes the account name, status, and creation date. This method is used to display detailed information about an account.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstringUUID~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemAccountGame Player Account

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetAccount(
    &account.GetAccountRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("$account1.userId"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetAccountRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getAccount(
        (new GetAccountRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId(self::$account1.userId)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetAccountRequest;
import io.gs2.account.result.GetAccountResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    GetAccountResult result = client.getAccount(
        new GetAccountRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withTimeOffsetToken(null)
    );
    Account item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.GetAccountRequest;
using Gs2.Gs2Account.Result.GetAccountResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetAccountResult> asyncResult = null;
yield return client.GetAccount(
    new Gs2.Gs2Account.Request.GetAccountRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("$account1.userId")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.getAccount(
        new Gs2Account.GetAccountRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.get_account(
        account.GetAccountRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.get_account({
    namespaceName="namespace1",
    userId="$account1.userId",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

deleteAccount

Delete game player account

This is used to delete a specific game player account. When an account is deleted, it can no longer be logged in with that account, but any user data that is not managed by GS2-Account will remain in GS2. If you need to delete all user data as well, please use the user data complete deletion function accessible from the management console.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstringUUID~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemAccountDeleted game player accounts

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeleteAccount(
    &account.DeleteAccountRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("$account1.userId"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteAccountRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteAccount(
        (new DeleteAccountRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId(self::$account1.userId)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteAccountRequest;
import io.gs2.account.result.DeleteAccountResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    DeleteAccountResult result = client.deleteAccount(
        new DeleteAccountRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withTimeOffsetToken(null)
    );
    Account item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.DeleteAccountRequest;
using Gs2.Gs2Account.Result.DeleteAccountResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeleteAccountResult> asyncResult = null;
yield return client.DeleteAccount(
    new Gs2.Gs2Account.Request.DeleteAccountRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("$account1.userId")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.deleteAccount(
        new Gs2Account.DeleteAccountRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.delete_account(
        account.DeleteAccountRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.delete_account({
    namespaceName="namespace1",
    userId="$account1.userId",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

authentication

Authenticate game player account

Used to authenticate a game player account. When a user logs in to an account, the username and password are checked. If the correct authentication information is provided, the account information and its signature are issued. By passing this information to GS2-Auth, you can obtain an access token and access GS2’s various microservices as a user who has logged in.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024 charsencryption key GRN
passwordstring~ 128 charsPassword
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemAccountGame Player Account
banStatusesList<BanStatus>Ban status list
bodystringAccount information for signing subject
signaturestringsignature

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.Authentication(
    &account.AuthenticationRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        KeyId: pointy.String("grn:gs2:ap-northeast-1:owner_id:key:namespace1:key:key-0001"),
        Password: pointy.String("password-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
banStatuses := result.BanStatuses
body := result.Body
signature := result.Signature
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\AuthenticationRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->authentication(
        (new AuthenticationRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withKeyId("grn:gs2:ap-northeast-1:owner_id:key:\namespace1:key:key-0001")
            ->withPassword("password-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $banStatuses = $result->getBanStatuses();
    $body = $result->getBody();
    $signature = $result->getSignature();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.AuthenticationRequest;
import io.gs2.account.result.AuthenticationResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    AuthenticationResult result = client.authentication(
        new AuthenticationRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withKeyId("grn:gs2:ap-northeast-1:owner_id:key:namespace1:key:key-0001")
            .withPassword("password-0001")
            .withTimeOffsetToken(null)
    );
    Account item = result.getItem();
    List<BanStatus> banStatuses = result.getBanStatuses();
    String body = result.getBody();
    String signature = result.getSignature();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.AuthenticationRequest;
using Gs2.Gs2Account.Result.AuthenticationResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.AuthenticationResult> asyncResult = null;
yield return client.Authentication(
    new Gs2.Gs2Account.Request.AuthenticationRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithKeyId("grn:gs2:ap-northeast-1:owner_id:key:namespace1:key:key-0001")
        .WithPassword("password-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var banStatuses = result.BanStatuses;
var body = result.Body;
var signature = result.Signature;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.authentication(
        new Gs2Account.AuthenticationRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withKeyId("grn:gs2:ap-northeast-1:owner_id:key:namespace1:key:key-0001")
            .withPassword("password-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const banStatuses = result.getBanStatuses();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.authentication(
        account.AuthenticationRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_key_id('grn:gs2:ap-northeast-1:owner_id:key:namespace1:key:key-0001')
            .with_password('password-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    ban_statuses = result.ban_statuses
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.authentication({
    namespaceName="namespace1",
    userId="user-0001",
    keyId="grn:gs2:ap-northeast-1:owner_id:key:namespace1:key:key-0001",
    password="password-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
banStatuses = result.banStatuses;
body = result.body;
signature = result.signature;

describeTakeOvers

Get list of takeover settings

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<TakeOver>List of Takeover Setting
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DescribeTakeOvers(
    &account.DescribeTakeOversRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$account1.userId"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeTakeOversRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeTakeOvers(
        (new DescribeTakeOversRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$account1.userId)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeTakeOversRequest;
import io.gs2.account.result.DescribeTakeOversResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    DescribeTakeOversResult result = client.describeTakeOvers(
        new DescribeTakeOversRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$account1.userId")
            .withPageToken(null)
            .withLimit(null)
    );
    List<TakeOver> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.DescribeTakeOversRequest;
using Gs2.Gs2Account.Result.DescribeTakeOversResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DescribeTakeOversResult> asyncResult = null;
yield return client.DescribeTakeOvers(
    new Gs2.Gs2Account.Request.DescribeTakeOversRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$account1.userId")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.describeTakeOvers(
        new Gs2Account.DescribeTakeOversRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$account1.userId")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.describe_take_overs(
        account.DescribeTakeOversRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.account1.user_id)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.describe_take_overs({
    namespaceName="namespace1",
    accessToken="$account1.userId",
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

describeTakeOversByUserId

Get list of takeover settings by specifying user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<TakeOver>List of Takeover Setting
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DescribeTakeOversByUserId(
    &account.DescribeTakeOversByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("$account1.userId"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeTakeOversByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeTakeOversByUserId(
        (new DescribeTakeOversByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId(self::$account1.userId)
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeTakeOversByUserIdRequest;
import io.gs2.account.result.DescribeTakeOversByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    DescribeTakeOversByUserIdResult result = client.describeTakeOversByUserId(
        new DescribeTakeOversByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<TakeOver> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.DescribeTakeOversByUserIdRequest;
using Gs2.Gs2Account.Result.DescribeTakeOversByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DescribeTakeOversByUserIdResult> asyncResult = null;
yield return client.DescribeTakeOversByUserId(
    new Gs2.Gs2Account.Request.DescribeTakeOversByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("$account1.userId")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.describeTakeOversByUserId(
        new Gs2Account.DescribeTakeOversByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.describe_take_overs_by_user_id(
        account.DescribeTakeOversByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.describe_take_overs_by_user_id({
    namespaceName="namespace1",
    userId="$account1.userId",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

createTakeOver

Create a new takeover setting

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
typeint~ 1024Slot Number
userIdentifierstring~ 1024 charsUser ID for takeover
passwordstring~ 128 charsPassword

Result

TypeDescription
itemTakeOverTakeover settings created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CreateTakeOver(
    &account.CreateTakeOverRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$account1.userId"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("user-0001@gs2.io"),
        Password: pointy.String("password-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateTakeOverRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createTakeOver(
        (new CreateTakeOverRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$account1.userId)
            ->withType(0)
            ->withUserIdentifier("user-0001@gs2.io")
            ->withPassword("password-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateTakeOverRequest;
import io.gs2.account.result.CreateTakeOverResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    CreateTakeOverResult result = client.createTakeOver(
        new CreateTakeOverRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$account1.userId")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
            .withPassword("password-0001")
    );
    TakeOver item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.CreateTakeOverRequest;
using Gs2.Gs2Account.Result.CreateTakeOverResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateTakeOverResult> asyncResult = null;
yield return client.CreateTakeOver(
    new Gs2.Gs2Account.Request.CreateTakeOverRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$account1.userId")
        .WithType(0)
        .WithUserIdentifier("user-0001@gs2.io")
        .WithPassword("password-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.createTakeOver(
        new Gs2Account.CreateTakeOverRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$account1.userId")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
            .withPassword("password-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.create_take_over(
        account.CreateTakeOverRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.account1.user_id)
            .with_type(0)
            .with_user_identifier('user-0001@gs2.io')
            .with_password('password-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.create_take_over({
    namespaceName="namespace1",
    accessToken="$account1.userId",
    type=0,
    userIdentifier="user-0001@gs2.io",
    password="password-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

createTakeOverByUserId

Create a new takeover setting by specifying a user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
typeint~ 1024Slot Number
userIdentifierstring~ 1024 charsUser ID for takeover
passwordstring~ 128 charsPassword
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemTakeOverTakeover settings created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.CreateTakeOverByUserId(
    &account.CreateTakeOverByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("$account1.userId"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("user-0001@gs2.io"),
        Password: pointy.String("password-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateTakeOverByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createTakeOverByUserId(
        (new CreateTakeOverByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId(self::$account1.userId)
            ->withType(0)
            ->withUserIdentifier("user-0001@gs2.io")
            ->withPassword("password-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateTakeOverByUserIdRequest;
import io.gs2.account.result.CreateTakeOverByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    CreateTakeOverByUserIdResult result = client.createTakeOverByUserId(
        new CreateTakeOverByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
            .withPassword("password-0001")
            .withTimeOffsetToken(null)
    );
    TakeOver item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.CreateTakeOverByUserIdRequest;
using Gs2.Gs2Account.Result.CreateTakeOverByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateTakeOverByUserIdResult> asyncResult = null;
yield return client.CreateTakeOverByUserId(
    new Gs2.Gs2Account.Request.CreateTakeOverByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("$account1.userId")
        .WithType(0)
        .WithUserIdentifier("user-0001@gs2.io")
        .WithPassword("password-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.createTakeOverByUserId(
        new Gs2Account.CreateTakeOverByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
            .withPassword("password-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.create_take_over_by_user_id(
        account.CreateTakeOverByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
            .with_type(0)
            .with_user_identifier('user-0001@gs2.io')
            .with_password('password-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.create_take_over_by_user_id({
    namespaceName="namespace1",
    userId="$account1.userId",
    type=0,
    userIdentifier="user-0001@gs2.io",
    password="password-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getTakeOver

Get takeover settings

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
typeint~ 1024Slot Number

Result

TypeDescription
itemTakeOvertakeover settings

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetTakeOver(
    &account.GetTakeOverRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$account1.userId"),
        Type: pointy.Int32(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetTakeOverRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getTakeOver(
        (new GetTakeOverRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$account1.userId)
            ->withType(0)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetTakeOverRequest;
import io.gs2.account.result.GetTakeOverResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    GetTakeOverResult result = client.getTakeOver(
        new GetTakeOverRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$account1.userId")
            .withType(0)
    );
    TakeOver item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.GetTakeOverRequest;
using Gs2.Gs2Account.Result.GetTakeOverResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetTakeOverResult> asyncResult = null;
yield return client.GetTakeOver(
    new Gs2.Gs2Account.Request.GetTakeOverRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$account1.userId")
        .WithType(0),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.getTakeOver(
        new Gs2Account.GetTakeOverRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$account1.userId")
            .withType(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.get_take_over(
        account.GetTakeOverRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.account1.user_id)
            .with_type(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.get_take_over({
    namespaceName="namespace1",
    accessToken="$account1.userId",
    type=0,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getTakeOverByUserId

Get takeover settings by specifying user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
typeint~ 1024Slot Number
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemTakeOvertakeover settings

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetTakeOverByUserId(
    &account.GetTakeOverByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("$account1.userId"),
        Type: pointy.Int32(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetTakeOverByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getTakeOverByUserId(
        (new GetTakeOverByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId(self::$account1.userId)
            ->withType(0)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetTakeOverByUserIdRequest;
import io.gs2.account.result.GetTakeOverByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    GetTakeOverByUserIdResult result = client.getTakeOverByUserId(
        new GetTakeOverByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withType(0)
            .withTimeOffsetToken(null)
    );
    TakeOver item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.GetTakeOverByUserIdRequest;
using Gs2.Gs2Account.Result.GetTakeOverByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetTakeOverByUserIdResult> asyncResult = null;
yield return client.GetTakeOverByUserId(
    new Gs2.Gs2Account.Request.GetTakeOverByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("$account1.userId")
        .WithType(0)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.getTakeOverByUserId(
        new Gs2Account.GetTakeOverByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withType(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.get_take_over_by_user_id(
        account.GetTakeOverByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
            .with_type(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.get_take_over_by_user_id({
    namespaceName="namespace1",
    userId="$account1.userId",
    type=0,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

updateTakeOver

Update takeover settings

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
typeint~ 1024Slot Number
oldPasswordstring~ 128 charsOld Password
passwordstring~ 128 charsPassword

Result

TypeDescription
itemTakeOverTakeover settings

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.UpdateTakeOver(
    &account.UpdateTakeOverRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$account1.userId"),
        Type: pointy.Int32(0),
        OldPassword: pointy.String("password-0001"),
        Password: pointy.String("password-1001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateTakeOverRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateTakeOver(
        (new UpdateTakeOverRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$account1.userId)
            ->withType(0)
            ->withOldPassword("password-0001")
            ->withPassword("password-1001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateTakeOverRequest;
import io.gs2.account.result.UpdateTakeOverResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    UpdateTakeOverResult result = client.updateTakeOver(
        new UpdateTakeOverRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$account1.userId")
            .withType(0)
            .withOldPassword("password-0001")
            .withPassword("password-1001")
    );
    TakeOver item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.UpdateTakeOverRequest;
using Gs2.Gs2Account.Result.UpdateTakeOverResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.UpdateTakeOverResult> asyncResult = null;
yield return client.UpdateTakeOver(
    new Gs2.Gs2Account.Request.UpdateTakeOverRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$account1.userId")
        .WithType(0)
        .WithOldPassword("password-0001")
        .WithPassword("password-1001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.updateTakeOver(
        new Gs2Account.UpdateTakeOverRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$account1.userId")
            .withType(0)
            .withOldPassword("password-0001")
            .withPassword("password-1001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.update_take_over(
        account.UpdateTakeOverRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.account1.user_id)
            .with_type(0)
            .with_old_password('password-0001')
            .with_password('password-1001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.update_take_over({
    namespaceName="namespace1",
    accessToken="$account1.userId",
    type=0,
    oldPassword="password-0001",
    password="password-1001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

updateTakeOverByUserId

Update takeover settings

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
typeint~ 1024Slot Number
oldPasswordstring~ 128 charsOld Password
passwordstring~ 128 charsPassword
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemTakeOverTakeover settings

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.UpdateTakeOverByUserId(
    &account.UpdateTakeOverByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("$account1.userId"),
        Type: pointy.Int32(0),
        OldPassword: pointy.String("password-0001"),
        Password: pointy.String("password-0002"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateTakeOverByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateTakeOverByUserId(
        (new UpdateTakeOverByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId(self::$account1.userId)
            ->withType(0)
            ->withOldPassword("password-0001")
            ->withPassword("password-0002")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateTakeOverByUserIdRequest;
import io.gs2.account.result.UpdateTakeOverByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    UpdateTakeOverByUserIdResult result = client.updateTakeOverByUserId(
        new UpdateTakeOverByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withType(0)
            .withOldPassword("password-0001")
            .withPassword("password-0002")
            .withTimeOffsetToken(null)
    );
    TakeOver item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.UpdateTakeOverByUserIdRequest;
using Gs2.Gs2Account.Result.UpdateTakeOverByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.UpdateTakeOverByUserIdResult> asyncResult = null;
yield return client.UpdateTakeOverByUserId(
    new Gs2.Gs2Account.Request.UpdateTakeOverByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("$account1.userId")
        .WithType(0)
        .WithOldPassword("password-0001")
        .WithPassword("password-0002")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.updateTakeOverByUserId(
        new Gs2Account.UpdateTakeOverByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withType(0)
            .withOldPassword("password-0001")
            .withPassword("password-0002")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.update_take_over_by_user_id(
        account.UpdateTakeOverByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
            .with_type(0)
            .with_old_password('password-0001')
            .with_password('password-0002')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.update_take_over_by_user_id({
    namespaceName="namespace1",
    userId="$account1.userId",
    type=0,
    oldPassword="password-0001",
    password="password-0002",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

deleteTakeOver

Delete takeover settings

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
typeint~ 1024Slot Number
userIdentifierstring~ 1024 charsUser ID for takeover

Result

TypeDescription
itemTakeOverDeleted takeover settings

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeleteTakeOver(
    &account.DeleteTakeOverRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$account1.userId"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("user-0001@gs2.io"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteTakeOverRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteTakeOver(
        (new DeleteTakeOverRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$account1.userId)
            ->withType(0)
            ->withUserIdentifier("user-0001@gs2.io")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteTakeOverRequest;
import io.gs2.account.result.DeleteTakeOverResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    DeleteTakeOverResult result = client.deleteTakeOver(
        new DeleteTakeOverRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$account1.userId")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
    );
    TakeOver item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.DeleteTakeOverRequest;
using Gs2.Gs2Account.Result.DeleteTakeOverResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeleteTakeOverResult> asyncResult = null;
yield return client.DeleteTakeOver(
    new Gs2.Gs2Account.Request.DeleteTakeOverRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("$account1.userId")
        .WithType(0)
        .WithUserIdentifier("user-0001@gs2.io"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.deleteTakeOver(
        new Gs2Account.DeleteTakeOverRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$account1.userId")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.delete_take_over(
        account.DeleteTakeOverRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.account1.user_id)
            .with_type(0)
            .with_user_identifier('user-0001@gs2.io')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.delete_take_over({
    namespaceName="namespace1",
    accessToken="$account1.userId",
    type=0,
    userIdentifier="user-0001@gs2.io",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

deleteTakeOverByUserIdentifier

Delete takeover settings by specifying user Identifier

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
typeint~ 1024Slot Number
userIdentifierstring~ 1024 charsUser ID for takeover

Result

TypeDescription
itemTakeOverDeleted takeover settings

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeleteTakeOverByUserIdentifier(
    &account.DeleteTakeOverByUserIdentifierRequest {
        NamespaceName: pointy.String("namespace1"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("user-0001@gs2.io"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteTakeOverByUserIdentifierRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteTakeOverByUserIdentifier(
        (new DeleteTakeOverByUserIdentifierRequest())
            ->withNamespaceName(self::namespace1)
            ->withType(0)
            ->withUserIdentifier("user-0001@gs2.io")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteTakeOverByUserIdentifierRequest;
import io.gs2.account.result.DeleteTakeOverByUserIdentifierResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    DeleteTakeOverByUserIdentifierResult result = client.deleteTakeOverByUserIdentifier(
        new DeleteTakeOverByUserIdentifierRequest()
            .withNamespaceName("namespace1")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
    );
    TakeOver item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.DeleteTakeOverByUserIdentifierRequest;
using Gs2.Gs2Account.Result.DeleteTakeOverByUserIdentifierResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeleteTakeOverByUserIdentifierResult> asyncResult = null;
yield return client.DeleteTakeOverByUserIdentifier(
    new Gs2.Gs2Account.Request.DeleteTakeOverByUserIdentifierRequest()
        .WithNamespaceName("namespace1")
        .WithType(0)
        .WithUserIdentifier("user-0001@gs2.io"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.deleteTakeOverByUserIdentifier(
        new Gs2Account.DeleteTakeOverByUserIdentifierRequest()
            .withNamespaceName("namespace1")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.delete_take_over_by_user_identifier(
        account.DeleteTakeOverByUserIdentifierRequest()
            .with_namespace_name(self.hash1)
            .with_type(0)
            .with_user_identifier('user-0001@gs2.io')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.delete_take_over_by_user_identifier({
    namespaceName="namespace1",
    type=0,
    userIdentifier="user-0001@gs2.io",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

deleteTakeOverByUserId

Delete takeover settings by specifying user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
typeint~ 1024Slot Number
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemTakeOverDeleted takeover settings

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeleteTakeOverByUserId(
    &account.DeleteTakeOverByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("$account1.userId"),
        Type: pointy.Int32(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteTakeOverByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteTakeOverByUserId(
        (new DeleteTakeOverByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId(self::$account1.userId)
            ->withType(0)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteTakeOverByUserIdRequest;
import io.gs2.account.result.DeleteTakeOverByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    DeleteTakeOverByUserIdResult result = client.deleteTakeOverByUserId(
        new DeleteTakeOverByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withType(0)
            .withTimeOffsetToken(null)
    );
    TakeOver item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.DeleteTakeOverByUserIdRequest;
using Gs2.Gs2Account.Result.DeleteTakeOverByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeleteTakeOverByUserIdResult> asyncResult = null;
yield return client.DeleteTakeOverByUserId(
    new Gs2.Gs2Account.Request.DeleteTakeOverByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("$account1.userId")
        .WithType(0)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.deleteTakeOverByUserId(
        new Gs2Account.DeleteTakeOverByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withType(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.delete_take_over_by_user_id(
        account.DeleteTakeOverByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
            .with_type(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.delete_take_over_by_user_id({
    namespaceName="namespace1",
    userId="$account1.userId",
    type=0,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

doTakeOver

Update takeover settings

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
typeint~ 1024Slot Number
userIdentifierstring~ 1024 charsUser ID for takeover
passwordstring~ 128 charsPassword

Result

TypeDescription
itemAccountGame Player Account

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DoTakeOver(
    &account.DoTakeOverRequest {
        NamespaceName: pointy.String("namespace1"),
        Type: pointy.Int32(0),
        UserIdentifier: pointy.String("user-0001@gs2.io"),
        Password: pointy.String("password-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DoTakeOverRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->doTakeOver(
        (new DoTakeOverRequest())
            ->withNamespaceName(self::namespace1)
            ->withType(0)
            ->withUserIdentifier("user-0001@gs2.io")
            ->withPassword("password-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DoTakeOverRequest;
import io.gs2.account.result.DoTakeOverResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    DoTakeOverResult result = client.doTakeOver(
        new DoTakeOverRequest()
            .withNamespaceName("namespace1")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
            .withPassword("password-0001")
    );
    Account item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.DoTakeOverRequest;
using Gs2.Gs2Account.Result.DoTakeOverResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DoTakeOverResult> asyncResult = null;
yield return client.DoTakeOver(
    new Gs2.Gs2Account.Request.DoTakeOverRequest()
        .WithNamespaceName("namespace1")
        .WithType(0)
        .WithUserIdentifier("user-0001@gs2.io")
        .WithPassword("password-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.doTakeOver(
        new Gs2Account.DoTakeOverRequest()
            .withNamespaceName("namespace1")
            .withType(0)
            .withUserIdentifier("user-0001@gs2.io")
            .withPassword("password-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.do_take_over(
        account.DoTakeOverRequest()
            .with_namespace_name(self.hash1)
            .with_type(0)
            .with_user_identifier('user-0001@gs2.io')
            .with_password('password-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.do_take_over({
    namespaceName="namespace1",
    type=0,
    userIdentifier="user-0001@gs2.io",
    password="password-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getDataOwnerByUserId

Get Data Owner

This action is used to get information about a data owner associated with a specified user ID. This action returns detailed information about a data owner associated with a specific account in the specified namespace. Data owner information includes data owner ID, associated user ID, and other related information.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstringUUID~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemDataOwnerDataOwner

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.GetDataOwnerByUserId(
    &account.GetDataOwnerByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("$account1.userId"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetDataOwnerByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getDataOwnerByUserId(
        (new GetDataOwnerByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId(self::$account1.userId)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetDataOwnerByUserIdRequest;
import io.gs2.account.result.GetDataOwnerByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    GetDataOwnerByUserIdResult result = client.getDataOwnerByUserId(
        new GetDataOwnerByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withTimeOffsetToken(null)
    );
    DataOwner item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.GetDataOwnerByUserIdRequest;
using Gs2.Gs2Account.Result.GetDataOwnerByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.GetDataOwnerByUserIdResult> asyncResult = null;
yield return client.GetDataOwnerByUserId(
    new Gs2.Gs2Account.Request.GetDataOwnerByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("$account1.userId")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.getDataOwnerByUserId(
        new Gs2Account.GetDataOwnerByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.get_data_owner_by_user_id(
        account.GetDataOwnerByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.get_data_owner_by_user_id({
    namespaceName="namespace1",
    userId="$account1.userId",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

deleteDataOwnerByUserId

Delete Data Owner

This action is used to delete information about a data owner associated with a specified user ID. This action completely deletes the data owner associated with the specified account in the specified namespace from the system. The relationship between the user ID and the data owner ID is lost, and it is unknown whose data it is unless the user ID is included in the user data managed by GS2.

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstringUUID~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemDataOwnerDeleted namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := account.Gs2AccountRestClient{
    Session: &session,
}
result, err := client.DeleteDataOwnerByUserId(
    &account.DeleteDataOwnerByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("$account1.userId"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteDataOwnerByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteDataOwnerByUserId(
        (new DeleteDataOwnerByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId(self::$account1.userId)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteDataOwnerByUserIdRequest;
import io.gs2.account.result.DeleteDataOwnerByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);

try {
    DeleteDataOwnerByUserIdResult result = client.deleteDataOwnerByUserId(
        new DeleteDataOwnerByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withTimeOffsetToken(null)
    );
    DataOwner item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Account.Gs2AccountRestClient;
using Gs2.Gs2Account.Request.DeleteDataOwnerByUserIdRequest;
using Gs2.Gs2Account.Result.DeleteDataOwnerByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2AccountRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.DeleteDataOwnerByUserIdResult> asyncResult = null;
yield return client.DeleteDataOwnerByUserId(
    new Gs2.Gs2Account.Request.DeleteDataOwnerByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("$account1.userId")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);

try {
    const result = await client.deleteDataOwnerByUserId(
        new Gs2Account.DeleteDataOwnerByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("$account1.userId")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)

try:
    result = client.delete_data_owner_by_user_id(
        account.DeleteDataOwnerByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('account')

api_result = client.delete_data_owner_by_user_id({
    namespaceName="namespace1",
    userId="$account1.userId",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;