GS2-Chat SDK API リファレンス
モデル
Namespace
ネームスペース
ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。
GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceId | string | ✓ | ~ 1024文字 | ネームスペースGRN | ||
| name | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| description | string | ~ 1024文字 | 説明文 | |||
| transactionSetting | TransactionSetting | トランザクション設定 | ||||
| allowCreateRoom | bool | ✓ | true | ゲームプレイヤーによるルームの作成を許可するか | ||
| messageLifeTimeDays | int | ✓ | 1 | 1 ~ 30 | メッセージ保持期間 | |
| postMessageScript | ScriptSetting | メッセージを投稿したときに実行するスクリプト | ||||
| createRoomScript | ScriptSetting | ルームを作成したときに実行するスクリプト | ||||
| deleteRoomScript | ScriptSetting | ルームを削除したときに実行するスクリプト | ||||
| subscribeRoomScript | ScriptSetting | ルームを購読したときに実行するスクリプト | ||||
| unsubscribeRoomScript | ScriptSetting | ルームの購読を解除したときに実行するスクリプト | ||||
| postNotification | NotificationSetting | ✓ | 購読しているルームに新しい投稿がきたときのプッシュ通知 | |||
| logSetting | LogSetting | ログの出力設定 | ||||
| createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
| updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | リビジョン | 
関連するメソッド
describeNamespaces createNamespace getNamespace updateNamespace deleteNamespace
Room
ルーム
ルームはチャットのメッセージを届けられる範囲を表しています。
GS2-Chat のルームには参加という概念はありません。
そのため、メッセージを受信するのにルームの名前さえ知っていれば、ルームに参加する必要ありません。
ルームのメッセージを閲覧できるゲームプレイヤーを限定したい場合は2つの方法があります。
1つ目はルームにパスワードを設定することです。
2つ目はルームに設定可能なホワイトリストでゲームプレイヤーのユーザーIDを設定することで限定ができます。
パスワードを設定した場合、パスワードを知らなければゲームの管理者でもメッセージの取得が出来なくなることに注意してください。
これは日本国憲法で定められた通信の秘密に該当する可能性があるためです。
ルームを購読すると、ルームに対して新しいメッセージが送信された際に GS2-Gateway のプッシュ通知を受けることが可能です。
この通知機能を利用することで、ルームに対してポーリングすることなく新しいメッセージの有無を知ることが可能となります。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| roomId | string | ✓ | ~ 1024文字 | ルームGRN | ||
| name | string | ✓ | UUID | ~ 128文字 | ルーム名 | |
| userId | string | ~ 128文字 | オーナーユーザーID | |||
| metadata | string | ~ 1024文字 | メタデータ | |||
| password | string | ~ 128文字 | ルームにアクセスするために必要となるパスワード | |||
| whiteListUserIds | List<string> | 0 ~ 1000 items | ルームにアクセス可能なユーザIDリスト | |||
| createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
| updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | リビジョン | 
関連するメソッド
describeRooms createRoom createRoomFromBackend getRoom updateRoom updateRoomFromBackend deleteRoom deleteRoomFromBackend
Message
メッセージ
メッセージはルームに投稿されたデータです。
カテゴリというフィールドを持ちますので、メッセージの分類が可能です。
たとえば、カテゴリが 0 の場合は通常のテキストメッセージとして解釈し、
1 の場合はスタンプ(ステッカー)として処理するようにクライアントを実行することができます。
投稿されたメッセージは投稿後ネームスペースで定められた時間が経過すると自動的に削除されます。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| messageId | string | ✓ | ~ 1024文字 | メッセージGRN | ||
| roomName | string | ✓ | UUID | ~ 128文字 | ルーム名 | |
| name | string | ✓ | UUID | ~ 36文字 | メッセージ名 | |
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| category | int | ✓ | 0 | 0 ~ 2147483645 | メッセージの種類を分類したい時の種類番号 | |
| metadata | string | ✓ | ~ 1024文字 | メタデータ | ||
| createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | リビジョン | 
関連するメソッド
describeMessages describeMessagesByUserId describeLatestMessages describeLatestMessagesByUserId post postByUserId getMessage getMessageByUserId deleteMessage
Subscribe
購読
ルームを購読することで、そのルームに対する新着メッセージの存在を即座に知ることが出来るようになります。
購読する際にはメッセージのカテゴリを指定できます。
この機能をうまく利用すれば重要度の高いメッセージのみ受信するような設定も可能です。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| subscribeId | string | ✓ | ~ 1024文字 | 購読GRN | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| roomName | string | ✓ | ~ 128文字 | 購読するルーム名 | ||
| notificationTypes | List<NotificationType> | 0 ~ 100 items | 新着メッセージ通知を受け取るカテゴリリスト | |||
| createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | リビジョン | 
関連するメソッド
describeSubscribes describeSubscribesByUserId describeSubscribesByRoomName subscribe subscribeByUserId getSubscribe getSubscribeByUserId updateNotificationType updateNotificationTypeByUserId unsubscribe unsubscribeByUserId
CategoryModel
カテゴリーモデル
カテゴリーモデルとはルームに投稿するカテゴリーに関する設定です。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| categoryModelId | string | ✓ | ~ 1024文字 | カテゴリーモデルGRN | ||||||||
| category | int | ✓ | 0 ~ 2147483645 | カテゴリー | ||||||||
| rejectAccessTokenPost | 文字列列挙型 enum { “Enabled”, “Disabled” } | ~ 128文字 | アクセストークンを利用した投稿を拒否する 
 | 
関連するメソッド
CategoryModelMaster
カテゴリーモデル
カテゴリーモデルとはルームに投稿するカテゴリーに関する設定です。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| categoryModelId | string | ✓ | ~ 1024文字 | カテゴリーモデルマスターGRN | ||||||||
| category | int | ✓ | 0 ~ 2147483645 | カテゴリー | ||||||||
| description | string | ~ 1024文字 | 説明文 | |||||||||
| rejectAccessTokenPost | 文字列列挙型 enum { “Enabled”, “Disabled” } | ~ 128文字 | アクセストークンを利用した投稿を拒否する 
 | |||||||||
| createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||||||||
| updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||||||||
| revision | long | 0 | 0 ~ 9223372036854775805 | リビジョン | 
関連するメソッド
describeCategoryModelMasters createCategoryModelMaster getCategoryModelMaster updateCategoryModelMaster deleteCategoryModelMaster
CurrentModelMaster
現在有効なマスターデータ
GS2ではマスターデータの管理にJSON形式のファイルを使用します。
ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが
よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
Note
JSONファイルの形式については GS2-Chat マスターデータリファレンス をご参照ください。| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceId | string | ✓ | ~ 1024文字 | 現在有効なカテゴリー設定GRN | ||
| settings | string | ✓ | ~ 5242880文字 | マスターデータ | 
関連するメソッド
exportMaster getCurrentModelMaster updateCurrentModelMaster updateCurrentModelMasterFromGitHub
NotificationType
通知タイプ
新着メッセージ通知を受け取るカテゴリの設定
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| category | int | ✓ | 0 | 0 ~ 2147483646 | 新着メッセージ通知を受け取るカテゴリ | |
| enableTransferMobilePushNotification | bool | ✓ | false | オフラインだった時にモバイルプッシュ通知に転送するか | 
関連するモデル
ScriptSetting
スクリプト設定
GS2 ではマイクロサービスのイベントに関連づけて、カスタムスクリプトを実行することができます。
このモデルは、スクリプトの実行をトリガーするための設定を保持します。
スクリプトの実行方式は大きく2種類あり、それは「同期実行」と「非同期実行」です。
同期実行は、スクリプトの実行が完了するまで処理がブロックされます。
かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることができます。
一方、非同期実行は、スクリプトの実行が完了するまで処理がブロックされません。
かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることはできません。
しかし、非同期実行は、スクリプトの実行が完了するまで処理がブロックされないため、APIの応答に影響を与えないため、原則非同期実行を使用することをおすすめします。
非同期実行には実行方式が2種類あり、GS2-Script と Amazon EventBridge があります。
Amazon EventBridge を使用することで、Lua 以外の言語で処理を記述することができます。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| triggerScriptId | string | ~ 1024文字 | 同期実行スクリプトの GS2-Script のスクリプトGRN | |||||||||||
| doneTriggerTargetType | 文字列列挙型 enum { “none”, “gs2_script”, “aws” } | ✓ | “none” | ~ 128文字 | 非同期スクリプトの実行方法 
 | |||||||||
| doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024文字 | 非同期実行スクリプトの GS2-Script のスクリプトGRN doneTriggerTargetType が “gs2_script” であれば 有効 | ||||||||||
| doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024文字 | 非同期実行スクリプトを実行する GS2-JobQueue ネームスペース doneTriggerTargetType が “gs2_script” であれば 有効 | 
関連するメソッド
関連するモデル
NotificationSetting
プッシュ通知に関する設定
GS2 のマイクロサービス内で何らかのイベントが発生した際に、プッシュ通知を送信するための設定です。
ここでいうプッシュ通知は GS2-Gateway の提供する WebSocket インターフェースを経由した処理であり、スマートフォンのプッシュ通知とは性質が異なります。
たとえば、マッチメイキングが完了した時やフレンドリクエストが届いた時など、ゲームクライアントの操作とは関係なく状態が変化した際に GS2-Gateway を経由してプッシュ通知をすることで、ゲームクライアントは状態の変化を検知することができます。
GS2-Gateway のプッシュ通知は通知先のデバイスがオフラインだった時に追加の処理としてモバイルプッシュ通知を送信できます。
モバイルプッシュ通知をうまく利用すれば、マッチメイキング中にゲームを終了しても、モバイルプッシュ通知を使用してプレイヤーに通知し、ゲームに戻ってくるフローを実現できる可能性があります。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| gatewayNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:gateway:default” | ~ 1024文字 | プッシュ通知に使用する GS2-Gateway のネームスペース | |||||||
| enableTransferMobileNotification | bool? | false | モバイルプッシュ通知へ転送するか | |||||||||
| sound | string | {enableTransferMobileNotification} == true | ~ 1024文字 | モバイルプッシュ通知で使用するサウンドファイル名 enableTransferMobileNotification が true であれば 有効 | ||||||||
| enable | 文字列列挙型 enum { “Enabled”, “Disabled” } | ✓ | “Enabled” | ~ 128文字 | プッシュ通知を有効にするか 
 | 
関連するメソッド
関連するモデル
LogSetting
ログの書き出し設定
ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用されるログ名前空間の識別子(Namespace ID)を保持します。
ログ名前空間IDは、ログデータを集約し、保存する対象の GS2-Log の名前空間を指定します。
この設定を通じて、この名前空間以下のAPIリクエスト・レスポンスログデータが対象の GS2-Log へ出力されるようになります。
GS2-Log にはリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| loggingNamespaceId | string | ✓ | ~ 1024文字 | ログを出力する GS2-Log のネームスペースGRN | 
関連するメソッド
関連するモデル
TransactionSetting
トランザクション設定
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| enableAutoRun | bool | ✓ | false | 発行したトランザクションをサーバーサイドで自動的に実行するか | ||
| enableAtomicCommit | bool | {enableAutoRun} == true | ✓ | false | トランザクションの実行をアトミックにコミットするか enableAutoRun が true であれば 必須 | |
| transactionUseDistributor | bool | {enableAtomicCommit} == true | ✓ | false | トランザクションを非同期処理で実行する enableAtomicCommit が true であれば 必須 | |
| commitScriptResultInUseDistributor | bool | {transactionUseDistributor} == true | ✓ | false | スクリプトの結果コミット処理を非同期処理で実行するか transactionUseDistributor が true であれば 必須 | |
| acquireActionUseJobQueue | bool | {enableAtomicCommit} == true | ✓ | false | 入手アクションを実行する際に GS2-JobQueue を使用するか enableAtomicCommit が true であれば 必須 | |
| distributorNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024文字 | トランザクションの実行に使用する GS2-Distributor ネームスペース | |
| queueNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024文字 | トランザクションの実行に使用する GS2-JobQueue のネームスペース | 
関連するメソッド
関連するモデル
GitHubCheckoutSetting
GitHubからマスターデータをチェックアウトする設定
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| apiKeyId | string | ✓ | ~ 1024文字 | GitHub のAPIキーGRN | ||||||||||
| repositoryName | string | ✓ | ~ 1024文字 | リポジトリ名 | ||||||||||
| sourcePath | string | ✓ | ~ 1024文字 | ソースコードのファイルパス | ||||||||||
| referenceType | 文字列列挙型 enum { “commit_hash”, “branch”, “tag” } | ✓ | ~ 128文字 | コードの取得元 
 | ||||||||||
| commitHash | string | {referenceType} == “commit_hash” | ✓ | ~ 1024文字 | コミットハッシュ referenceType が “commit_hash” であれば 必須 | |||||||||
| branchName | string | {referenceType} == “branch” | ✓ | ~ 1024文字 | ブランチ名 referenceType が “branch” であれば 必須 | |||||||||
| tagName | string | {referenceType} == “tag” | ✓ | ~ 1024文字 | タグ名 referenceType が “tag” であれば 必須 | 
関連するメソッド
メソッド
describeNamespaces
ネームスペースの一覧を取得
プロジェクト内のすべてのネームスペースの一覧を取得します。
オプションのページトークンを使用して、リストの特定の位置からデータの取得を開始できます。
また、取得するネームスペースの数を制限することも可能です。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namePrefix | string | ~ 64文字 | ネームスペース名のフィルター接頭辞 | |||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<Namespace> | ネームスペースのリスト | 
| nextPageToken | string | リストの続きを取得するためのページトークン | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &chat.DescribeNamespacesRequest {
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\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())
            ->withNamePrefix(null)
            ->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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DescribeNamespacesRequest;
import io.gs2.chat.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DescribeNamespacesResult result = client.describeNamespaces(
        new DescribeNamespacesRequest()
            .withNamePrefix(null)
            .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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DescribeNamespacesRequest;
using Gs2.Gs2Chat.Result.DescribeNamespacesResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Chat.Request.DescribeNamespacesRequest()
        .WithNamePrefix(null)
        .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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.describeNamespaces(
        new Gs2Chat.DescribeNamespacesRequest()
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.describe_namespaces(
        chat.DescribeNamespacesRequest()
            .with_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.describe_namespaces({
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('chat')
api_result_handler = client.describe_namespaces_async({
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createNamespace
ネームスペースを新規作成
ネームスペースの名前、説明、および各種設定を含む詳細情報を指定する必要があります。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| description | string | ~ 1024文字 | 説明文 | |||
| transactionSetting | TransactionSetting | トランザクション設定 | ||||
| allowCreateRoom | bool | ✓ | true | ゲームプレイヤーによるルームの作成を許可するか | ||
| messageLifeTimeDays | int | ✓ | 1 | 1 ~ 30 | メッセージ保持期間 | |
| postMessageScript | ScriptSetting | メッセージを投稿したときに実行するスクリプト | ||||
| createRoomScript | ScriptSetting | ルームを作成したときに実行するスクリプト | ||||
| deleteRoomScript | ScriptSetting | ルームを削除したときに実行するスクリプト | ||||
| subscribeRoomScript | ScriptSetting | ルームを購読したときに実行するスクリプト | ||||
| unsubscribeRoomScript | ScriptSetting | ルームの購読を解除したときに実行するスクリプト | ||||
| postNotification | NotificationSetting | ✓ | 購読しているルームに新しい投稿がきたときのプッシュ通知 | |||
| logSetting | LogSetting | ログの出力設定 | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Namespace | 作成したネームスペース | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &chat.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSetting: nil,
        AllowCreateRoom: nil,
        MessageLifeTimeDays: nil,
        PostMessageScript: nil,
        CreateRoomScript: nil,
        DeleteRoomScript: nil,
        SubscribeRoomScript: nil,
        UnsubscribeRoomScript: nil,
        PostNotification: nil,
        LogSetting: &chat.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\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("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withAllowCreateRoom(null)
            ->withMessageLifeTimeDays(null)
            ->withPostMessageScript(null)
            ->withCreateRoomScript(null)
            ->withDeleteRoomScript(null)
            ->withSubscribeRoomScript(null)
            ->withUnsubscribeRoomScript(null)
            ->withPostNotification(null)
            ->withLogSetting((new \Gs2\Chat\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.CreateNamespaceRequest;
import io.gs2.chat.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withAllowCreateRoom(null)
            .withMessageLifeTimeDays(null)
            .withPostMessageScript(null)
            .withCreateRoomScript(null)
            .withDeleteRoomScript(null)
            .withSubscribeRoomScript(null)
            .withUnsubscribeRoomScript(null)
            .withPostNotification(null)
            .withLogSetting(new io.gs2.chat.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.CreateNamespaceRequest;
using Gs2.Gs2Chat.Result.CreateNamespaceResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Chat.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithAllowCreateRoom(null)
        .WithMessageLifeTimeDays(null)
        .WithPostMessageScript(null)
        .WithCreateRoomScript(null)
        .WithDeleteRoomScript(null)
        .WithSubscribeRoomScript(null)
        .WithUnsubscribeRoomScript(null)
        .WithPostNotification(null)
        .WithLogSetting(new Gs2.Gs2Chat.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.createNamespace(
        new Gs2Chat.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withAllowCreateRoom(null)
            .withMessageLifeTimeDays(null)
            .withPostMessageScript(null)
            .withCreateRoomScript(null)
            .withDeleteRoomScript(null)
            .withSubscribeRoomScript(null)
            .withUnsubscribeRoomScript(null)
            .withPostNotification(null)
            .withLogSetting(new Gs2Chat.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.create_namespace(
        chat.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting(None)
            .with_allow_create_room(None)
            .with_message_life_time_days(None)
            .with_post_message_script(None)
            .with_create_room_script(None)
            .with_delete_room_script(None)
            .with_subscribe_room_script(None)
            .with_unsubscribe_room_script(None)
            .with_post_notification(None)
            .with_log_setting(
                chat.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    allowCreateRoom=nil,
    messageLifeTimeDays=nil,
    postMessageScript=nil,
    createRoomScript=nil,
    deleteRoomScript=nil,
    subscribeRoomScript=nil,
    unsubscribeRoomScript=nil,
    postNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    allowCreateRoom=nil,
    messageLifeTimeDays=nil,
    postMessageScript=nil,
    createRoomScript=nil,
    deleteRoomScript=nil,
    subscribeRoomScript=nil,
    unsubscribeRoomScript=nil,
    postNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;getNamespaceStatus
ネームスペースの状態を取得
指定されたネームスペースの現在の状態を取得します。
これには、ネームスペースがアクティブか、保留中か、またはその他の状態にあるかが含まれます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | 
Result
| 型 | 説明 | |
|---|---|---|
| status | string | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &chat.GetNamespaceStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Statususe Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\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("namespace-0001")
    );
    $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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.GetNamespaceStatusRequest;
import io.gs2.chat.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    GetNamespaceStatusResult result = client.getNamespaceStatus(
        new GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Chat.Result.GetNamespaceStatusResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Chat.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace-0001"),
    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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.getNamespaceStatus(
        new Gs2Chat.GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.get_namespace_status(
        chat.GetNamespaceStatusRequest()
            .with_namespace_name('namespace-0001')
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.get_namespace_status({
    namespaceName="namespace-0001",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;client = gs2('chat')
api_result_handler = client.get_namespace_status_async({
    namespaceName="namespace-0001",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;getNamespace
ネームスペースを取得
指定されたネームスペースの詳細情報を取得します。
これには、ネームスペースの名前、説明、およびその他の設定情報が含まれます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Namespace | ネームスペース | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &chat.GetNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\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("namespace-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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.GetNamespaceRequest;
import io.gs2.chat.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    GetNamespaceResult result = client.getNamespace(
        new GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.GetNamespaceRequest;
using Gs2.Gs2Chat.Result.GetNamespaceResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Chat.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace-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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.getNamespace(
        new Gs2Chat.GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.get_namespace(
        chat.GetNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.get_namespace({
    namespaceName="namespace-0001",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.get_namespace_async({
    namespaceName="namespace-0001",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;updateNamespace
ネームスペースを更新
指定されたネームスペースの設定を更新します。
ネームスペースの説明や、特定の設定を変更することができます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| description | string | ~ 1024文字 | 説明文 | |||
| transactionSetting | TransactionSetting | トランザクション設定 | ||||
| allowCreateRoom | bool | ✓ | true | ゲームプレイヤーによるルームの作成を許可するか | ||
| messageLifeTimeDays | int | ✓ | 1 | 1 ~ 30 | メッセージ保持期間 | |
| postMessageScript | ScriptSetting | メッセージを投稿したときに実行するスクリプト | ||||
| createRoomScript | ScriptSetting | ルームを作成したときに実行するスクリプト | ||||
| deleteRoomScript | ScriptSetting | ルームを削除したときに実行するスクリプト | ||||
| subscribeRoomScript | ScriptSetting | ルームを購読したときに実行するスクリプト | ||||
| unsubscribeRoomScript | ScriptSetting | ルームの購読を解除したときに実行するスクリプト | ||||
| postNotification | NotificationSetting | ✓ | 購読しているルームに新しい投稿がきたときのプッシュ通知 | |||
| logSetting | LogSetting | ログの出力設定 | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Namespace | 更新したネームスペース | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &chat.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        AllowCreateRoom: pointy.Bool(false),
        MessageLifeTimeDays: nil,
        PostMessageScript: nil,
        CreateRoomScript: nil,
        DeleteRoomScript: nil,
        SubscribeRoomScript: nil,
        UnsubscribeRoomScript: nil,
        PostNotification: nil,
        LogSetting: &chat.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\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("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withAllowCreateRoom(False)
            ->withMessageLifeTimeDays(null)
            ->withPostMessageScript(null)
            ->withCreateRoomScript(null)
            ->withDeleteRoomScript(null)
            ->withSubscribeRoomScript(null)
            ->withUnsubscribeRoomScript(null)
            ->withPostNotification(null)
            ->withLogSetting((new \Gs2\Chat\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.UpdateNamespaceRequest;
import io.gs2.chat.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withAllowCreateRoom(false)
            .withMessageLifeTimeDays(null)
            .withPostMessageScript(null)
            .withCreateRoomScript(null)
            .withDeleteRoomScript(null)
            .withSubscribeRoomScript(null)
            .withUnsubscribeRoomScript(null)
            .withPostNotification(null)
            .withLogSetting(new io.gs2.chat.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.UpdateNamespaceRequest;
using Gs2.Gs2Chat.Result.UpdateNamespaceResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Chat.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithAllowCreateRoom(false)
        .WithMessageLifeTimeDays(null)
        .WithPostMessageScript(null)
        .WithCreateRoomScript(null)
        .WithDeleteRoomScript(null)
        .WithSubscribeRoomScript(null)
        .WithUnsubscribeRoomScript(null)
        .WithPostNotification(null)
        .WithLogSetting(new Gs2.Gs2Chat.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.updateNamespace(
        new Gs2Chat.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withAllowCreateRoom(false)
            .withMessageLifeTimeDays(null)
            .withPostMessageScript(null)
            .withCreateRoomScript(null)
            .withDeleteRoomScript(null)
            .withSubscribeRoomScript(null)
            .withUnsubscribeRoomScript(null)
            .withPostNotification(null)
            .withLogSetting(new Gs2Chat.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.update_namespace(
        chat.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(None)
            .with_allow_create_room(False)
            .with_message_life_time_days(None)
            .with_post_message_script(None)
            .with_create_room_script(None)
            .with_delete_room_script(None)
            .with_subscribe_room_script(None)
            .with_unsubscribe_room_script(None)
            .with_post_notification(None)
            .with_log_setting(
                chat.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    allowCreateRoom=false,
    messageLifeTimeDays=nil,
    postMessageScript=nil,
    createRoomScript=nil,
    deleteRoomScript=nil,
    subscribeRoomScript=nil,
    unsubscribeRoomScript=nil,
    postNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    allowCreateRoom=false,
    messageLifeTimeDays=nil,
    postMessageScript=nil,
    createRoomScript=nil,
    deleteRoomScript=nil,
    subscribeRoomScript=nil,
    unsubscribeRoomScript=nil,
    postNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
    },
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;deleteNamespace
ネームスペースを削除
指定されたネームスペースを削除します。
この操作は不可逆であり、削除されたネームスペースに関連するすべてのデータは回復不能になります。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Namespace | 削除したネームスペース | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &chat.DeleteNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\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("namespace-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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DeleteNamespaceRequest;
import io.gs2.chat.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DeleteNamespaceResult result = client.deleteNamespace(
        new DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DeleteNamespaceRequest;
using Gs2.Gs2Chat.Result.DeleteNamespaceResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Chat.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace-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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.deleteNamespace(
        new Gs2Chat.DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.delete_namespace(
        chat.DeleteNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.delete_namespace({
    namespaceName="namespace-0001",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.delete_namespace_async({
    namespaceName="namespace-0001",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;getServiceVersion
マイクロサービスのバージョンを取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | 
|---|
Result
| 型 | 説明 | |
|---|---|---|
| item | string | バージョン | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.GetServiceVersion(
    &chat.GetServiceVersionRequest {
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\GetServiceVersionRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->getServiceVersion(
        (new GetServiceVersionRequest())
    );
    $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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.GetServiceVersionRequest;
import io.gs2.chat.result.GetServiceVersionResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    GetServiceVersionResult result = client.getServiceVersion(
        new GetServiceVersionRequest()
    );
    String 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.GetServiceVersionRequest;
using Gs2.Gs2Chat.Result.GetServiceVersionResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
    new Gs2.Gs2Chat.Request.GetServiceVersionRequest(),
    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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.getServiceVersion(
        new Gs2Chat.GetServiceVersionRequest()
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.get_service_version(
        chat.GetServiceVersionRequest()
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.get_service_version({
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.get_service_version_async({
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;dumpUserDataByUserId
指定したユーザーIDに紐づくデータのダンプを取得
個人情報保護の法的要件を満たすために使用したり、データのバックアップや移行に使用できます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | 
|---|
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &chat.DumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DumpUserDataByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->dumpUserDataByUserId(
        (new DumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DumpUserDataByUserIdRequest;
import io.gs2.chat.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
        new DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Chat.Result.DumpUserDataByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Chat.Request.DumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.dumpUserDataByUserId(
        new Gs2Chat.DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.dump_user_data_by_user_id(
        chat.DumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.resultclient = gs2('chat')
api_result_handler = client.dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.resultcheckDumpUserDataByUserId
指定したユーザーIDに紐づくデータのダンプが完了しているか確認
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| url | string | 出力データのURL | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &chat.CheckDumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Urluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\CheckDumpUserDataByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->checkDumpUserDataByUserId(
        (new CheckDumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.chat.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
        new CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Chat.Result.CheckDumpUserDataByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Chat.Request.CheckDumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.checkDumpUserDataByUserId(
        new Gs2Chat.CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.check_dump_user_data_by_user_id(
        chat.CheckDumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.check_dump_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;client = gs2('chat')
api_result_handler = client.check_dump_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;cleanUserDataByUserId
ユーザーデータの完全削除
指定されたユーザーIDに紐づくデータのクリーニングを実行します。
これにより、特定のユーザーデータをプロジェクトから安全に削除できます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | 
|---|
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &chat.CleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\CleanUserDataByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->cleanUserDataByUserId(
        (new CleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.CleanUserDataByUserIdRequest;
import io.gs2.chat.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
        new CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Chat.Result.CleanUserDataByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Chat.Request.CleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.cleanUserDataByUserId(
        new Gs2Chat.CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.clean_user_data_by_user_id(
        chat.CleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.resultclient = gs2('chat')
api_result_handler = client.clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.resultcheckCleanUserDataByUserId
指定したユーザーIDのユーザーデータの完全削除が完了しているか確認
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | 
|---|
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &chat.CheckCleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\CheckCleanUserDataByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->checkCleanUserDataByUserId(
        (new CheckCleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.chat.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
        new CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Chat.Result.CheckCleanUserDataByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Chat.Request.CheckCleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.checkCleanUserDataByUserId(
        new Gs2Chat.CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.check_clean_user_data_by_user_id(
        chat.CheckCleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.check_clean_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.resultclient = gs2('chat')
api_result_handler = client.check_clean_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.resultprepareImportUserDataByUserId
指定したユーザーIDに紐づくデータのインポートを実行
インポートに使用できるデータは GS2 によってエクスポートして取得したデータに限定され、古いデータはインポートに失敗する可能性があります。
エクスポートしたユーザーIDと異なるユーザーIDでインポートすることができますが、ユーザーデータのペイロード内にユーザーIDが含まれる場合はその限りではありません。
このAPIの戻り値で応答されたURLにエクスポートした zip ファイルをアップロードし、importUserDataByUserId を呼び出すことで実際のインポート処理を開始できます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| uploadToken | string | アップロード後に結果を反映する際に使用するトークン | 
| uploadUrl | string | ユーザーデータアップロード処理の実行に使用するURL | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &chat.PrepareImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\PrepareImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->prepareImportUserDataByUserId(
        (new PrepareImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.chat.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
        new PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Chat.Result.PrepareImportUserDataByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Chat.Request.PrepareImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.prepareImportUserDataByUserId(
        new Gs2Chat.PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.prepare_import_user_data_by_user_id(
        chat.PrepareImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.prepare_import_user_data_by_user_id({
    userId="user-0001",
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;client = gs2('chat')
api_result_handler = client.prepare_import_user_data_by_user_id_async({
    userId="user-0001",
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;importUserDataByUserId
指定したユーザーIDに紐づくデータのインポートを実行
インポートに使用できるデータは GS2 によってエクスポートして取得したデータに限定され、古いデータはインポートに失敗する可能性があります。
エクスポートしたユーザーIDと異なるユーザーIDでインポートすることができますが、ユーザーデータのペイロード内にユーザーIDが含まれる場合はその限りではありません。
このAPIを呼び出す前に prepareImportUserDataByUserId を呼び出して、アップロード準備を完了させる必要があります。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| uploadToken | string | ✓ | ~ 1024文字 | アップロード準備で受け取ったトークン | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | 
|---|
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &chat.ImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\ImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->importUserDataByUserId(
        (new ImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.ImportUserDataByUserIdRequest;
import io.gs2.chat.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    ImportUserDataByUserIdResult result = client.importUserDataByUserId(
        new ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Chat.Result.ImportUserDataByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2Chat.Request.ImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.importUserDataByUserId(
        new Gs2Chat.ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.import_user_data_by_user_id(
        chat.ImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.resultclient = gs2('chat')
api_result_handler = client.import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.resultcheckImportUserDataByUserId
指定したユーザーIDに紐づくデータのインポートが完了しているか確認
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| uploadToken | string | ✓ | ~ 1024文字 | アップロード準備で受け取ったトークン | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| url | string | 出力ログのURL | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &chat.CheckImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Urluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\CheckImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->checkImportUserDataByUserId(
        (new CheckImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.CheckImportUserDataByUserIdRequest;
import io.gs2.chat.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
        new CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Chat.Result.CheckImportUserDataByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2Chat.Request.CheckImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.checkImportUserDataByUserId(
        new Gs2Chat.CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.check_import_user_data_by_user_id(
        chat.CheckImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.check_import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;client = gs2('chat')
api_result_handler = client.check_import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;describeRooms
ルームの一覧取得
ページトークンと取得件数の制限を指定して、ルームのリストを取得できます。
これにより、存在するルームの概要を確認することができます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| namePrefix | string | ~ 64文字 | ルーム名のフィルター接頭辞 | |||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<Room> | ルームのリスト | 
| nextPageToken | string | リストの続きを取得するためのページトークン | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DescribeRooms(
    &chat.DescribeRoomsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DescribeRoomsRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->describeRooms(
        (new DescribeRoomsRequest())
            ->withNamespaceName("namespace-0001")
            ->withNamePrefix(null)
            ->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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DescribeRoomsRequest;
import io.gs2.chat.result.DescribeRoomsResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DescribeRoomsResult result = client.describeRooms(
        new DescribeRoomsRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<Room> 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DescribeRoomsRequest;
using Gs2.Gs2Chat.Result.DescribeRoomsResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DescribeRoomsResult> asyncResult = null;
yield return client.DescribeRooms(
    new Gs2.Gs2Chat.Request.DescribeRoomsRequest()
        .WithNamespaceName("namespace-0001")
        .WithNamePrefix(null)
        .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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.describeRooms(
        new Gs2Chat.DescribeRoomsRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.describe_rooms(
        chat.DescribeRoomsRequest()
            .with_namespace_name('namespace-0001')
            .with_name_prefix(None)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.describe_rooms({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('chat')
api_result_handler = client.describe_rooms_async({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createRoom
ルームを作成
ルーム名、ユーザーID、メタデータ、パスワード、ホワイトリストに登録されるユーザーIDを指定して、ルームを作成することができます。
ルーム名は省略可能で、省略した場合は UUID が自動的に採番されます。
新しいコミュニケーション空間を設けるために使用されます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| accessToken | string | ~ 128文字 | アクセストークン | |||
| name | string | UUID | ~ 128文字 | ルーム名 | ||
| metadata | string | ~ 1024文字 | メタデータ | |||
| password | string | ~ 128文字 | ルームにアクセスするために必要となるパスワード | |||
| whiteListUserIds | List<string> | [] | 0 ~ 1000 items | ルームにアクセス可能なユーザIDリスト | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Room | 作成したルーム | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.CreateRoom(
    &chat.CreateRoomRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Name: pointy.String("room-0001"),
        Metadata: nil,
        Password: nil,
        WhiteListUserIds: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\CreateRoomRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->createRoom(
        (new CreateRoomRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withName("room-0001")
            ->withMetadata(null)
            ->withPassword(null)
            ->withWhiteListUserIds(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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.CreateRoomRequest;
import io.gs2.chat.result.CreateRoomResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    CreateRoomResult result = client.createRoom(
        new CreateRoomRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withName("room-0001")
            .withMetadata(null)
            .withPassword(null)
            .withWhiteListUserIds(null)
    );
    Room 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.CreateRoomRequest;
using Gs2.Gs2Chat.Result.CreateRoomResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.CreateRoomResult> asyncResult = null;
yield return client.CreateRoom(
    new Gs2.Gs2Chat.Request.CreateRoomRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithName("room-0001")
        .WithMetadata(null)
        .WithPassword(null)
        .WithWhiteListUserIds(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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.createRoom(
        new Gs2Chat.CreateRoomRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withName("room-0001")
            .withMetadata(null)
            .withPassword(null)
            .withWhiteListUserIds(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.create_room(
        chat.CreateRoomRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_name('room-0001')
            .with_metadata(None)
            .with_password(None)
            .with_white_list_user_ids(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.create_room({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    name="room-0001",
    metadata=nil,
    password=nil,
    whiteListUserIds=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.create_room_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    name="room-0001",
    metadata=nil,
    password=nil,
    whiteListUserIds=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;createRoomFromBackend
バックエンドからルームを作成
このAPIはゲームプレイヤーから呼び出されるわけではなく、システム関連系でルームを作成する際に使用します。
ルーム名、ユーザーID、メタデータ、パスワード、ホワイトリストに登録されるユーザーIDを指定して、ルームを作成することができます。
ルーム名は省略可能で、省略した場合は UUID が自動的に採番されます。
新しいコミュニケーション空間を設けるために使用されます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| name | string | UUID | ~ 128文字 | ルーム名 | ||
| userId | string | ~ 128文字 | オーナーユーザーID | |||
| metadata | string | ~ 1024文字 | メタデータ | |||
| password | string | ~ 128文字 | ルームにアクセスするために必要となるパスワード | |||
| whiteListUserIds | List<string> | [] | 0 ~ 1000 items | ルームにアクセス可能なユーザIDリスト | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Room | 作成したルーム | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.CreateRoomFromBackend(
    &chat.CreateRoomFromBackendRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("room-0001"),
        UserId: nil,
        Metadata: nil,
        Password: nil,
        WhiteListUserIds: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\CreateRoomFromBackendRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->createRoomFromBackend(
        (new CreateRoomFromBackendRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("room-0001")
            ->withUserId(null)
            ->withMetadata(null)
            ->withPassword(null)
            ->withWhiteListUserIds(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.CreateRoomFromBackendRequest;
import io.gs2.chat.result.CreateRoomFromBackendResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    CreateRoomFromBackendResult result = client.createRoomFromBackend(
        new CreateRoomFromBackendRequest()
            .withNamespaceName("namespace-0001")
            .withName("room-0001")
            .withUserId(null)
            .withMetadata(null)
            .withPassword(null)
            .withWhiteListUserIds(null)
            .withTimeOffsetToken(null)
    );
    Room 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.CreateRoomFromBackendRequest;
using Gs2.Gs2Chat.Result.CreateRoomFromBackendResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.CreateRoomFromBackendResult> asyncResult = null;
yield return client.CreateRoomFromBackend(
    new Gs2.Gs2Chat.Request.CreateRoomFromBackendRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("room-0001")
        .WithUserId(null)
        .WithMetadata(null)
        .WithPassword(null)
        .WithWhiteListUserIds(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.createRoomFromBackend(
        new Gs2Chat.CreateRoomFromBackendRequest()
            .withNamespaceName("namespace-0001")
            .withName("room-0001")
            .withUserId(null)
            .withMetadata(null)
            .withPassword(null)
            .withWhiteListUserIds(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.create_room_from_backend(
        chat.CreateRoomFromBackendRequest()
            .with_namespace_name('namespace-0001')
            .with_name('room-0001')
            .with_user_id(None)
            .with_metadata(None)
            .with_password(None)
            .with_white_list_user_ids(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.create_room_from_backend({
    namespaceName="namespace-0001",
    name="room-0001",
    userId=nil,
    metadata=nil,
    password=nil,
    whiteListUserIds=nil,
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.create_room_from_backend_async({
    namespaceName="namespace-0001",
    name="room-0001",
    userId=nil,
    metadata=nil,
    password=nil,
    whiteListUserIds=nil,
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;getRoom
ルームの情報を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | UUID | ~ 128文字 | ルーム名 | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Room | ルーム | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.GetRoom(
    &chat.GetRoomRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\GetRoomRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->getRoom(
        (new GetRoomRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.GetRoomRequest;
import io.gs2.chat.result.GetRoomResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    GetRoomResult result = client.getRoom(
        new GetRoomRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
    );
    Room 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.GetRoomRequest;
using Gs2.Gs2Chat.Result.GetRoomResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.GetRoomResult> asyncResult = null;
yield return client.GetRoom(
    new Gs2.Gs2Chat.Request.GetRoomRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.getRoom(
        new Gs2Chat.GetRoomRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.get_room(
        chat.GetRoomRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.get_room({
    namespaceName="namespace-0001",
    roomName="room-0001",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.get_room_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;updateRoom
ルームを更新
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | UUID | ~ 128文字 | ルーム名 | |
| metadata | string | ~ 1024文字 | メタデータ | |||
| password | string | ~ 128文字 | ルームにアクセスするために必要となるパスワード | |||
| whiteListUserIds | List<string> | [] | 0 ~ 1000 items | ルームにアクセス可能なユーザIDリスト | ||
| accessToken | string | ~ 128文字 | アクセストークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Room | 更新したルーム | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.UpdateRoom(
    &chat.UpdateRoomRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        Metadata: nil,
        Password: pointy.String("password-0002"),
        WhiteListUserIds: []*string{
            pointy.String("user-0001"),
            pointy.String("user-0002"),
            pointy.String("user-0003"),
        },
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\UpdateRoomRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->updateRoom(
        (new UpdateRoomRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withMetadata(null)
            ->withPassword("password-0002")
            ->withWhiteListUserIds([
                "user-0001",
                "user-0002",
                "user-0003",
            ])
            ->withAccessToken("accessToken-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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.UpdateRoomRequest;
import io.gs2.chat.result.UpdateRoomResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    UpdateRoomResult result = client.updateRoom(
        new UpdateRoomRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withMetadata(null)
            .withPassword("password-0002")
            .withWhiteListUserIds(Arrays.asList(
                "user-0001",
                "user-0002",
                "user-0003"
            ))
            .withAccessToken("accessToken-0001")
    );
    Room 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.UpdateRoomRequest;
using Gs2.Gs2Chat.Result.UpdateRoomResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.UpdateRoomResult> asyncResult = null;
yield return client.UpdateRoom(
    new Gs2.Gs2Chat.Request.UpdateRoomRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithMetadata(null)
        .WithPassword("password-0002")
        .WithWhiteListUserIds(new string[] {
            "user-0001",
            "user-0002",
            "user-0003",
        })
        .WithAccessToken("accessToken-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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.updateRoom(
        new Gs2Chat.UpdateRoomRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withMetadata(null)
            .withPassword("password-0002")
            .withWhiteListUserIds([
                "user-0001",
                "user-0002",
                "user-0003",
            ])
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.update_room(
        chat.UpdateRoomRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_metadata(None)
            .with_password('password-0002')
            .with_white_list_user_ids([
                'user-0001',
                'user-0002',
                'user-0003',
            ])
            .with_access_token('accessToken-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.update_room({
    namespaceName="namespace-0001",
    roomName="room-0001",
    metadata=nil,
    password="password-0002",
    whiteListUserIds={
        "user-0001",
        "user-0002",
        "user-0003"
    },
    accessToken="accessToken-0001",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.update_room_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    metadata=nil,
    password="password-0002",
    whiteListUserIds={
        "user-0001",
        "user-0002",
        "user-0003"
    },
    accessToken="accessToken-0001",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;updateRoomFromBackend
バックエンドからルームを更新
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | UUID | ~ 128文字 | ルーム名 | |
| metadata | string | ~ 1024文字 | メタデータ | |||
| password | string | ~ 128文字 | ルームにアクセスするために必要となるパスワード | |||
| whiteListUserIds | List<string> | [] | 0 ~ 1000 items | ルームにアクセス可能なユーザIDリスト | ||
| userId | string | ~ 128文字 | オーナーユーザーID | |||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Room | 更新したルーム | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.UpdateRoomFromBackend(
    &chat.UpdateRoomFromBackendRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        Metadata: pointy.String("ROOM_0001"),
        Password: pointy.String("password-0003"),
        WhiteListUserIds: []*string{
            pointy.String("user-0001"),
            pointy.String("user-0002"),
            pointy.String("user-0003"),
        },
        UserId: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\UpdateRoomFromBackendRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->updateRoomFromBackend(
        (new UpdateRoomFromBackendRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withMetadata("ROOM_0001")
            ->withPassword("password-0003")
            ->withWhiteListUserIds([
                "user-0001",
                "user-0002",
                "user-0003",
            ])
            ->withUserId(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.UpdateRoomFromBackendRequest;
import io.gs2.chat.result.UpdateRoomFromBackendResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    UpdateRoomFromBackendResult result = client.updateRoomFromBackend(
        new UpdateRoomFromBackendRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withMetadata("ROOM_0001")
            .withPassword("password-0003")
            .withWhiteListUserIds(Arrays.asList(
                "user-0001",
                "user-0002",
                "user-0003"
            ))
            .withUserId(null)
            .withTimeOffsetToken(null)
    );
    Room 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.UpdateRoomFromBackendRequest;
using Gs2.Gs2Chat.Result.UpdateRoomFromBackendResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.UpdateRoomFromBackendResult> asyncResult = null;
yield return client.UpdateRoomFromBackend(
    new Gs2.Gs2Chat.Request.UpdateRoomFromBackendRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithMetadata("ROOM_0001")
        .WithPassword("password-0003")
        .WithWhiteListUserIds(new string[] {
            "user-0001",
            "user-0002",
            "user-0003",
        })
        .WithUserId(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.updateRoomFromBackend(
        new Gs2Chat.UpdateRoomFromBackendRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withMetadata("ROOM_0001")
            .withPassword("password-0003")
            .withWhiteListUserIds([
                "user-0001",
                "user-0002",
                "user-0003",
            ])
            .withUserId(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.update_room_from_backend(
        chat.UpdateRoomFromBackendRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_metadata('ROOM_0001')
            .with_password('password-0003')
            .with_white_list_user_ids([
                'user-0001',
                'user-0002',
                'user-0003',
            ])
            .with_user_id(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.update_room_from_backend({
    namespaceName="namespace-0001",
    roomName="room-0001",
    metadata="ROOM_0001",
    password="password-0003",
    whiteListUserIds={
        "user-0001",
        "user-0002",
        "user-0003"
    },
    userId=nil,
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.update_room_from_backend_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    metadata="ROOM_0001",
    password="password-0003",
    whiteListUserIds={
        "user-0001",
        "user-0002",
        "user-0003"
    },
    userId=nil,
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;deleteRoom
ルームを削除
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | UUID | ~ 128文字 | ルーム名 | |
| accessToken | string | ~ 128文字 | アクセストークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Room | 削除したルーム | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DeleteRoom(
    &chat.DeleteRoomRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DeleteRoomRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->deleteRoom(
        (new DeleteRoomRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withAccessToken("accessToken-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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DeleteRoomRequest;
import io.gs2.chat.result.DeleteRoomResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DeleteRoomResult result = client.deleteRoom(
        new DeleteRoomRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withAccessToken("accessToken-0001")
    );
    Room 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DeleteRoomRequest;
using Gs2.Gs2Chat.Result.DeleteRoomResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DeleteRoomResult> asyncResult = null;
yield return client.DeleteRoom(
    new Gs2.Gs2Chat.Request.DeleteRoomRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithAccessToken("accessToken-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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.deleteRoom(
        new Gs2Chat.DeleteRoomRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.delete_room(
        chat.DeleteRoomRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.delete_room({
    namespaceName="namespace-0001",
    roomName="room-0001",
    accessToken="accessToken-0001",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.delete_room_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    accessToken="accessToken-0001",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;deleteRoomFromBackend
バックエンドからルームを削除
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | UUID | ~ 128文字 | ルーム名 | |
| userId | string | ~ 128文字 | オーナーユーザーID | |||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Room | 削除したルーム | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DeleteRoomFromBackend(
    &chat.DeleteRoomFromBackendRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        UserId: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DeleteRoomFromBackendRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->deleteRoomFromBackend(
        (new DeleteRoomFromBackendRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withUserId(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DeleteRoomFromBackendRequest;
import io.gs2.chat.result.DeleteRoomFromBackendResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DeleteRoomFromBackendResult result = client.deleteRoomFromBackend(
        new DeleteRoomFromBackendRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withUserId(null)
            .withTimeOffsetToken(null)
    );
    Room 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DeleteRoomFromBackendRequest;
using Gs2.Gs2Chat.Result.DeleteRoomFromBackendResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DeleteRoomFromBackendResult> asyncResult = null;
yield return client.DeleteRoomFromBackend(
    new Gs2.Gs2Chat.Request.DeleteRoomFromBackendRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithUserId(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.deleteRoomFromBackend(
        new Gs2Chat.DeleteRoomFromBackendRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withUserId(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.delete_room_from_backend(
        chat.DeleteRoomFromBackendRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_user_id(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.delete_room_from_backend({
    namespaceName="namespace-0001",
    roomName="room-0001",
    userId=nil,
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.delete_room_from_backend_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    userId=nil,
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;describeMessages
メッセージの一覧取得
ルーム名、取得開始時間、および取得件数の制限を指定して、ルーム内のメッセージを取得することができます。
パスワードが設定されているルームでは、パスワードの入力が必要です。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | UUID | ~ 128文字 | ルーム名 | |
| password | string | ~ 128文字 | ルームにアクセスするために必要となるパスワード | |||
| category | int | 0 ~ 2147483645 | メッセージの種類を分類したい時の種類番号 | |||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| startAt | long | ✓ | 現在時刻からの差分(-1時間) | メッセージの取得を開始する時間 (UNIX時間 単位:ミリ秒) | ||
| limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<Message> | メッセージのリスト | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DescribeMessages(
    &chat.DescribeMessagesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        Password: nil,
        Category: nil,
        AccessToken: pointy.String("accessToken-0001"),
        StartAt: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DescribeMessagesRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->describeMessages(
        (new DescribeMessagesRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withPassword(null)
            ->withCategory(null)
            ->withAccessToken("accessToken-0001")
            ->withStartAt(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
} 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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DescribeMessagesRequest;
import io.gs2.chat.result.DescribeMessagesResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DescribeMessagesResult result = client.describeMessages(
        new DescribeMessagesRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withPassword(null)
            .withCategory(null)
            .withAccessToken("accessToken-0001")
            .withStartAt(null)
            .withLimit(null)
    );
    List<Message> items = result.getItems();
} 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DescribeMessagesRequest;
using Gs2.Gs2Chat.Result.DescribeMessagesResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DescribeMessagesResult> asyncResult = null;
yield return client.DescribeMessages(
    new Gs2.Gs2Chat.Request.DescribeMessagesRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithPassword(null)
        .WithCategory(null)
        .WithAccessToken("accessToken-0001")
        .WithStartAt(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.describeMessages(
        new Gs2Chat.DescribeMessagesRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withPassword(null)
            .withCategory(null)
            .withAccessToken("accessToken-0001")
            .withStartAt(null)
            .withLimit(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.describe_messages(
        chat.DescribeMessagesRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_password(None)
            .with_category(None)
            .with_access_token('accessToken-0001')
            .with_start_at(None)
            .with_limit(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.describe_messages({
    namespaceName="namespace-0001",
    roomName="room-0001",
    password=nil,
    category=nil,
    accessToken="accessToken-0001",
    startAt=nil,
    limit=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;client = gs2('chat')
api_result_handler = client.describe_messages_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    password=nil,
    category=nil,
    accessToken="accessToken-0001",
    startAt=nil,
    limit=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;describeMessagesByUserId
ユーザIDを指定してメッセージの一覧取得
ルーム名、取得開始時間、および取得件数の制限を指定して、ルーム内のメッセージを取得することができます。
パスワードが設定されているルームでは、パスワードの入力が必要です。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | UUID | ~ 128文字 | ルーム名 | |
| password | string | ~ 128文字 | ルームにアクセスするために必要となるパスワード | |||
| category | int | 0 ~ 2147483645 | メッセージの種類を分類したい時の種類番号 | |||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| startAt | long | ✓ | 現在時刻からの差分(-1時間) | メッセージの取得を開始する時間 (UNIX時間 単位:ミリ秒) | ||
| limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | |
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<Message> | メッセージのリスト | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DescribeMessagesByUserId(
    &chat.DescribeMessagesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        Password: nil,
        Category: nil,
        UserId: pointy.String("user-0002"),
        StartAt: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DescribeMessagesByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->describeMessagesByUserId(
        (new DescribeMessagesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withPassword(null)
            ->withCategory(null)
            ->withUserId("user-0002")
            ->withStartAt(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
} 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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DescribeMessagesByUserIdRequest;
import io.gs2.chat.result.DescribeMessagesByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DescribeMessagesByUserIdResult result = client.describeMessagesByUserId(
        new DescribeMessagesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withPassword(null)
            .withCategory(null)
            .withUserId("user-0002")
            .withStartAt(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Message> items = result.getItems();
} 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DescribeMessagesByUserIdRequest;
using Gs2.Gs2Chat.Result.DescribeMessagesByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DescribeMessagesByUserIdResult> asyncResult = null;
yield return client.DescribeMessagesByUserId(
    new Gs2.Gs2Chat.Request.DescribeMessagesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithPassword(null)
        .WithCategory(null)
        .WithUserId("user-0002")
        .WithStartAt(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.describeMessagesByUserId(
        new Gs2Chat.DescribeMessagesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withPassword(null)
            .withCategory(null)
            .withUserId("user-0002")
            .withStartAt(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.describe_messages_by_user_id(
        chat.DescribeMessagesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_password(None)
            .with_category(None)
            .with_user_id('user-0002')
            .with_start_at(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.describe_messages_by_user_id({
    namespaceName="namespace-0001",
    roomName="room-0001",
    password=nil,
    category=nil,
    userId="user-0002",
    startAt=nil,
    limit=nil,
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;client = gs2('chat')
api_result_handler = client.describe_messages_by_user_id_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    password=nil,
    category=nil,
    userId="user-0002",
    startAt=nil,
    limit=nil,
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;describeLatestMessages
最新のメッセージの一覧取得
ルーム名、取得開始時間、および取得件数の制限を指定して、ルーム内の最新のメッセージを取得することができます。
パスワードが設定されているルームでは、パスワードの入力が必要です。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | UUID | ~ 128文字 | ルーム名 | |
| password | string | ~ 128文字 | ルームにアクセスするために必要となるパスワード | |||
| category | int | 0 ~ 2147483645 | メッセージの種類を分類したい時の種類番号 | |||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<Message> | メッセージのリスト | 
| nextPageToken | string | リストの続きを取得するためのページトークン | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DescribeLatestMessages(
    &chat.DescribeLatestMessagesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        Password: nil,
        Category: nil,
        AccessToken: pointy.String("accessToken-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DescribeLatestMessagesRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->describeLatestMessages(
        (new DescribeLatestMessagesRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withPassword(null)
            ->withCategory(null)
            ->withAccessToken("accessToken-0001")
            ->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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DescribeLatestMessagesRequest;
import io.gs2.chat.result.DescribeLatestMessagesResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DescribeLatestMessagesResult result = client.describeLatestMessages(
        new DescribeLatestMessagesRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withPassword(null)
            .withCategory(null)
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Message> 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DescribeLatestMessagesRequest;
using Gs2.Gs2Chat.Result.DescribeLatestMessagesResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DescribeLatestMessagesResult> asyncResult = null;
yield return client.DescribeLatestMessages(
    new Gs2.Gs2Chat.Request.DescribeLatestMessagesRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithPassword(null)
        .WithCategory(null)
        .WithAccessToken("accessToken-0001")
        .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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.describeLatestMessages(
        new Gs2Chat.DescribeLatestMessagesRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withPassword(null)
            .withCategory(null)
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.describe_latest_messages(
        chat.DescribeLatestMessagesRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_password(None)
            .with_category(None)
            .with_access_token('accessToken-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.describe_latest_messages({
    namespaceName="namespace-0001",
    roomName="room-0001",
    password=nil,
    category=nil,
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('chat')
api_result_handler = client.describe_latest_messages_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    password=nil,
    category=nil,
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;describeLatestMessagesByUserId
ユーザIDを指定してメッセージの一覧取得
ルーム名、取得開始時間、および取得件数の制限を指定して、ルーム内のメッセージを取得することができます。
パスワードが設定されているルームでは、パスワードの入力が必要です。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | UUID | ~ 128文字 | ルーム名 | |
| password | string | ~ 128文字 | ルームにアクセスするために必要となるパスワード | |||
| category | int | 0 ~ 2147483645 | メッセージの種類を分類したい時の種類番号 | |||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | |
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<Message> | メッセージのリスト | 
| nextPageToken | string | リストの続きを取得するためのページトークン | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DescribeLatestMessagesByUserId(
    &chat.DescribeLatestMessagesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        Password: nil,
        Category: nil,
        UserId: pointy.String("user-0002"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DescribeLatestMessagesByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->describeLatestMessagesByUserId(
        (new DescribeLatestMessagesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withPassword(null)
            ->withCategory(null)
            ->withUserId("user-0002")
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DescribeLatestMessagesByUserIdRequest;
import io.gs2.chat.result.DescribeLatestMessagesByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DescribeLatestMessagesByUserIdResult result = client.describeLatestMessagesByUserId(
        new DescribeLatestMessagesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withPassword(null)
            .withCategory(null)
            .withUserId("user-0002")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Message> 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DescribeLatestMessagesByUserIdRequest;
using Gs2.Gs2Chat.Result.DescribeLatestMessagesByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DescribeLatestMessagesByUserIdResult> asyncResult = null;
yield return client.DescribeLatestMessagesByUserId(
    new Gs2.Gs2Chat.Request.DescribeLatestMessagesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithPassword(null)
        .WithCategory(null)
        .WithUserId("user-0002")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.describeLatestMessagesByUserId(
        new Gs2Chat.DescribeLatestMessagesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withPassword(null)
            .withCategory(null)
            .withUserId("user-0002")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.describe_latest_messages_by_user_id(
        chat.DescribeLatestMessagesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_password(None)
            .with_category(None)
            .with_user_id('user-0002')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.describe_latest_messages_by_user_id({
    namespaceName="namespace-0001",
    roomName="room-0001",
    password=nil,
    category=nil,
    userId="user-0002",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('chat')
api_result_handler = client.describe_latest_messages_by_user_id_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    password=nil,
    category=nil,
    userId="user-0002",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;post
メッセージを投稿
ルーム名、カテゴリ、メタデータ、およびパスワード(ルームに設定されている場合)を指定してメッセージを投稿することができます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | ~ 128文字 | ルーム名 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| category | int | ✓ | 0 | 0 ~ 2147483645 | メッセージの種類を分類したい時の種類番号 | |
| metadata | string | ✓ | ~ 1024文字 | メタデータ | ||
| password | string | ~ 128文字 | パスワード | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Message | 投稿したメッセージ | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.Post(
    &chat.PostRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Category: nil,
        Metadata: pointy.String("MESSAGE_0001"),
        Password: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\PostRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->post(
        (new PostRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withAccessToken("accessToken-0001")
            ->withCategory(null)
            ->withMetadata("MESSAGE_0001")
            ->withPassword(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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.PostRequest;
import io.gs2.chat.result.PostResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    PostResult result = client.post(
        new PostRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withAccessToken("accessToken-0001")
            .withCategory(null)
            .withMetadata("MESSAGE_0001")
            .withPassword(null)
    );
    Message 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.PostRequest;
using Gs2.Gs2Chat.Result.PostResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.PostResult> asyncResult = null;
yield return client.Post(
    new Gs2.Gs2Chat.Request.PostRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithAccessToken("accessToken-0001")
        .WithCategory(null)
        .WithMetadata("MESSAGE_0001")
        .WithPassword(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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.post(
        new Gs2Chat.PostRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withAccessToken("accessToken-0001")
            .withCategory(null)
            .withMetadata("MESSAGE_0001")
            .withPassword(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.post(
        chat.PostRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_access_token('accessToken-0001')
            .with_category(None)
            .with_metadata('MESSAGE_0001')
            .with_password(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.post({
    namespaceName="namespace-0001",
    roomName="room-0001",
    accessToken="accessToken-0001",
    category=nil,
    metadata="MESSAGE_0001",
    password=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.post_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    accessToken="accessToken-0001",
    category=nil,
    metadata="MESSAGE_0001",
    password=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;postByUserId
ユーザIDを指定してメッセージを投稿
ルーム名、カテゴリ、メタデータ、およびパスワード(ルームに設定されている場合)を指定してメッセージを投稿することができます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | ~ 128文字 | ルーム名 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| category | int | ✓ | 0 | 0 ~ 2147483645 | メッセージの種類を分類したい時の種類番号 | |
| metadata | string | ✓ | ~ 1024文字 | メタデータ | ||
| password | string | ~ 128文字 | パスワード | |||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Message | 投稿したメッセージ | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.PostByUserId(
    &chat.PostByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0002"),
        UserId: pointy.String("user-0002"),
        Category: nil,
        Metadata: pointy.String("MESSAGE_0003"),
        Password: pointy.String("password-0002"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\PostByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->postByUserId(
        (new PostByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0002")
            ->withUserId("user-0002")
            ->withCategory(null)
            ->withMetadata("MESSAGE_0003")
            ->withPassword("password-0002")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.PostByUserIdRequest;
import io.gs2.chat.result.PostByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    PostByUserIdResult result = client.postByUserId(
        new PostByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0002")
            .withUserId("user-0002")
            .withCategory(null)
            .withMetadata("MESSAGE_0003")
            .withPassword("password-0002")
            .withTimeOffsetToken(null)
    );
    Message 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.PostByUserIdRequest;
using Gs2.Gs2Chat.Result.PostByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.PostByUserIdResult> asyncResult = null;
yield return client.PostByUserId(
    new Gs2.Gs2Chat.Request.PostByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0002")
        .WithUserId("user-0002")
        .WithCategory(null)
        .WithMetadata("MESSAGE_0003")
        .WithPassword("password-0002")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.postByUserId(
        new Gs2Chat.PostByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0002")
            .withUserId("user-0002")
            .withCategory(null)
            .withMetadata("MESSAGE_0003")
            .withPassword("password-0002")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.post_by_user_id(
        chat.PostByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0002')
            .with_user_id('user-0002')
            .with_category(None)
            .with_metadata('MESSAGE_0003')
            .with_password('password-0002')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.post_by_user_id({
    namespaceName="namespace-0001",
    roomName="room-0002",
    userId="user-0002",
    category=nil,
    metadata="MESSAGE_0003",
    password="password-0002",
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.post_by_user_id_async({
    namespaceName="namespace-0001",
    roomName="room-0002",
    userId="user-0002",
    category=nil,
    metadata="MESSAGE_0003",
    password="password-0002",
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;getMessage
メッセージを取得
ルーム名、メッセージ名、必要ならパスワードを指定して、特定のメッセージの詳細情報を取得することができます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | ~ 128文字 | ルーム名 | ||
| messageName | string | ✓ | UUID | ~ 36文字 | メッセージ名 | |
| password | string | ~ 128文字 | パスワード | |||
| accessToken | string | ~ 128文字 | アクセストークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Message | メッセージ | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.GetMessage(
    &chat.GetMessageRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        MessageName: pointy.String("message-0001"),
        Password: nil,
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\GetMessageRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->getMessage(
        (new GetMessageRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withMessageName("message-0001")
            ->withPassword(null)
            ->withAccessToken("accessToken-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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.GetMessageRequest;
import io.gs2.chat.result.GetMessageResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    GetMessageResult result = client.getMessage(
        new GetMessageRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withMessageName("message-0001")
            .withPassword(null)
            .withAccessToken("accessToken-0001")
    );
    Message 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.GetMessageRequest;
using Gs2.Gs2Chat.Result.GetMessageResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.GetMessageResult> asyncResult = null;
yield return client.GetMessage(
    new Gs2.Gs2Chat.Request.GetMessageRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithMessageName("message-0001")
        .WithPassword(null)
        .WithAccessToken("accessToken-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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.getMessage(
        new Gs2Chat.GetMessageRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withMessageName("message-0001")
            .withPassword(null)
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.get_message(
        chat.GetMessageRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_message_name('message-0001')
            .with_password(None)
            .with_access_token('accessToken-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.get_message({
    namespaceName="namespace-0001",
    roomName="room-0001",
    messageName="message-0001",
    password=nil,
    accessToken="accessToken-0001",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.get_message_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    messageName="message-0001",
    password=nil,
    accessToken="accessToken-0001",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;getMessageByUserId
ユーザIDを指定してメッセージを取得
ルーム名、メッセージ名、必要ならパスワードを指定して、特定のメッセージの詳細情報を取得することができます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | ~ 128文字 | ルーム名 | ||
| messageName | string | ✓ | UUID | ~ 36文字 | メッセージ名 | |
| password | string | ~ 128文字 | パスワード | |||
| userId | string | ~ 128文字 | ユーザーID | |||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Message | メッセージ | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.GetMessageByUserId(
    &chat.GetMessageByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        MessageName: pointy.String("message-0001"),
        Password: nil,
        UserId: pointy.String("user-0002"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\GetMessageByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->getMessageByUserId(
        (new GetMessageByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withMessageName("message-0001")
            ->withPassword(null)
            ->withUserId("user-0002")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.GetMessageByUserIdRequest;
import io.gs2.chat.result.GetMessageByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    GetMessageByUserIdResult result = client.getMessageByUserId(
        new GetMessageByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withMessageName("message-0001")
            .withPassword(null)
            .withUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    Message 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.GetMessageByUserIdRequest;
using Gs2.Gs2Chat.Result.GetMessageByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.GetMessageByUserIdResult> asyncResult = null;
yield return client.GetMessageByUserId(
    new Gs2.Gs2Chat.Request.GetMessageByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithMessageName("message-0001")
        .WithPassword(null)
        .WithUserId("user-0002")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.getMessageByUserId(
        new Gs2Chat.GetMessageByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withMessageName("message-0001")
            .withPassword(null)
            .withUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.get_message_by_user_id(
        chat.GetMessageByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_message_name('message-0001')
            .with_password(None)
            .with_user_id('user-0002')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.get_message_by_user_id({
    namespaceName="namespace-0001",
    roomName="room-0001",
    messageName="message-0001",
    password=nil,
    userId="user-0002",
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.get_message_by_user_id_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    messageName="message-0001",
    password=nil,
    userId="user-0002",
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;deleteMessage
メッセージを削除
特定のメッセージをシステムから削除することができます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | ~ 128文字 | ルーム名 | ||
| userId | string | ~ 128文字 | ユーザーID | |||
| messageName | string | ✓ | UUID | ~ 36文字 | メッセージ名 | |
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Message | 削除したメッセージ | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DeleteMessage(
    &chat.DeleteMessageRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        UserId: pointy.String("user-0001"),
        MessageName: pointy.String("message-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DeleteMessageRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->deleteMessage(
        (new DeleteMessageRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withUserId("user-0001")
            ->withMessageName("message-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DeleteMessageRequest;
import io.gs2.chat.result.DeleteMessageResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DeleteMessageResult result = client.deleteMessage(
        new DeleteMessageRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withUserId("user-0001")
            .withMessageName("message-0001")
            .withTimeOffsetToken(null)
    );
    Message 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DeleteMessageRequest;
using Gs2.Gs2Chat.Result.DeleteMessageResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DeleteMessageResult> asyncResult = null;
yield return client.DeleteMessage(
    new Gs2.Gs2Chat.Request.DeleteMessageRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithUserId("user-0001")
        .WithMessageName("message-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.deleteMessage(
        new Gs2Chat.DeleteMessageRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withUserId("user-0001")
            .withMessageName("message-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.delete_message(
        chat.DeleteMessageRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_user_id('user-0001')
            .with_message_name('message-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.delete_message({
    namespaceName="namespace-0001",
    roomName="room-0001",
    userId="user-0001",
    messageName="message-0001",
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.delete_message_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    userId="user-0001",
    messageName="message-0001",
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;describeSubscribes
購読しているルームの一覧取得
ページトークンと取得件数の制限を指定して、購読リストを取得できます。
これにより、ユーザーが購読しているルームの概要を確認することができます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomNamePrefix | string | ~ 64文字 | 購読しているルーム名のフィルター接頭辞 | |||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<Subscribe> | 購読のリスト | 
| nextPageToken | string | リストの続きを取得するためのページトークン | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DescribeSubscribes(
    &chat.DescribeSubscribesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomNamePrefix: nil,
        AccessToken: pointy.String("accessToken-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DescribeSubscribesRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->describeSubscribes(
        (new DescribeSubscribesRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomNamePrefix(null)
            ->withAccessToken("accessToken-0001")
            ->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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DescribeSubscribesRequest;
import io.gs2.chat.result.DescribeSubscribesResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DescribeSubscribesResult result = client.describeSubscribes(
        new DescribeSubscribesRequest()
            .withNamespaceName("namespace-0001")
            .withRoomNamePrefix(null)
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Subscribe> 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DescribeSubscribesRequest;
using Gs2.Gs2Chat.Result.DescribeSubscribesResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DescribeSubscribesResult> asyncResult = null;
yield return client.DescribeSubscribes(
    new Gs2.Gs2Chat.Request.DescribeSubscribesRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomNamePrefix(null)
        .WithAccessToken("accessToken-0001")
        .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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.describeSubscribes(
        new Gs2Chat.DescribeSubscribesRequest()
            .withNamespaceName("namespace-0001")
            .withRoomNamePrefix(null)
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.describe_subscribes(
        chat.DescribeSubscribesRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name_prefix(None)
            .with_access_token('accessToken-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.describe_subscribes({
    namespaceName="namespace-0001",
    roomNamePrefix=nil,
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('chat')
api_result_handler = client.describe_subscribes_async({
    namespaceName="namespace-0001",
    roomNamePrefix=nil,
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;describeSubscribesByUserId
ユーザIDを指定して購読しているルームの一覧取得
ページトークンと取得件数の制限を指定して、購読リストを取得できます。
これにより、ユーザーが購読しているルームの概要を確認することができます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomNamePrefix | string | ~ 64文字 | 購読しているルーム名のフィルター接頭辞 | |||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | |
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<Subscribe> | 購読のリスト | 
| nextPageToken | string | リストの続きを取得するためのページトークン | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DescribeSubscribesByUserId(
    &chat.DescribeSubscribesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomNamePrefix: nil,
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DescribeSubscribesByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->describeSubscribesByUserId(
        (new DescribeSubscribesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomNamePrefix(null)
            ->withUserId("user-0001")
            ->withPageToken(null)
            ->withLimit(null)
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DescribeSubscribesByUserIdRequest;
import io.gs2.chat.result.DescribeSubscribesByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DescribeSubscribesByUserIdResult result = client.describeSubscribesByUserId(
        new DescribeSubscribesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomNamePrefix(null)
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Subscribe> 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DescribeSubscribesByUserIdRequest;
using Gs2.Gs2Chat.Result.DescribeSubscribesByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DescribeSubscribesByUserIdResult> asyncResult = null;
yield return client.DescribeSubscribesByUserId(
    new Gs2.Gs2Chat.Request.DescribeSubscribesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomNamePrefix(null)
        .WithUserId("user-0001")
        .WithPageToken(null)
        .WithLimit(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.describeSubscribesByUserId(
        new Gs2Chat.DescribeSubscribesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomNamePrefix(null)
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.describe_subscribes_by_user_id(
        chat.DescribeSubscribesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name_prefix(None)
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
            .with_time_offset_token(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.describe_subscribes_by_user_id({
    namespaceName="namespace-0001",
    roomNamePrefix=nil,
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('chat')
api_result_handler = client.describe_subscribes_by_user_id_async({
    namespaceName="namespace-0001",
    roomNamePrefix=nil,
    userId="user-0001",
    pageToken=nil,
    limit=nil,
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;describeSubscribesByRoomName
ルーム名を指定して購読しているユーザの一覧取得
ページトークンと取得件数の制限を指定して、そのルームを購読しているユーザーリストを取得できます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | ~ 128文字 | 購読するルーム名 | ||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<Subscribe> | 購読のリスト | 
| nextPageToken | string | リストの続きを取得するためのページトークン | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DescribeSubscribesByRoomName(
    &chat.DescribeSubscribesByRoomNameRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DescribeSubscribesByRoomNameRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->describeSubscribesByRoomName(
        (new DescribeSubscribesByRoomNameRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DescribeSubscribesByRoomNameRequest;
import io.gs2.chat.result.DescribeSubscribesByRoomNameResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DescribeSubscribesByRoomNameResult result = client.describeSubscribesByRoomName(
        new DescribeSubscribesByRoomNameRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Subscribe> 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DescribeSubscribesByRoomNameRequest;
using Gs2.Gs2Chat.Result.DescribeSubscribesByRoomNameResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DescribeSubscribesByRoomNameResult> asyncResult = null;
yield return client.DescribeSubscribesByRoomName(
    new Gs2.Gs2Chat.Request.DescribeSubscribesByRoomNameRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.describeSubscribesByRoomName(
        new Gs2Chat.DescribeSubscribesByRoomNameRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.describe_subscribes_by_room_name(
        chat.DescribeSubscribesByRoomNameRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.describe_subscribes_by_room_name({
    namespaceName="namespace-0001",
    roomName="room-0001",
    pageToken=nil,
    limit=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('chat')
api_result_handler = client.describe_subscribes_by_room_name_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    pageToken=nil,
    limit=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;subscribe
ルームを購読
ユーザーが特定のルームへのメッセージ投稿通知を受け取るために使用されます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | ~ 128文字 | 購読するルーム名 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| notificationTypes | List<NotificationType> | [] | 0 ~ 100 items | 新着メッセージ通知を受け取るカテゴリリスト | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Subscribe | 購読した購読 | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.Subscribe(
    &chat.SubscribeRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        NotificationTypes: []chat.NotificationType{
            chat.NotificationType{
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\SubscribeRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->subscribe(
        (new SubscribeRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withAccessToken("accessToken-0001")
            ->withNotificationTypes([
                (new \Gs2\Chat\Model\NotificationType()),
            ])
    );
    $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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.SubscribeRequest;
import io.gs2.chat.result.SubscribeResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    SubscribeResult result = client.subscribe(
        new SubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withAccessToken("accessToken-0001")
            .withNotificationTypes(Arrays.asList(
                new io.gs2.chat.model.NotificationType()
            ))
    );
    Subscribe 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.SubscribeRequest;
using Gs2.Gs2Chat.Result.SubscribeResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.SubscribeResult> asyncResult = null;
yield return client.Subscribe(
    new Gs2.Gs2Chat.Request.SubscribeRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithAccessToken("accessToken-0001")
        .WithNotificationTypes(new Gs2.Gs2Chat.Model.NotificationType[] {
            new Gs2.Gs2Chat.Model.NotificationType(),
        }),
    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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.subscribe(
        new Gs2Chat.SubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withAccessToken("accessToken-0001")
            .withNotificationTypes([
                new Gs2Chat.model.NotificationType(),
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.subscribe(
        chat.SubscribeRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_access_token('accessToken-0001')
            .with_notification_types([
                chat.NotificationType(),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.subscribe({
    namespaceName="namespace-0001",
    roomName="room-0001",
    accessToken="accessToken-0001",
    notificationTypes={
        {
        }
    },
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.subscribe_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    accessToken="accessToken-0001",
    notificationTypes={
        {
        }
    },
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;subscribeByUserId
ユーザIDを指定してルームを購読
ユーザーが特定のルームへのメッセージ投稿通知を受け取るために使用されます。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | ~ 128文字 | 購読するルーム名 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| notificationTypes | List<NotificationType> | [] | 0 ~ 100 items | 新着メッセージ通知を受け取るカテゴリリスト | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Subscribe | 購読した購読 | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.SubscribeByUserId(
    &chat.SubscribeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        UserId: pointy.String("user-0001"),
        NotificationTypes: []chat.NotificationType{
            *.NotificationType(),
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\SubscribeByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->subscribeByUserId(
        (new SubscribeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withUserId("user-0001")
            ->withNotificationTypes([
                NotificationType(),
            ])
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.SubscribeByUserIdRequest;
import io.gs2.chat.result.SubscribeByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    SubscribeByUserIdResult result = client.subscribeByUserId(
        new SubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withUserId("user-0001")
            .withNotificationTypes(Arrays.asList(
                new NotificationType()
            ))
            .withTimeOffsetToken(null)
    );
    Subscribe 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.SubscribeByUserIdRequest;
using Gs2.Gs2Chat.Result.SubscribeByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.SubscribeByUserIdResult> asyncResult = null;
yield return client.SubscribeByUserId(
    new Gs2.Gs2Chat.Request.SubscribeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithUserId("user-0001")
        .WithNotificationTypes(new Gs2.Gs2Chat.Model.NotificationType[] {
            new Gs2.Gs2Chat.Model.NotificationType(),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.subscribeByUserId(
        new Gs2Chat.SubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withUserId("user-0001")
            .withNotificationTypes([
                new NotificationType(),
            ])
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.subscribe_by_user_id(
        chat.SubscribeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_user_id('user-0001')
            .with_notification_types([
                NotificationType(),
            ])
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.subscribe_by_user_id({
    namespaceName="namespace-0001",
    roomName="room-0001",
    userId="user-0001",
    notificationTypes={
        {}
    },
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.subscribe_by_user_id_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    userId="user-0001",
    notificationTypes={
        {}
    },
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;getSubscribe
購読を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | ~ 128文字 | 購読するルーム名 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Subscribe | 購読 | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.GetSubscribe(
    &chat.GetSubscribeRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\GetSubscribeRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->getSubscribe(
        (new GetSubscribeRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withAccessToken("accessToken-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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.GetSubscribeRequest;
import io.gs2.chat.result.GetSubscribeResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    GetSubscribeResult result = client.getSubscribe(
        new GetSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withAccessToken("accessToken-0001")
    );
    Subscribe 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.GetSubscribeRequest;
using Gs2.Gs2Chat.Result.GetSubscribeResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.GetSubscribeResult> asyncResult = null;
yield return client.GetSubscribe(
    new Gs2.Gs2Chat.Request.GetSubscribeRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithAccessToken("accessToken-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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.getSubscribe(
        new Gs2Chat.GetSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.get_subscribe(
        chat.GetSubscribeRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.get_subscribe({
    namespaceName="namespace-0001",
    roomName="room-0001",
    accessToken="accessToken-0001",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.get_subscribe_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    accessToken="accessToken-0001",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;getSubscribeByUserId
ユーザIDを指定して購読を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | ~ 128文字 | 購読するルーム名 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Subscribe | 購読 | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.GetSubscribeByUserId(
    &chat.GetSubscribeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\GetSubscribeByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->getSubscribeByUserId(
        (new GetSubscribeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.GetSubscribeByUserIdRequest;
import io.gs2.chat.result.GetSubscribeByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    GetSubscribeByUserIdResult result = client.getSubscribeByUserId(
        new GetSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Subscribe 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.GetSubscribeByUserIdRequest;
using Gs2.Gs2Chat.Result.GetSubscribeByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.GetSubscribeByUserIdResult> asyncResult = null;
yield return client.GetSubscribeByUserId(
    new Gs2.Gs2Chat.Request.GetSubscribeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.getSubscribeByUserId(
        new Gs2Chat.GetSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.get_subscribe_by_user_id(
        chat.GetSubscribeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.get_subscribe_by_user_id({
    namespaceName="namespace-0001",
    roomName="room-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.get_subscribe_by_user_id_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;updateNotificationType
通知方法を更新
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | ~ 128文字 | 購読するルーム名 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | ||
| notificationTypes | List<NotificationType> | [] | 0 ~ 100 items | 新着メッセージ通知を受け取るカテゴリリスト | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Subscribe | 更新した購読 | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.UpdateNotificationType(
    &chat.UpdateNotificationTypeRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        NotificationTypes: []chat.NotificationType{
            *.NotificationType(),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\UpdateNotificationTypeRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->updateNotificationType(
        (new UpdateNotificationTypeRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withAccessToken("accessToken-0001")
            ->withNotificationTypes([
                NotificationType(),
            ])
    );
    $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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.UpdateNotificationTypeRequest;
import io.gs2.chat.result.UpdateNotificationTypeResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    UpdateNotificationTypeResult result = client.updateNotificationType(
        new UpdateNotificationTypeRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withAccessToken("accessToken-0001")
            .withNotificationTypes(Arrays.asList(
                new NotificationType()
            ))
    );
    Subscribe 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.UpdateNotificationTypeRequest;
using Gs2.Gs2Chat.Result.UpdateNotificationTypeResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.UpdateNotificationTypeResult> asyncResult = null;
yield return client.UpdateNotificationType(
    new Gs2.Gs2Chat.Request.UpdateNotificationTypeRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithAccessToken("accessToken-0001")
        .WithNotificationTypes(new Gs2.Gs2Chat.Model.NotificationType[] {
            new Gs2.Gs2Chat.Model.NotificationType(),
        }),
    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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.updateNotificationType(
        new Gs2Chat.UpdateNotificationTypeRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withAccessToken("accessToken-0001")
            .withNotificationTypes([
                new NotificationType(),
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.update_notification_type(
        chat.UpdateNotificationTypeRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_access_token('accessToken-0001')
            .with_notification_types([
                NotificationType(),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.update_notification_type({
    namespaceName="namespace-0001",
    roomName="room-0001",
    accessToken="accessToken-0001",
    notificationTypes={
        {}
    },
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.update_notification_type_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    accessToken="accessToken-0001",
    notificationTypes={
        {}
    },
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;updateNotificationTypeByUserId
ユーザIDを指定して通知方法を更新
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | ~ 128文字 | 購読するルーム名 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| notificationTypes | List<NotificationType> | [] | 0 ~ 100 items | 新着メッセージ通知を受け取るカテゴリリスト | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Subscribe | 更新した購読 | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.UpdateNotificationTypeByUserId(
    &chat.UpdateNotificationTypeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        UserId: pointy.String("user-0001"),
        NotificationTypes: []chat.NotificationType{
            *.NotificationType(),
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\UpdateNotificationTypeByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->updateNotificationTypeByUserId(
        (new UpdateNotificationTypeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withUserId("user-0001")
            ->withNotificationTypes([
                NotificationType(),
            ])
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.UpdateNotificationTypeByUserIdRequest;
import io.gs2.chat.result.UpdateNotificationTypeByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    UpdateNotificationTypeByUserIdResult result = client.updateNotificationTypeByUserId(
        new UpdateNotificationTypeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withUserId("user-0001")
            .withNotificationTypes(Arrays.asList(
                new NotificationType()
            ))
            .withTimeOffsetToken(null)
    );
    Subscribe 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.UpdateNotificationTypeByUserIdRequest;
using Gs2.Gs2Chat.Result.UpdateNotificationTypeByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.UpdateNotificationTypeByUserIdResult> asyncResult = null;
yield return client.UpdateNotificationTypeByUserId(
    new Gs2.Gs2Chat.Request.UpdateNotificationTypeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithUserId("user-0001")
        .WithNotificationTypes(new Gs2.Gs2Chat.Model.NotificationType[] {
            new Gs2.Gs2Chat.Model.NotificationType(),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.updateNotificationTypeByUserId(
        new Gs2Chat.UpdateNotificationTypeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withUserId("user-0001")
            .withNotificationTypes([
                new NotificationType(),
            ])
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.update_notification_type_by_user_id(
        chat.UpdateNotificationTypeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_user_id('user-0001')
            .with_notification_types([
                NotificationType(),
            ])
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.update_notification_type_by_user_id({
    namespaceName="namespace-0001",
    roomName="room-0001",
    userId="user-0001",
    notificationTypes={
        {}
    },
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.update_notification_type_by_user_id_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    userId="user-0001",
    notificationTypes={
        {}
    },
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;unsubscribe
購読の購読を解除
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | ~ 128文字 | 購読するルーム名 | ||
| accessToken | string | ✓ | ~ 128文字 | アクセストークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Subscribe | 解除した購読 | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.Unsubscribe(
    &chat.UnsubscribeRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\UnsubscribeRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->unsubscribe(
        (new UnsubscribeRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withAccessToken("accessToken-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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.UnsubscribeRequest;
import io.gs2.chat.result.UnsubscribeResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    UnsubscribeResult result = client.unsubscribe(
        new UnsubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withAccessToken("accessToken-0001")
    );
    Subscribe 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.UnsubscribeRequest;
using Gs2.Gs2Chat.Result.UnsubscribeResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.UnsubscribeResult> asyncResult = null;
yield return client.Unsubscribe(
    new Gs2.Gs2Chat.Request.UnsubscribeRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithAccessToken("accessToken-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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.unsubscribe(
        new Gs2Chat.UnsubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.unsubscribe(
        chat.UnsubscribeRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.unsubscribe({
    namespaceName="namespace-0001",
    roomName="room-0001",
    accessToken="accessToken-0001",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.unsubscribe_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    accessToken="accessToken-0001",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;unsubscribeByUserId
ユーザIDを指定して購読の購読を解除
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| roomName | string | ✓ | ~ 128文字 | 購読するルーム名 | ||
| userId | string | ✓ | ~ 128文字 | ユーザーID | ||
| timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン | 
Result
| 型 | 説明 | |
|---|---|---|
| item | Subscribe | 解除した購読 | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.UnsubscribeByUserId(
    &chat.UnsubscribeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RoomName: pointy.String("room-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\UnsubscribeByUserIdRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->unsubscribeByUserId(
        (new UnsubscribeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRoomName("room-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.UnsubscribeByUserIdRequest;
import io.gs2.chat.result.UnsubscribeByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    UnsubscribeByUserIdResult result = client.unsubscribeByUserId(
        new UnsubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Subscribe 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.UnsubscribeByUserIdRequest;
using Gs2.Gs2Chat.Result.UnsubscribeByUserIdResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.UnsubscribeByUserIdResult> asyncResult = null;
yield return client.UnsubscribeByUserId(
    new Gs2.Gs2Chat.Request.UnsubscribeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRoomName("room-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.unsubscribeByUserId(
        new Gs2Chat.UnsubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRoomName("room-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.unsubscribe_by_user_id(
        chat.UnsubscribeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_room_name('room-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.unsubscribe_by_user_id({
    namespaceName="namespace-0001",
    roomName="room-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.unsubscribe_by_user_id_async({
    namespaceName="namespace-0001",
    roomName="room-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;describeCategoryModels
カテゴリーモデルの一覧を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<CategoryModel> | カテゴリーモデルのリスト | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DescribeCategoryModels(
    &chat.DescribeCategoryModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DescribeCategoryModelsRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->describeCategoryModels(
        (new DescribeCategoryModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} 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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DescribeCategoryModelsRequest;
import io.gs2.chat.result.DescribeCategoryModelsResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DescribeCategoryModelsResult result = client.describeCategoryModels(
        new DescribeCategoryModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<CategoryModel> items = result.getItems();
} 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DescribeCategoryModelsRequest;
using Gs2.Gs2Chat.Result.DescribeCategoryModelsResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DescribeCategoryModelsResult> asyncResult = null;
yield return client.DescribeCategoryModels(
    new Gs2.Gs2Chat.Request.DescribeCategoryModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.describeCategoryModels(
        new Gs2Chat.DescribeCategoryModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.describe_category_models(
        chat.DescribeCategoryModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.describe_category_models({
    namespaceName="namespace-0001",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;client = gs2('chat')
api_result_handler = client.describe_category_models_async({
    namespaceName="namespace-0001",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;getCategoryModel
カテゴリーモデルを取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| category | int | ✓ | 0 ~ 2147483645 | カテゴリー | 
Result
| 型 | 説明 | |
|---|---|---|
| item | CategoryModel | カテゴリーモデル | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.GetCategoryModel(
    &chat.GetCategoryModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Category: pointy.Int32(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\GetCategoryModelRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->getCategoryModel(
        (new GetCategoryModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategory(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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.GetCategoryModelRequest;
import io.gs2.chat.result.GetCategoryModelResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    GetCategoryModelResult result = client.getCategoryModel(
        new GetCategoryModelRequest()
            .withNamespaceName("namespace-0001")
            .withCategory(0)
    );
    CategoryModel 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.GetCategoryModelRequest;
using Gs2.Gs2Chat.Result.GetCategoryModelResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.GetCategoryModelResult> asyncResult = null;
yield return client.GetCategoryModel(
    new Gs2.Gs2Chat.Request.GetCategoryModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategory(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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.getCategoryModel(
        new Gs2Chat.GetCategoryModelRequest()
            .withNamespaceName("namespace-0001")
            .withCategory(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.get_category_model(
        chat.GetCategoryModelRequest()
            .with_namespace_name('namespace-0001')
            .with_category(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.get_category_model({
    namespaceName="namespace-0001",
    category=0,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.get_category_model_async({
    namespaceName="namespace-0001",
    category=0,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;describeCategoryModelMasters
カテゴリーモデルマスターの一覧を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
| limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | 
Result
| 型 | 説明 | |
|---|---|---|
| items | List<CategoryModelMaster> | カテゴリーモデルマスターのリスト | 
| nextPageToken | string | リストの続きを取得するためのページトークン | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DescribeCategoryModelMasters(
    &chat.DescribeCategoryModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DescribeCategoryModelMastersRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->describeCategoryModelMasters(
        (new DescribeCategoryModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DescribeCategoryModelMastersRequest;
import io.gs2.chat.result.DescribeCategoryModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DescribeCategoryModelMastersResult result = client.describeCategoryModelMasters(
        new DescribeCategoryModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<CategoryModelMaster> 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DescribeCategoryModelMastersRequest;
using Gs2.Gs2Chat.Result.DescribeCategoryModelMastersResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DescribeCategoryModelMastersResult> asyncResult = null;
yield return client.DescribeCategoryModelMasters(
    new Gs2.Gs2Chat.Request.DescribeCategoryModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.describeCategoryModelMasters(
        new Gs2Chat.DescribeCategoryModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.describe_category_model_masters(
        chat.DescribeCategoryModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.describe_category_model_masters({
    namespaceName="namespace-0001",
    pageToken=nil,
    limit=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('chat')
api_result_handler = client.describe_category_model_masters_async({
    namespaceName="namespace-0001",
    pageToken=nil,
    limit=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createCategoryModelMaster
カテゴリーモデルマスターを新規作成
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||||||||
| category | int | ✓ | 0 ~ 2147483645 | カテゴリー | ||||||||
| description | string | ~ 1024文字 | 説明文 | |||||||||
| rejectAccessTokenPost | 文字列列挙型 enum { “Enabled”, “Disabled” } | ~ 128文字 | アクセストークンを利用した投稿を拒否する 
 | 
Result
| 型 | 説明 | |
|---|---|---|
| item | CategoryModelMaster | 作成したカテゴリーモデルマスター | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.CreateCategoryModelMaster(
    &chat.CreateCategoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Category: pointy.Int32(0),
        Description: nil,
        RejectAccessTokenPost: pointy.String("Disabled"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\CreateCategoryModelMasterRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->createCategoryModelMaster(
        (new CreateCategoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategory(0)
            ->withDescription(null)
            ->withRejectAccessTokenPost("Disabled")
    );
    $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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.CreateCategoryModelMasterRequest;
import io.gs2.chat.result.CreateCategoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    CreateCategoryModelMasterResult result = client.createCategoryModelMaster(
        new CreateCategoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withCategory(0)
            .withDescription(null)
            .withRejectAccessTokenPost("Disabled")
    );
    CategoryModelMaster 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.CreateCategoryModelMasterRequest;
using Gs2.Gs2Chat.Result.CreateCategoryModelMasterResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.CreateCategoryModelMasterResult> asyncResult = null;
yield return client.CreateCategoryModelMaster(
    new Gs2.Gs2Chat.Request.CreateCategoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategory(0)
        .WithDescription(null)
        .WithRejectAccessTokenPost("Disabled"),
    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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.createCategoryModelMaster(
        new Gs2Chat.CreateCategoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withCategory(0)
            .withDescription(null)
            .withRejectAccessTokenPost("Disabled")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.create_category_model_master(
        chat.CreateCategoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_category(0)
            .with_description(None)
            .with_reject_access_token_post('Disabled')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.create_category_model_master({
    namespaceName="namespace-0001",
    category=0,
    description=nil,
    rejectAccessTokenPost="Disabled",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.create_category_model_master_async({
    namespaceName="namespace-0001",
    category=0,
    description=nil,
    rejectAccessTokenPost="Disabled",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;getCategoryModelMaster
カテゴリーモデルマスターを取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| category | int | ✓ | 0 ~ 2147483645 | カテゴリー | 
Result
| 型 | 説明 | |
|---|---|---|
| item | CategoryModelMaster | カテゴリーモデルマスター | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.GetCategoryModelMaster(
    &chat.GetCategoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Category: pointy.Int32(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\GetCategoryModelMasterRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->getCategoryModelMaster(
        (new GetCategoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategory(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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.GetCategoryModelMasterRequest;
import io.gs2.chat.result.GetCategoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    GetCategoryModelMasterResult result = client.getCategoryModelMaster(
        new GetCategoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withCategory(0)
    );
    CategoryModelMaster 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.GetCategoryModelMasterRequest;
using Gs2.Gs2Chat.Result.GetCategoryModelMasterResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.GetCategoryModelMasterResult> asyncResult = null;
yield return client.GetCategoryModelMaster(
    new Gs2.Gs2Chat.Request.GetCategoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategory(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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.getCategoryModelMaster(
        new Gs2Chat.GetCategoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withCategory(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.get_category_model_master(
        chat.GetCategoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_category(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.get_category_model_master({
    namespaceName="namespace-0001",
    category=0,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.get_category_model_master_async({
    namespaceName="namespace-0001",
    category=0,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;updateCategoryModelMaster
カテゴリーモデルマスターを更新
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||||||||
| category | int | ✓ | 0 ~ 2147483645 | カテゴリー | ||||||||
| description | string | ~ 1024文字 | 説明文 | |||||||||
| rejectAccessTokenPost | 文字列列挙型 enum { “Enabled”, “Disabled” } | ~ 128文字 | アクセストークンを利用した投稿を拒否する 
 | 
Result
| 型 | 説明 | |
|---|---|---|
| item | CategoryModelMaster | 更新したカテゴリーモデルマスター | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.UpdateCategoryModelMaster(
    &chat.UpdateCategoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Category: pointy.Int32(0),
        Description: pointy.String("description1"),
        RejectAccessTokenPost: pointy.String("Enabled"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\UpdateCategoryModelMasterRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->updateCategoryModelMaster(
        (new UpdateCategoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategory(0)
            ->withDescription("description1")
            ->withRejectAccessTokenPost("Enabled")
    );
    $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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.UpdateCategoryModelMasterRequest;
import io.gs2.chat.result.UpdateCategoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    UpdateCategoryModelMasterResult result = client.updateCategoryModelMaster(
        new UpdateCategoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withCategory(0)
            .withDescription("description1")
            .withRejectAccessTokenPost("Enabled")
    );
    CategoryModelMaster 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.UpdateCategoryModelMasterRequest;
using Gs2.Gs2Chat.Result.UpdateCategoryModelMasterResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.UpdateCategoryModelMasterResult> asyncResult = null;
yield return client.UpdateCategoryModelMaster(
    new Gs2.Gs2Chat.Request.UpdateCategoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategory(0)
        .WithDescription("description1")
        .WithRejectAccessTokenPost("Enabled"),
    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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.updateCategoryModelMaster(
        new Gs2Chat.UpdateCategoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withCategory(0)
            .withDescription("description1")
            .withRejectAccessTokenPost("Enabled")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.update_category_model_master(
        chat.UpdateCategoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_category(0)
            .with_description('description1')
            .with_reject_access_token_post('Enabled')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.update_category_model_master({
    namespaceName="namespace-0001",
    category=0,
    description="description1",
    rejectAccessTokenPost="Enabled",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.update_category_model_master_async({
    namespaceName="namespace-0001",
    category=0,
    description="description1",
    rejectAccessTokenPost="Enabled",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;deleteCategoryModelMaster
カテゴリーモデルマスターを削除
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| category | int | ✓ | 0 ~ 2147483645 | カテゴリー | 
Result
| 型 | 説明 | |
|---|---|---|
| item | CategoryModelMaster | 削除したカテゴリーモデルマスター | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.DeleteCategoryModelMaster(
    &chat.DeleteCategoryModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Category: pointy.Int32(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\DeleteCategoryModelMasterRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->deleteCategoryModelMaster(
        (new DeleteCategoryModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withCategory(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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.DeleteCategoryModelMasterRequest;
import io.gs2.chat.result.DeleteCategoryModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    DeleteCategoryModelMasterResult result = client.deleteCategoryModelMaster(
        new DeleteCategoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withCategory(0)
    );
    CategoryModelMaster 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.DeleteCategoryModelMasterRequest;
using Gs2.Gs2Chat.Result.DeleteCategoryModelMasterResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.DeleteCategoryModelMasterResult> asyncResult = null;
yield return client.DeleteCategoryModelMaster(
    new Gs2.Gs2Chat.Request.DeleteCategoryModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithCategory(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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.deleteCategoryModelMaster(
        new Gs2Chat.DeleteCategoryModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withCategory(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.delete_category_model_master(
        chat.DeleteCategoryModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_category(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.delete_category_model_master({
    namespaceName="namespace-0001",
    category=0,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.delete_category_model_master_async({
    namespaceName="namespace-0001",
    category=0,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;exportMaster
現在有効なカテゴリー設定のマスターデータをエクスポート
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | 
Result
| 型 | 説明 | |
|---|---|---|
| item | CurrentModelMaster | 現在有効なカテゴリー設定 | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &chat.ExportMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\ExportMasterRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->exportMaster(
        (new ExportMasterRequest())
            ->withNamespaceName("namespace-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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.ExportMasterRequest;
import io.gs2.chat.result.ExportMasterResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentModelMaster 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.ExportMasterRequest;
using Gs2.Gs2Chat.Result.ExportMasterResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Chat.Request.ExportMasterRequest()
        .WithNamespaceName("namespace-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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.exportMaster(
        new Gs2Chat.ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.export_master(
        chat.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.export_master({
    namespaceName="namespace-0001",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.export_master_async({
    namespaceName="namespace-0001",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;getCurrentModelMaster
現在有効なカテゴリー設定を取得
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | 
Result
| 型 | 説明 | |
|---|---|---|
| item | CurrentModelMaster | 現在有効なカテゴリー設定 | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.GetCurrentModelMaster(
    &chat.GetCurrentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\GetCurrentModelMasterRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->getCurrentModelMaster(
        (new GetCurrentModelMasterRequest())
            ->withNamespaceName("namespace-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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.GetCurrentModelMasterRequest;
import io.gs2.chat.result.GetCurrentModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    GetCurrentModelMasterResult result = client.getCurrentModelMaster(
        new GetCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentModelMaster 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.GetCurrentModelMasterRequest;
using Gs2.Gs2Chat.Result.GetCurrentModelMasterResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.GetCurrentModelMasterResult> asyncResult = null;
yield return client.GetCurrentModelMaster(
    new Gs2.Gs2Chat.Request.GetCurrentModelMasterRequest()
        .WithNamespaceName("namespace-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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.getCurrentModelMaster(
        new Gs2Chat.GetCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.get_current_model_master(
        chat.GetCurrentModelMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.get_current_model_master({
    namespaceName="namespace-0001",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.get_current_model_master_async({
    namespaceName="namespace-0001",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;preUpdateCurrentModelMaster
現在有効なマスターデータを更新(3フェーズ版)
1MBを超えるマスターデータをアップロードする場合は、3フェーズで更新を行います。
- このAPIを実行し、アップロード用のトークンとURLを取得します。
- 取得したURLに対して、マスターデータをアップロードします。
- UpdateCurrentModelMaster にアップロードに使用したトークンを渡して実行し、マスターデータを反映します。
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | 
Result
| 型 | 説明 | |
|---|---|---|
| uploadToken | string | アップロード後に結果を反映する際に使用するトークン | 
| uploadUrl | string | アップロード処理の実行に使用するURL | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentModelMaster(
    &chat.PreUpdateCurrentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\PreUpdateCurrentModelMasterRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->preUpdateCurrentModelMaster(
        (new PreUpdateCurrentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.PreUpdateCurrentModelMasterRequest;
import io.gs2.chat.result.PreUpdateCurrentModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    PreUpdateCurrentModelMasterResult result = client.preUpdateCurrentModelMaster(
        new PreUpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.PreUpdateCurrentModelMasterRequest;
using Gs2.Gs2Chat.Result.PreUpdateCurrentModelMasterResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.PreUpdateCurrentModelMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentModelMaster(
    new Gs2.Gs2Chat.Request.PreUpdateCurrentModelMasterRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;import Gs2Core from '@/gs2/core';
import * as Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.preUpdateCurrentModelMaster(
        new Gs2Chat.PreUpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.pre_update_current_model_master(
        chat.PreUpdateCurrentModelMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.pre_update_current_model_master({
    namespaceName="namespace-0001",
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;client = gs2('chat')
api_result_handler = client.pre_update_current_model_master_async({
    namespaceName="namespace-0001",
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;updateCurrentModelMaster
現在有効なカテゴリー設定を更新
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||||||||
| mode | 文字列列挙型 enum { “direct”, “preUpload” } | ✓ | “direct” | ~ 128文字 | 更新モード 
 | |||||||
| settings | string | {mode} == “direct” | ✓ | ~ 5242880文字 | マスターデータ mode が “direct” であれば必須 | |||||||
| uploadToken | string | {mode} == “preUpload” | ✓ | ~ 1024文字 | プレアップロードで取得したトークン mode が “preUpload” であれば必須 | 
Result
| 型 | 説明 | |
|---|---|---|
| item | CurrentModelMaster | 更新した現在有効なマスターデータ | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentModelMaster(
    &chat.UpdateCurrentModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: nil,
        Settings: pointy.String("{\"version\": \"2020-04-30\", \"categoryModels\": [{\"category\": 0, \"rejectAccessTokenPost\": \"Disabled\"}, {\"category\": 1, \"rejectAccessTokenPost\": \"Disabled\"}]}"),
        UploadToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\UpdateCurrentModelMasterRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->updateCurrentModelMaster(
        (new UpdateCurrentModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode(null)
            ->withSettings("{\"version\": \"2020-04-30\", \"categoryModels\": [{\"category\": 0, \"rejectAccessTokenPost\": \"Disabled\"}, {\"category\": 1, \"rejectAccessTokenPost\": \"Disabled\"}]}")
            ->withUploadToken(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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.UpdateCurrentModelMasterRequest;
import io.gs2.chat.result.UpdateCurrentModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    UpdateCurrentModelMasterResult result = client.updateCurrentModelMaster(
        new UpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode(null)
            .withSettings("{\"version\": \"2020-04-30\", \"categoryModels\": [{\"category\": 0, \"rejectAccessTokenPost\": \"Disabled\"}, {\"category\": 1, \"rejectAccessTokenPost\": \"Disabled\"}]}")
            .withUploadToken(null)
    );
    CurrentModelMaster 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.UpdateCurrentModelMasterRequest;
using Gs2.Gs2Chat.Result.UpdateCurrentModelMasterResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.UpdateCurrentModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentModelMaster(
    new Gs2.Gs2Chat.Request.UpdateCurrentModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode(null)
        .WithSettings("{\"version\": \"2020-04-30\", \"categoryModels\": [{\"category\": 0, \"rejectAccessTokenPost\": \"Disabled\"}, {\"category\": 1, \"rejectAccessTokenPost\": \"Disabled\"}]}")
        .WithUploadToken(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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.updateCurrentModelMaster(
        new Gs2Chat.UpdateCurrentModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode(null)
            .withSettings("{\"version\": \"2020-04-30\", \"categoryModels\": [{\"category\": 0, \"rejectAccessTokenPost\": \"Disabled\"}, {\"category\": 1, \"rejectAccessTokenPost\": \"Disabled\"}]}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.update_current_model_master(
        chat.UpdateCurrentModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode(None)
            .with_settings('{"version": "2020-04-30", "categoryModels": [{"category": 0, "rejectAccessTokenPost": "Disabled"}, {"category": 1, "rejectAccessTokenPost": "Disabled"}]}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.update_current_model_master({
    namespaceName="namespace-0001",
    mode=nil,
    settings="{\"version\": \"2020-04-30\", \"categoryModels\": [{\"category\": 0, \"rejectAccessTokenPost\": \"Disabled\"}, {\"category\": 1, \"rejectAccessTokenPost\": \"Disabled\"}]}",
    uploadToken=nil,
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.update_current_model_master_async({
    namespaceName="namespace-0001",
    mode=nil,
    settings="{\"version\": \"2020-04-30\", \"categoryModels\": [{\"category\": 0, \"rejectAccessTokenPost\": \"Disabled\"}, {\"category\": 1, \"rejectAccessTokenPost\": \"Disabled\"}]}",
    uploadToken=nil,
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;updateCurrentModelMasterFromGitHub
現在有効なカテゴリー設定を更新
Request
| 型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
| checkoutSetting | GitHubCheckoutSetting | ✓ | GitHubからマスターデータをチェックアウトしてくる設定 | 
Result
| 型 | 説明 | |
|---|---|---|
| item | CurrentModelMaster | 更新した現在有効なマスターデータ | 
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/chat"
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 := chat.Gs2ChatRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentModelMasterFromGitHub(
    &chat.UpdateCurrentModelMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &chat.GitHubCheckoutSetting{
            ApiKeyId: pointy.String("apiKeyId-0001"),
            RepositoryName: pointy.String("gs2io/master-data"),
            SourcePath: pointy.String("path/to/file.json"),
            ReferenceType: pointy.String("branch"),
            BranchName: pointy.String("develop"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Chat\Gs2ChatRestClient;
use Gs2\Chat\Request\UpdateCurrentModelMasterFromGitHubRequest;
$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
    $session
);
try {
    $result = $client->updateCurrentModelMasterFromGitHub(
        (new UpdateCurrentModelMasterFromGitHubRequest())
            ->withNamespaceName("namespace-0001")
            ->withCheckoutSetting((new GitHubCheckoutSetting())
                ->withApiKeyId("apiKeyId-0001")
                ->withRepositoryName("gs2io/master-data")
                ->withSourcePath("path/to/file.json")
                ->withReferenceType("branch")
                ->withBranchName("develop")
            )
    );
    $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.chat.rest.Gs2ChatRestClient;
import io.gs2.chat.request.UpdateCurrentModelMasterFromGitHubRequest;
import io.gs2.chat.result.UpdateCurrentModelMasterFromGitHubResult;
Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ChatRestClient client = new Gs2ChatRestClient(session);
try {
    UpdateCurrentModelMasterFromGitHubResult result = client.updateCurrentModelMasterFromGitHub(
        new UpdateCurrentModelMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentModelMaster 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.Gs2Chat.Gs2ChatRestClient;
using Gs2.Gs2Chat.Request.UpdateCurrentModelMasterFromGitHubRequest;
using Gs2.Gs2Chat.Result.UpdateCurrentModelMasterFromGitHubResult;
var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ChatRestClient(session);
AsyncResult<Gs2.Gs2Chat.Result.UpdateCurrentModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentModelMasterFromGitHub(
    new Gs2.Gs2Chat.Request.UpdateCurrentModelMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Chat.Model.GitHubCheckoutSetting()
            .WithApiKeyId("apiKeyId-0001")
            .WithRepositoryName("gs2io/master-data")
            .WithSourcePath("path/to/file.json")
            .WithReferenceType("branch")
            .WithBranchName("develop")
        ),
    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 Gs2Chat from '@/gs2/chat';
const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Chat.Gs2ChatRestClient(session);
try {
    const result = await client.updateCurrentModelMasterFromGitHub(
        new Gs2Chat.UpdateCurrentModelMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Chat.model.GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}from gs2 import core
from gs2 import chat
session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = chat.Gs2ChatRestClient(session)
try:
    result = client.update_current_model_master_from_git_hub(
        chat.UpdateCurrentModelMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(chat.GitHubCheckoutSetting()
                .with_api_key_id('apiKeyId-0001')
                .with_repository_name('gs2io/master-data')
                .with_source_path('path/to/file.json')
                .with_reference_type('branch')
                .with_branch_name('develop')
            )
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)client = gs2('chat')
api_result = client.update_current_model_master_from_git_hub({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;client = gs2('chat')
api_result_handler = client.update_current_model_master_from_git_hub_async({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})
api_result = api_result_handler()  -- Call the handler to get the result
if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;