NAV
go python java php typescript csharp GS2-Script

GS2-Account

GS2-SDK のリファレンス

モデル

Namespace

ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。 GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。

そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。

説明
namespaceId string ネームスペースGRN
name string ネームスペース名
description string 説明文
changePasswordIfTakeOver bool アカウント引き継ぎ時にパスワードを変更するか
createAccountScript ScriptSetting アカウント新規作成したときに実行するスクリプト
authenticationScript ScriptSetting 認証したときに実行するスクリプト
createTakeOverScript ScriptSetting 引き継ぎ情報登録したときに実行するスクリプト
doTakeOverScript ScriptSetting 引き継ぎ実行したときに実行するスクリプト
logSetting LogSetting ログの出力設定
createdAt long 作成日時
updatedAt long 最終更新日時

Account

ゲームプレイヤーアカウント

ゲームプレイヤーを識別するID情報のエンティティです。 ゲームプレイヤーアカウントは匿名アカウントであり、ユーザーID(UUID)とパスワード(ランダムな32文字の文字列)で構成されるため、ゲームプレイヤーはメールアドレスなどの情報を入力する必要はありません。

発行されたゲームプレイヤーアカウントは、デバイスのローカルストレージに保存しておき、次回以降ログインに使用します。

説明
accountId string ゲームプレイヤーアカウントGRN
userId string アカウントID
password string パスワード
timeOffset int 現在時刻に対する補正値(現在時刻を起点とした秒数)
createdAt long 作成日時

TakeOver

引継ぎ情報

引継ぎ情報とは、デバイスの機種変更やプラットフォーム間のアカウントの移動・共有時に使用する情報です。 個人を識別するユニークな文字列とパスワードで構成され、その適切な組み合わせを入力することで、Account(匿名アカウント)を取得することができます。

1つの Account に対して複数の引継ぎ情報を設定できます。 複数の引継ぎ情報を設定するにはそれぞれ異なるスロットを指定する必要があります。 スロットには0~1024を指定できますので、最大1025種類の引継ぎ情報を設定可能です。

具体的な用例としては 0 には Twitter のアカウント情報を、1 には Sign-in Apple のアカウント情報を、2 には Google のアカウント情報を保存するようにする。というような使い方が想定されています。 あくまでこの引継ぎ情報はデータホルダーであり、ソーシャルアカウントとの認証の仕組みは別途用意する必要があります。

説明
takeOverId string 引き継ぎ設定GRN
userId string ユーザーID
type int スロット番号
userIdentifier string 引き継ぎ用ユーザーID
password string パスワード
createdAt long 作成日時

ScriptSetting

スクリプト設定

説明
triggerScriptId string スクリプトGRN
doneTriggerTargetType string 完了通知の通知先
doneTriggerScriptId string スクリプトGRN
doneTriggerQueueNamespaceId string ネームスペースGRN

LogSetting

ログの書き出し設定

説明
loggingNamespaceId string ネームスペースGRN

メソッド

describeNamespaces

describeNamespaces

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.CreateNamespaceResult> asyncResult = null;
yield return client.describeNamespaces(
    new 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(undefined)
            .withLimit(undefined)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

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

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

client = gs2('account')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

ネームスペースの一覧を取得

Request

必須 デフォルト 値の制限 説明
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items Namespace[] ネームスペースのリスト
nextPageToken string リストの続きを取得するためのページトークン

createNamespace

createNamespace

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),
        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)
            ->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)
            .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 CreateNamespaceRequest()
        .withName("namespace1")
        .withDescription(null)
        .withChangePasswordIfTakeOver(false)
        .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(undefined)
            .withChangePasswordIfTakeOver(false)
            .withCreateAccountScript(undefined)
            .withAuthenticationScript(undefined)
            .withCreateTakeOverScript(undefined)
            .withDoTakeOverScript(undefined)
            .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

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

try:
    result = client.create_namespace(
        new account.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_change_password_if_take_over(False)
            .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:
    os.exit(1);

client = gs2('account')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを新規作成

Request

必須 デフォルト 値の制限 説明
name string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
changePasswordIfTakeOver bool false アカウント引き継ぎ時にパスワードを変更するか
createAccountScript ScriptSetting アカウント新規作成したときに実行するスクリプト
authenticationScript ScriptSetting 認証したときに実行するスクリプト
createTakeOverScript ScriptSetting 引き継ぎ情報登録したときに実行するスクリプト
doTakeOverScript ScriptSetting 引き継ぎ実行したときに実行するスクリプト
logSetting LogSetting ログの出力設定

Result

説明
item Namespace 作成したネームスペース

getNamespaceStatus

getNamespaceStatus

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.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespaceStatus(
    new 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

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

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

client = gs2('account')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
status = result.status;

ネームスペースを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
status string

getNamespace

getNamespace

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.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespace(
    new 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

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

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

client = gs2('account')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item Namespace ネームスペース

updateNamespace

updateNamespace

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.CreateNamespaceResult> asyncResult = null;
yield return client.updateNamespace(
    new 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

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

try:
    result = client.update_namespace(
        new 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:
    os.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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
changePasswordIfTakeOver bool false アカウント引き継ぎ時にパスワードを変更するか
createAccountScript ScriptSetting アカウント新規作成したときに実行するスクリプト
authenticationScript ScriptSetting 認証したときに実行するスクリプト
createTakeOverScript ScriptSetting 引き継ぎ情報登録したときに実行するスクリプト
doTakeOverScript ScriptSetting 引き継ぎ実行したときに実行するスクリプト
logSetting LogSetting ログの出力設定

Result

説明
item Namespace 更新したネームスペース

deleteNamespace

deleteNamespace

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")
}
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)
    );
} 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")
    );
} 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.CreateNamespaceResult> asyncResult = null;
yield return client.deleteNamespace(
    new DeleteNamespaceRequest()
        .withNamespaceName("namespace1"),
    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.deleteNamespace(
        new Gs2Account.DeleteNamespaceRequest()
            .withNamespaceName('namespace1')
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

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

try:
    result = client.delete_namespace(
        new account.DeleteNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('account')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result

ネームスペースを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明

describeAccounts

describeAccounts

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.CreateNamespaceResult> asyncResult = null;
yield return client.describeAccounts(
    new 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(undefined)
            .withLimit(undefined)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

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

try:
    result = client.describe_accounts(
        new 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:
    os.exit(1);

client = gs2('account')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

ゲームプレイヤーアカウントの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items Account[] ゲームプレイヤーアカウントのリスト
nextPageToken string リストの続きを取得するためのページトークン

createAccount

createAccount

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.CreateNamespaceResult> asyncResult = null;
yield return client.createAccount(
    new 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

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

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

client = gs2('account')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ゲームプレイヤーアカウントを新規作成

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item Account 作成したゲームプレイヤーアカウント

updateTimeOffset

updateTimeOffset

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,
    }
)
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)
    );
    $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)
    );
    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.CreateNamespaceResult> asyncResult = null;
yield return client.updateTimeOffset(
    new UpdateTimeOffsetRequest()
        .withNamespaceName("namespace1")
        .withUserId("$account1.userId")
        .withTimeOffset(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(undefined)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

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

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

client = gs2('account')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ゲームプレイヤーアカウントの現在時刻に対する補正値を更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
timeOffset int 0 ~ 315360000 現在時刻に対する補正値(現在時刻を起点とした秒数)

Result

説明
item Account 更新したゲームプレイヤーアカウント

getAccount

getAccount

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"),
    }
)
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)
    );
    $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")
    );
    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.CreateNamespaceResult> asyncResult = null;
yield return client.getAccount(
    new GetAccountRequest()
        .withNamespaceName("namespace1")
        .withUserId("$account1.userId"),
    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')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

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

try:
    result = client.get_account(
        new account.GetAccountRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('account')

api_result = client.get_account({
    namespaceName='namespace1',
    userId='$account1.userId',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ゲームプレイヤーアカウントを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string UUID ~ 36文字 アカウントID

Result

説明
item Account ゲームプレイヤーアカウント

deleteAccount

deleteAccount

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"),
    }
)
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\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)
    );
} 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")
    );
} 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.CreateNamespaceResult> asyncResult = null;
yield return client.deleteAccount(
    new DeleteAccountRequest()
        .withNamespaceName("namespace1")
        .withUserId("$account1.userId"),
    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.deleteAccount(
        new Gs2Account.DeleteAccountRequest()
            .withNamespaceName('namespace1')
            .withUserId('$account1.userId')
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

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

try:
    result = client.delete_account(
        new account.DeleteAccountRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
    )
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('account')

api_result = client.delete_account({
    namespaceName='namespace1',
    userId='$account1.userId',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result

ゲームプレイヤーアカウントを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string UUID ~ 36文字 アカウントID

Result

説明

authentication

authentication

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"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
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')
    );
    $item = $result->getItem();
    $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")
    );
    Account item = result.getItem();
    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.CreateNamespaceResult> asyncResult = null;
yield return 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"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
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')
    );
    const item = result.getItem();
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

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

try:
    result = client.authentication(
        new 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')
    )
    item = result.item
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    os.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',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

ゲームプレイヤーアカウントを認証

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string UUID ~ 36文字 アカウントID
keyId string ~ 1024文字 暗号鍵GRN
password string ~ 128文字 パスワード

Result

説明
item Account ゲームプレイヤーアカウント
body string 署名対象のアカウント情報
signature string 署名

describeTakeOvers

describeTakeOvers

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.CreateNamespaceResult> asyncResult = null;
yield return client.describeTakeOvers(
    new 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(undefined)
            .withLimit(undefined)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

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

try:
    result = client.describe_take_overs(
        new 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:
    os.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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

引き継ぎ設定の一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items TakeOver[] 引き継ぎ設定のリスト
nextPageToken string リストの続きを取得するためのページトークン

describeTakeOversByUserId

describeTakeOversByUserId

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,
    }
)
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)
    );
    $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)
    );
    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.CreateNamespaceResult> asyncResult = null;
yield return client.describeTakeOversByUserId(
    new DescribeTakeOversByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("$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.describeTakeOversByUserId(
        new Gs2Account.DescribeTakeOversByUserIdRequest()
            .withNamespaceName('namespace1')
            .withUserId('$account1.userId')
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

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

try:
    result = client.describe_take_overs_by_user_id(
        new account.DescribeTakeOversByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(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:
    os.exit(1);

client = gs2('account')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

ユーザーIDを指定して引き継ぎ設定の一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items TakeOver[] 引き継ぎ設定のリスト
nextPageToken string リストの続きを取得するためのページトークン

createTakeOver

createTakeOver

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.CreateNamespaceResult> asyncResult = null;
yield return client.createTakeOver(
    new 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

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

try:
    result = client.create_take_over(
        new 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:
    os.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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

引き継ぎ設定を新規作成

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
type int ~ 1024 スロット番号
userIdentifier string ~ 1024文字 引き継ぎ用ユーザーID
password string ~ 128文字 パスワード

Result

説明
item TakeOver 作成した引き継ぎ設定

createTakeOverByUserId

createTakeOverByUserId

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"),
    }
)
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')
    );
    $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")
    );
    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.CreateNamespaceResult> asyncResult = null;
yield return client.createTakeOverByUserId(
    new CreateTakeOverByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("$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.createTakeOverByUserId(
        new Gs2Account.CreateTakeOverByUserIdRequest()
            .withNamespaceName('namespace1')
            .withUserId('$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

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

try:
    result = client.create_take_over_by_user_id(
        new 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')
    )
    item = result.item
except core.Gs2Exception as e:
    os.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',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ユーザーIDを指定して引き継ぎ設定を新規作成

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
type int ~ 1024 スロット番号
userIdentifier string ~ 1024文字 引き継ぎ用ユーザーID
password string ~ 128文字 パスワード

Result

説明
item TakeOver 作成した引き継ぎ設定

getTakeOver

getTakeOver

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.CreateNamespaceResult> asyncResult = null;
yield return client.getTakeOver(
    new 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

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

try:
    result = client.get_take_over(
        new 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:
    os.exit(1);

client = gs2('account')

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

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

引き継ぎ設定を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
type int ~ 1024 スロット番号

Result

説明
item TakeOver 引き継ぎ設定

getTakeOverByUserId

getTakeOverByUserId

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),
    }
)
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)
    );
    $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)
    );
    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.CreateNamespaceResult> asyncResult = null;
yield return client.getTakeOverByUserId(
    new GetTakeOverByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("$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.getTakeOverByUserId(
        new Gs2Account.GetTakeOverByUserIdRequest()
            .withNamespaceName('namespace1')
            .withUserId('$account1.userId')
            .withType(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

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

try:
    result = client.get_take_over_by_user_id(
        new account.GetTakeOverByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id(self.account1.user_id)
            .with_type(0)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('account')

api_result = client.get_take_over_by_user_id({
    namespaceName='namespace1',
    userId='$account1.userId',
    type=0,
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ユーザーIDを指定して引き継ぎ設定を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
type int ~ 1024 スロット番号

Result

説明
item TakeOver 引き継ぎ設定

updateTakeOver

updateTakeOver

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.CreateNamespaceResult> asyncResult = null;
yield return client.updateTakeOver(
    new 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

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

try:
    result = client.update_take_over(
        new 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:
    os.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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

引き継ぎ設定を更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
type int ~ 1024 スロット番号
oldPassword string ~ 128文字 古いパスワード
password string ~ 128文字 パスワード

Result

説明
item TakeOver 引き継ぎ設定

updateTakeOverByUserId

updateTakeOverByUserId

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"),
    }
)
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')
    );
    $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")
    );
    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.CreateNamespaceResult> asyncResult = null;
yield return client.updateTakeOverByUserId(
    new UpdateTakeOverByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("$account1.userId")
        .withType(0)
        .withOldPassword("password-0001")
        .withPassword("password-0002"),
    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')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

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

try:
    result = client.update_take_over_by_user_id(
        new 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')
    )
    item = result.item
except core.Gs2Exception as e:
    os.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',
});

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

引き継ぎ設定を更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
type int ~ 1024 スロット番号
oldPassword string ~ 128文字 古いパスワード
password string ~ 128文字 パスワード

Result

説明
item TakeOver 引き継ぎ設定

deleteTakeOver

deleteTakeOver

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")
}
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')
    );
} 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")
    );
} 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.CreateNamespaceResult> asyncResult = null;
yield return client.deleteTakeOver(
    new 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;
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')
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

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

try:
    result = client.delete_take_over(
        new account.DeleteTakeOverRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.account1.user_id)
            .with_type(0)
            .with_user_identifier('user-0001@gs2.io')
    )
except core.Gs2Exception as e:
    os.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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result

引き継ぎ設定を削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
type int ~ 1024 スロット番号
userIdentifier string ~ 1024文字 引き継ぎ用ユーザーID

Result

説明

deleteTakeOverByUserIdentifier

deleteTakeOverByUserIdentifier

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")
}
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')
    );
} 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")
    );
} 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.CreateNamespaceResult> asyncResult = null;
yield return client.deleteTakeOverByUserIdentifier(
    new DeleteTakeOverByUserIdentifierRequest()
        .withNamespaceName("namespace1")
        .withType(0)
        .withUserIdentifier("user-0001@gs2.io"),
    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.deleteTakeOverByUserIdentifier(
        new Gs2Account.DeleteTakeOverByUserIdentifierRequest()
            .withNamespaceName('namespace1')
            .withType(0)
            .withUserIdentifier('user-0001@gs2.io')
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import account

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

try:
    result = client.delete_take_over_by_user_identifier(
        new account.DeleteTakeOverByUserIdentifierRequest()
            .with_namespace_name(self.hash1)
            .with_type(0)
            .with_user_identifier('user-0001@gs2.io')
    )
except core.Gs2Exception as e:
    os.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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result

引き継ぎ設定を削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
type int ~ 1024 スロット番号
userIdentifier string ~ 1024文字 引き継ぎ用ユーザーID

Result

説明

doTakeOver

doTakeOver

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.CreateNamespaceResult> asyncResult = null;
yield return client.doTakeOver(
    new 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

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

try:
    result = client.do_take_over(
        new 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:
    os.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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

引き継ぎ設定を更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
type int ~ 1024 スロット番号
userIdentifier string ~ 1024文字 引き継ぎ用ユーザーID
password string ~ 128文字 パスワード

Result

説明
item Account ゲームプレイヤーアカウント