NAV
go python java php typescript csharp GS2-Script

GS2-Inbox

GS2-SDK のリファレンス

モデル

Namespace

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

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

説明
namespaceId string ネームスペースGRN
name string ネームスペース名
description string 説明文
isAutomaticDeletingEnabled bool 開封したメッセージを自動的に削除するか
receiveMessageScript ScriptSetting メッセージ受信したときに実行するスクリプト
readMessageScript ScriptSetting メッセージ開封したときに実行するスクリプト
deleteMessageScript ScriptSetting メッセージ削除したときに実行するスクリプト
queueNamespaceId string スタンプシートの実行に使用する GS2-JobQueue のネームスペース
keyId string スタンプシートの発行に使用する GS2-Key のネームスペース
receiveNotification NotificationSetting メッセージを受信したときのプッシュ通知
logSetting LogSetting ログの出力設定
createdAt long 作成日時
updatedAt long 最終更新日時

Message

ゲームプレイヤー毎に用意されるメッセージボックスに届けられたメッセージデータ。

メッセージには開封状態がある他、スタンプシートを添付することができます。 メッセージには有効期限を設定でき、有効期限が切れたメッセージは自動的に削除されます。

説明
messageId string メッセージGRN
name string メッセージID
userId string ユーザーID
metadata string メッセージの内容に相当するメタデータ
isRead bool 既読状態
readAcquireActions AcquireAction[] 開封時に実行する入手アクション
receivedAt long 作成日時
readAt long 最終更新日時
expiresAt long メッセージの有効期限

CurrentMessageMaster

GS2ではマスターデータの管理にJSON形式のファイルを使用します。 ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。

JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。

JSONファイルの形式についてはドキュメントを参照ください。

説明
namespaceId string ネームスペースGRN
settings string マスターデータ

GlobalMessageMaster

グローバルメッセージはゲームプレイヤー全体にメッセージを届ける仕組みです。

グローバルメッセージには有効期間を設定でき、各ゲームプレイヤーはグローバルメッセージを受信する処理を実行することで 有効期間内のグローバルメッセージの中で未受信のメッセージを自分のメッセージボックスにコピーします。

説明
globalMessageId string 全ユーザに向けたメッセージGRN
name string 全ユーザに向けたメッセージ名
metadata string 全ユーザに向けたメッセージの内容に相当するメタデータ
readAcquireActions AcquireAction[] 開封時に実行する入手アクション
expiresTimeSpan TimeSpan_ メッセージを受信したあとメッセージが削除されるまでの期間
createdAt long 作成日時
expiresAt long 全ユーザに向けたメッセージの受信期限

GlobalMessage

グローバルメッセージはゲームプレイヤー全体にメッセージを届ける仕組みです。

グローバルメッセージには有効期間を設定でき、各ゲームプレイヤーはグローバルメッセージを受信する処理を実行することで 有効期間内のグローバルメッセージの中で未受信のメッセージを自分のメッセージボックスにコピーします。

説明
globalMessageId string 全ユーザに向けたメッセージGRN
name string 全ユーザに向けたメッセージ名
metadata string 全ユーザに向けたメッセージの内容に相当するメタデータ
readAcquireActions AcquireAction[] 開封時に実行する入手アクション
expiresTimeSpan TimeSpan_ メッセージを受信したあとメッセージが削除されるまでの期間
expiresAt long 全ユーザに向けたメッセージの有効期限

Received

受信したことのあるグローバルメッセージの名前を保持するエンティティ。

ここに記載されているグローバルメッセージは受信できなくなります。

説明
receivedId string 受信済みグローバルメッセージ名GRN
userId string ユーザーID
receivedGlobalMessageNames string[] 受信したグローバルメッセージ名
createdAt long 作成日時
updatedAt long 最終更新日時

Config

説明
key string 名前
value string

ScriptSetting

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

NotificationSetting

説明
gatewayNamespaceId string ネームスペースGRN
enableTransferMobileNotification bool モバイルプッシュ通知へ転送するか
sound string モバイルプッシュ通知で使用するサウンドファイル名

GitHubCheckoutSetting

説明
apiKeyId string GitHub のAPIキーGRN
repositoryName string リポジトリ名
sourcePath string ソースコードのファイルパス
referenceType string コードの取得元
commitHash string コミットハッシュ
branchName string ブランチ名
tagName string タグ名

LogSetting

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

TimeSpan

説明
days int 現在時刻からの日数
hours int 現在時刻からの時間
minutes int 現在時刻からの分

AcquireAction

説明
action string スタンプシートで実行するアクションの種類
request string 消費リクエストのJSON

メソッド

describeNamespaces

describeNamespaces

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &inbox.DescribeNamespacesRequest {
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\DescribeNamespacesRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeNamespaces(
    new DescribeNamespacesRequest()
        .withPageToken(null)
        .withLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Inbox from '@/gs2/inbox';

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

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

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

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

client = gs2('inbox')

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

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

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

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

Request

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

Result

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

createNamespace

createNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &inbox.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        IsAutomaticDeletingEnabled: nil,
        ReceiveMessageScript: nil,
        ReadMessageScript: nil,
        DeleteMessageScript: nil,
        QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1"),
        KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"),
        ReceiveNotification: nil,
        LogSetting: &inbox.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName(self::namespace1)
            ->withDescription(null)
            ->withIsAutomaticDeletingEnabled(null)
            ->withReceiveMessageScript(null)
            ->withReadMessageScript(null)
            ->withDeleteMessageScript(null)
            ->withQueueNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1')
            ->withKeyId('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001')
            ->withReceiveNotification(null)
            ->withLogSetting((new \Gs2\Inbox\Model\LogSetting())
                ->withLoggingNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.CreateNamespaceRequest;
import io.gs2.inbox.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withIsAutomaticDeletingEnabled(null)
            .withReceiveMessageScript(null)
            .withReadMessageScript(null)
            .withDeleteMessageScript(null)
            .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1")
            .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001")
            .withReceiveNotification(null)
            .withLogSetting(new io.gs2.inbox.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.CreateNamespaceRequest;
using Gs2.Gs2Inbox.Result.CreateNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createNamespace(
    new CreateNamespaceRequest()
        .withName("namespace1")
        .withDescription(null)
        .withIsAutomaticDeletingEnabled(null)
        .withReceiveMessageScript(null)
        .withReadMessageScript(null)
        .withDeleteMessageScript(null)
        .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1")
        .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001")
        .withReceiveNotification(null)
        .withLogSetting(new Gs2.Gs2Inbox.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.createNamespace(
        new Gs2Inbox.CreateNamespaceRequest()
            .withName('namespace1')
            .withDescription(undefined)
            .withIsAutomaticDeletingEnabled(undefined)
            .withReceiveMessageScript(undefined)
            .withReadMessageScript(undefined)
            .withDeleteMessageScript(undefined)
            .withQueueNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1')
            .withKeyId('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001')
            .withReceiveNotification(undefined)
            .withLogSetting(new Gs2Inbox.Model.LogSetting()
                .withLoggingNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.create_namespace(
        new inbox.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_is_automatic_deleting_enabled(None)
            .with_receive_message_script(None)
            .with_read_message_script(None)
            .with_delete_message_script(None)
            .with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1')
            .with_key_id('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001')
            .with_receive_notification(None)
            .with_log_setting(
                inbox.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.create_namespace({
    name='namespace1',
    description=nil,
    isAutomaticDeletingEnabled=nil,
    receiveMessageScript=nil,
    readMessageScript=nil,
    deleteMessageScript=nil,
    queueNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1',
    keyId='grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001',
    receiveNotification=nil,
    logSetting={
        loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1',
    },
});

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

result = api_result.result
item = result.item;

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

Request

必須 デフォルト 値の制限 説明
name string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
isAutomaticDeletingEnabled bool 開封したメッセージを自動的に削除するか
receiveMessageScript ScriptSetting メッセージ受信したときに実行するスクリプト
readMessageScript ScriptSetting メッセージ開封したときに実行するスクリプト
deleteMessageScript ScriptSetting メッセージ削除したときに実行するスクリプト
queueNamespaceId string ~ 1024文字 スタンプシートの実行に使用する GS2-JobQueue のネームスペース
keyId string ~ 1024文字 スタンプシートの発行に使用する GS2-Key のネームスペース
receiveNotification NotificationSetting メッセージを受信したときのプッシュ通知
logSetting LogSetting ログの出力設定

Result

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

getNamespaceStatus

getNamespaceStatus

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &inbox.GetNamespaceStatusRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\GetNamespaceStatusRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

client = gs2('inbox')

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

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

result = api_result.result
status = result.status;

ネームスペースの状態を取得

Request

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

Result

説明
status string

getNamespace

getNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &inbox.GetNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\GetNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

client = gs2('inbox')

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

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

result = api_result.result
item = result.item;

ネームスペースを取得

Request

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

Result

説明
item Namespace ネームスペース

updateNamespace

updateNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &inbox.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        IsAutomaticDeletingEnabled: pointy.Bool(false),
        ReceiveMessageScript: &inbox.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1001"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002"),
        },
        ReadMessageScript: &inbox.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004"),
        },
        DeleteMessageScript: &inbox.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1005"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1006"),
        },
        QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1"),
        KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"),
        ReceiveNotification: nil,
        LogSetting: &inbox.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName(self::namespace1)
            ->withDescription('description1')
            ->withIsAutomaticDeletingEnabled(False)
            ->withReceiveMessageScript((new \Gs2\Inbox\Model\ScriptSetting())
                ->withTriggerScriptId('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1001')
                ->withDoneTriggerScriptId('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002'))
            ->withReadMessageScript((new \Gs2\Inbox\Model\ScriptSetting())
                ->withTriggerScriptId('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003')
                ->withDoneTriggerScriptId('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004'))
            ->withDeleteMessageScript((new \Gs2\Inbox\Model\ScriptSetting())
                ->withTriggerScriptId('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1005')
                ->withDoneTriggerScriptId('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1006'))
            ->withQueueNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1')
            ->withKeyId('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001')
            ->withReceiveNotification(null)
            ->withLogSetting((new \Gs2\Inbox\Model\LogSetting())
                ->withLoggingNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.UpdateNamespaceRequest;
import io.gs2.inbox.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withIsAutomaticDeletingEnabled(false)
            .withReceiveMessageScript(new io.gs2.inbox.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1001")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002"))
            .withReadMessageScript(new io.gs2.inbox.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004"))
            .withDeleteMessageScript(new io.gs2.inbox.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1005")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1006"))
            .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1")
            .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001")
            .withReceiveNotification(null)
            .withLogSetting(new io.gs2.inbox.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.UpdateNamespaceRequest;
using Gs2.Gs2Inbox.Result.UpdateNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateNamespace(
    new UpdateNamespaceRequest()
        .withNamespaceName("namespace1")
        .withDescription("description1")
        .withIsAutomaticDeletingEnabled(false)
        .withReceiveMessageScript(new Gs2.Gs2Inbox.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1001")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002"))
        .withReadMessageScript(new Gs2.Gs2Inbox.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004"))
        .withDeleteMessageScript(new Gs2.Gs2Inbox.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1005")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1006"))
        .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1")
        .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001")
        .withReceiveNotification(null)
        .withLogSetting(new Gs2.Gs2Inbox.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.updateNamespace(
        new Gs2Inbox.UpdateNamespaceRequest()
            .withNamespaceName('namespace1')
            .withDescription('description1')
            .withIsAutomaticDeletingEnabled(false)
            .withReceiveMessageScript(new Gs2Inbox.Model.ScriptSetting()
                .withTriggerScriptId('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1001')
                .withDoneTriggerScriptId('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002'))
            .withReadMessageScript(new Gs2Inbox.Model.ScriptSetting()
                .withTriggerScriptId('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003')
                .withDoneTriggerScriptId('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004'))
            .withDeleteMessageScript(new Gs2Inbox.Model.ScriptSetting()
                .withTriggerScriptId('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1005')
                .withDoneTriggerScriptId('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1006'))
            .withQueueNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1')
            .withKeyId('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001')
            .withReceiveNotification(undefined)
            .withLogSetting(new Gs2Inbox.Model.LogSetting()
                .withLoggingNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.update_namespace(
        new inbox.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_is_automatic_deleting_enabled(False)
            .with_receive_message_script(
                inbox.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1001')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002'))
            .with_read_message_script(
                inbox.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004'))
            .with_delete_message_script(
                inbox.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1005')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1006'))
            .with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1')
            .with_key_id('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001')
            .with_receive_notification(None)
            .with_log_setting(
                inbox.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.update_namespace({
    namespaceName='namespace1',
    description='description1',
    isAutomaticDeletingEnabled=false,
    receiveMessageScript={
        triggerScriptId='grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1001',
        doneTriggerScriptId='grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1002',
    },
    readMessageScript={
        triggerScriptId='grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1003',
        doneTriggerScriptId='grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1004',
    },
    deleteMessageScript={
        triggerScriptId='grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1005',
        doneTriggerScriptId='grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-1006',
    },
    queueNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:queue:namespace1',
    keyId='grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001',
    receiveNotification=nil,
    logSetting={
        loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1',
    },
});

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

result = api_result.result
item = result.item;

ネームスペースを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
isAutomaticDeletingEnabled bool 開封したメッセージを自動的に削除するか
receiveMessageScript ScriptSetting メッセージ受信したときに実行するスクリプト
readMessageScript ScriptSetting メッセージ開封したときに実行するスクリプト
deleteMessageScript ScriptSetting メッセージ削除したときに実行するスクリプト
queueNamespaceId string ~ 1024文字 スタンプシートの実行に使用する GS2-JobQueue のネームスペース
keyId string ~ 1024文字 スタンプシートの発行に使用する GS2-Key のネームスペース
receiveNotification NotificationSetting メッセージを受信したときのプッシュ通知
logSetting LogSetting ログの出力設定

Result

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

deleteNamespace

deleteNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &inbox.DeleteNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\DeleteNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

client = gs2('inbox')

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

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

result = api_result.result
item = result.item;

ネームスペースを削除

Request

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

Result

説明
item Namespace 削除したネームスペース

describeMessages

describeMessages

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.DescribeMessages(
    &inbox.DescribeMessagesRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\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(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.DescribeMessagesRequest;
import io.gs2.inbox.result.DescribeMessagesResult;

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

try {
    DescribeMessagesResult result = client.describeMessages(
        new DescribeMessagesRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.DescribeMessagesRequest;
using Gs2.Gs2Inbox.Result.DescribeMessagesResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeMessages(
    new DescribeMessagesRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.describeMessages(
        new Gs2Inbox.DescribeMessagesRequest()
            .withNamespaceName('namespace1')
            .withAccessToken('$access_token_0001')
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.describe_messages(
        new inbox.DescribeMessagesRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.describe_messages({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    pageToken=nil,
    limit=nil,
});

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

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

メッセージの一覧を取得

Request

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

Result

説明
items Message[] メッセージのリスト
nextPageToken string リストの続きを取得するためのページトークン

describeMessagesByUserId

describeMessagesByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.DescribeMessagesByUserId(
    &inbox.DescribeMessagesByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\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(self::namespace1)
            ->withUserId('user-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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.DescribeMessagesByUserIdRequest;
import io.gs2.inbox.result.DescribeMessagesByUserIdResult;

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

try {
    DescribeMessagesByUserIdResult result = client.describeMessagesByUserId(
        new DescribeMessagesByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.DescribeMessagesByUserIdRequest;
using Gs2.Gs2Inbox.Result.DescribeMessagesByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeMessagesByUserId(
    new DescribeMessagesByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.describeMessagesByUserId(
        new Gs2Inbox.DescribeMessagesByUserIdRequest()
            .withNamespaceName('namespace1')
            .withUserId('user-0001')
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.describe_messages_by_user_id(
        new inbox.DescribeMessagesByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.describe_messages_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    pageToken=nil,
    limit=nil,
});

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

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

メッセージの一覧を取得

Request

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

Result

説明
items Message[] メッセージのリスト
nextPageToken string リストの続きを取得するためのページトークン

sendMessageByUserId

sendMessageByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.SendMessageByUserId(
    &inbox.SendMessageByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        Metadata: pointy.String("{\"type\": \"message\", \"body\": \"hello\"}"),
        ReadAcquireActions: nil,
        ExpiresAt: nil,
        ExpiresTimeSpan: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\SendMessageByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->sendMessageByUserId(
        (new SendMessageByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId('user-0001')
            ->withMetadata('{"type": "message", "body": "hello"}')
            ->withReadAcquireActions(null)
            ->withExpiresAt(null)
            ->withExpiresTimeSpan(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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.SendMessageByUserIdRequest;
import io.gs2.inbox.result.SendMessageByUserIdResult;

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

try {
    SendMessageByUserIdResult result = client.sendMessageByUserId(
        new SendMessageByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withMetadata("{\"type\": \"message\", \"body\": \"hello\"}")
            .withReadAcquireActions(null)
            .withExpiresAt(null)
            .withExpiresTimeSpan(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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.SendMessageByUserIdRequest;
using Gs2.Gs2Inbox.Result.SendMessageByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.sendMessageByUserId(
    new SendMessageByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001")
        .withMetadata("{\"type\": \"message\", \"body\": \"hello\"}")
        .withReadAcquireActions(null)
        .withExpiresAt(null)
        .withExpiresTimeSpan(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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.sendMessageByUserId(
        new Gs2Inbox.SendMessageByUserIdRequest()
            .withNamespaceName('namespace1')
            .withUserId('user-0001')
            .withMetadata('{"type": "message", "body": "hello"}')
            .withReadAcquireActions(undefined)
            .withExpiresAt(undefined)
            .withExpiresTimeSpan(undefined)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.send_message_by_user_id(
        new inbox.SendMessageByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_metadata('{"type": "message", "body": "hello"}')
            .with_read_acquire_actions(None)
            .with_expires_at(None)
            .with_expires_time_span(None)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.send_message_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    metadata='{"type": "message", "body": "hello"}',
    readAcquireActions=nil,
    expiresAt=nil,
    expiresTimeSpan=nil,
});

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

result = api_result.result
item = result.item;

メッセージを新規作成

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
metadata string ~ 4096文字 メッセージの内容に相当するメタデータ
readAcquireActions AcquireAction[] [] 開封時に実行する入手アクション
expiresAt long メッセージの有効期限
expiresTimeSpan TimeSpan_ メッセージの有効期限までの差分

Result

説明
item Message 作成したメッセージ

getMessage

getMessage

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.GetMessage(
    &inbox.GetMessageRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        MessageName: pointy.String("$message1.name"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\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(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withMessageName(self::$message1.name)
    );
    $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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.GetMessageRequest;
import io.gs2.inbox.result.GetMessageResult;

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

try {
    GetMessageResult result = client.getMessage(
        new GetMessageRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withMessageName("$message1.name")
    );
    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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.GetMessageRequest;
using Gs2.Gs2Inbox.Result.GetMessageResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getMessage(
    new GetMessageRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withMessageName("$message1.name"),
    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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.getMessage(
        new Gs2Inbox.GetMessageRequest()
            .withNamespaceName('namespace1')
            .withAccessToken('$access_token_0001')
            .withMessageName('$message1.name')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.get_message(
        new inbox.GetMessageRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_message_name(self.message1.name)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.get_message({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    messageName='$message1.name',
});

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

result = api_result.result
item = result.item;

メッセージを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
messageName string UUID ~ 36文字 メッセージID

Result

説明
item Message メッセージ

getMessageByUserId

getMessageByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.GetMessageByUserId(
    &inbox.GetMessageByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        MessageName: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\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(self::namespace1)
            ->withUserId('user-0001')
            ->withMessageName(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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.GetMessageByUserIdRequest;
import io.gs2.inbox.result.GetMessageByUserIdResult;

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

try {
    GetMessageByUserIdResult result = client.getMessageByUserId(
        new GetMessageByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withMessageName(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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.GetMessageByUserIdRequest;
using Gs2.Gs2Inbox.Result.GetMessageByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getMessageByUserId(
    new GetMessageByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001")
        .withMessageName(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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.getMessageByUserId(
        new Gs2Inbox.GetMessageByUserIdRequest()
            .withNamespaceName('namespace1')
            .withUserId('user-0001')
            .withMessageName(undefined)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.get_message_by_user_id(
        new inbox.GetMessageByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_message_name(None)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.get_message_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    messageName=nil,
});

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

result = api_result.result
item = result.item;

ユーザーIDを指定してメッセージを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
messageName string UUID ~ 36文字 メッセージID

Result

説明
item Message メッセージ

receiveGlobalMessage

receiveGlobalMessage

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.ReceiveGlobalMessage(
    &inbox.ReceiveGlobalMessageRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\ReceiveGlobalMessageRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->receiveGlobalMessage(
        (new ReceiveGlobalMessageRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
    );
    $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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.ReceiveGlobalMessageRequest;
import io.gs2.inbox.result.ReceiveGlobalMessageResult;

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

try {
    ReceiveGlobalMessageResult result = client.receiveGlobalMessage(
        new ReceiveGlobalMessageRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
    );
    List<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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.ReceiveGlobalMessageRequest;
using Gs2.Gs2Inbox.Result.ReceiveGlobalMessageResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.receiveGlobalMessage(
    new ReceiveGlobalMessageRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.receiveGlobalMessage(
        new Gs2Inbox.ReceiveGlobalMessageRequest()
            .withNamespaceName('namespace1')
            .withAccessToken('$access_token_0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.receive_global_message(
        new inbox.ReceiveGlobalMessageRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.receive_global_message({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
});

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

result = api_result.result
item = result.item;

グローバルメッセージのうちまだ受け取っていないメッセージを受信

Request

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

Result

説明
item Message[] 受信したメッセージ一覧

receiveGlobalMessageByUserId

receiveGlobalMessageByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.ReceiveGlobalMessageByUserId(
    &inbox.ReceiveGlobalMessageByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\ReceiveGlobalMessageByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->receiveGlobalMessageByUserId(
        (new ReceiveGlobalMessageByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId('user-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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.ReceiveGlobalMessageByUserIdRequest;
import io.gs2.inbox.result.ReceiveGlobalMessageByUserIdResult;

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

try {
    ReceiveGlobalMessageByUserIdResult result = client.receiveGlobalMessageByUserId(
        new ReceiveGlobalMessageByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
    );
    List<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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.ReceiveGlobalMessageByUserIdRequest;
using Gs2.Gs2Inbox.Result.ReceiveGlobalMessageByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.receiveGlobalMessageByUserId(
    new ReceiveGlobalMessageByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.receiveGlobalMessageByUserId(
        new Gs2Inbox.ReceiveGlobalMessageByUserIdRequest()
            .withNamespaceName('namespace1')
            .withUserId('user-0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.receive_global_message_by_user_id(
        new inbox.ReceiveGlobalMessageByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.receive_global_message_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
});

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

result = api_result.result
item = result.item;

ユーザーIDを指定してグローバルメッセージのうちまだ受け取っていないメッセージを受信

Request

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

Result

説明
item Message[] 受信したメッセージ一覧

openMessage

openMessage

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.OpenMessage(
    &inbox.OpenMessageRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        MessageName: pointy.String("message-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\OpenMessageRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->openMessage(
        (new OpenMessageRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withMessageName('message-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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.OpenMessageRequest;
import io.gs2.inbox.result.OpenMessageResult;

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

try {
    OpenMessageResult result = client.openMessage(
        new OpenMessageRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withMessageName("message-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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.OpenMessageRequest;
using Gs2.Gs2Inbox.Result.OpenMessageResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.openMessage(
    new OpenMessageRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withMessageName("message-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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.openMessage(
        new Gs2Inbox.OpenMessageRequest()
            .withNamespaceName('namespace1')
            .withAccessToken('$access_token_0001')
            .withMessageName('message-0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.open_message(
        new inbox.OpenMessageRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_message_name('message-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.open_message({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    messageName='message-0001',
});

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

result = api_result.result
item = result.item;

メッセージを開封

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
messageName string UUID ~ 36文字 メッセージID

Result

説明
item Message メッセージ

openMessageByUserId

openMessageByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.OpenMessageByUserId(
    &inbox.OpenMessageByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        MessageName: pointy.String("$message1.name"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\OpenMessageByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->openMessageByUserId(
        (new OpenMessageByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId('user-0001')
            ->withMessageName(self::$message1.name)
    );
    $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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.OpenMessageByUserIdRequest;
import io.gs2.inbox.result.OpenMessageByUserIdResult;

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

try {
    OpenMessageByUserIdResult result = client.openMessageByUserId(
        new OpenMessageByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withMessageName("$message1.name")
    );
    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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.OpenMessageByUserIdRequest;
using Gs2.Gs2Inbox.Result.OpenMessageByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.openMessageByUserId(
    new OpenMessageByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001")
        .withMessageName("$message1.name"),
    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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.openMessageByUserId(
        new Gs2Inbox.OpenMessageByUserIdRequest()
            .withNamespaceName('namespace1')
            .withUserId('user-0001')
            .withMessageName('$message1.name')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.open_message_by_user_id(
        new inbox.OpenMessageByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_message_name(self.message1.name)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.open_message_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    messageName='$message1.name',
});

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

result = api_result.result
item = result.item;

ユーザーIDを指定してメッセージを開封

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
messageName string UUID ~ 36文字 メッセージID

Result

説明
item Message メッセージ

readMessage

readMessage

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.ReadMessage(
    &inbox.ReadMessageRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        MessageName: pointy.String("message-0001"),
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\ReadMessageRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->readMessage(
        (new ReadMessageRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withMessageName('message-0001')
            ->withConfig(null)
    );
    $item = $result->getItem();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
} 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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.ReadMessageRequest;
import io.gs2.inbox.result.ReadMessageResult;

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

try {
    ReadMessageResult result = client.readMessage(
        new ReadMessageRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withMessageName("message-0001")
            .withConfig(null)
    );
    Message item = result.getItem();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
} 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.ReadMessageRequest;
using Gs2.Gs2Inbox.Result.ReadMessageResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.readMessage(
    new ReadMessageRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withMessageName("message-0001")
        .withConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
import Gs2Core from '@/gs2/core';
import * as Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.readMessage(
        new Gs2Inbox.ReadMessageRequest()
            .withNamespaceName('namespace1')
            .withAccessToken('$access_token_0001')
            .withMessageName('message-0001')
            .withConfig(undefined)
    );
    const item = result.getItem();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.read_message(
        new inbox.ReadMessageRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_message_name('message-0001')
            .with_config(None)
    )
    item = result.item
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.read_message({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    messageName='message-0001',
    config=nil,
});

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

result = api_result.result
item = result.item;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;

メッセージを開封

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
messageName string UUID ~ 36文字 メッセージID
config Config[] [] スタンプシートの変数に適用する設定値

Result

説明
item Message メッセージ
stampSheet string スタンプシート
stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN

readMessageByUserId

readMessageByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.ReadMessageByUserId(
    &inbox.ReadMessageByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        MessageName: pointy.String("message-0001"),
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\ReadMessageByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->readMessageByUserId(
        (new ReadMessageByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId('user-0001')
            ->withMessageName('message-0001')
            ->withConfig(null)
    );
    $item = $result->getItem();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
} 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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.ReadMessageByUserIdRequest;
import io.gs2.inbox.result.ReadMessageByUserIdResult;

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

try {
    ReadMessageByUserIdResult result = client.readMessageByUserId(
        new ReadMessageByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withMessageName("message-0001")
            .withConfig(null)
    );
    Message item = result.getItem();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
} 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.ReadMessageByUserIdRequest;
using Gs2.Gs2Inbox.Result.ReadMessageByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.readMessageByUserId(
    new ReadMessageByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001")
        .withMessageName("message-0001")
        .withConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
import Gs2Core from '@/gs2/core';
import * as Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.readMessageByUserId(
        new Gs2Inbox.ReadMessageByUserIdRequest()
            .withNamespaceName('namespace1')
            .withUserId('user-0001')
            .withMessageName('message-0001')
            .withConfig(undefined)
    );
    const item = result.getItem();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.read_message_by_user_id(
        new inbox.ReadMessageByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_message_name('message-0001')
            .with_config(None)
    )
    item = result.item
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.read_message_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    messageName='message-0001',
    config=nil,
});

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

result = api_result.result
item = result.item;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;

ユーザーIDを指定してメッセージを開封

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
messageName string UUID ~ 36文字 メッセージID
config Config[] [] スタンプシートの変数に適用する設定値

Result

説明
item Message メッセージ
stampSheet string スタンプシート
stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN

deleteMessage

deleteMessage

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.DeleteMessage(
    &inbox.DeleteMessageRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        MessageName: pointy.String("$message1.name"),
    }
)
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\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\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(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withMessageName(self::$message1.name)
    );
} 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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.DeleteMessageRequest;
import io.gs2.inbox.result.DeleteMessageResult;

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

try {
    DeleteMessageResult result = client.deleteMessage(
        new DeleteMessageRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withMessageName("$message1.name")
    );
} 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.DeleteMessageRequest;
using Gs2.Gs2Inbox.Result.DeleteMessageResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteMessage(
    new DeleteMessageRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withMessageName("$message1.name"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.deleteMessage(
        new Gs2Inbox.DeleteMessageRequest()
            .withNamespaceName('namespace1')
            .withAccessToken('$access_token_0001')
            .withMessageName('$message1.name')
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.delete_message(
        new inbox.DeleteMessageRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_message_name(self.message1.name)
    )
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.delete_message({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    messageName='$message1.name',
});

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

result = api_result.result

メッセージを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
messageName string UUID ~ 36文字 メッセージID

Result

説明

deleteMessageByUserId

deleteMessageByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.DeleteMessageByUserId(
    &inbox.DeleteMessageByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        MessageName: 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\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\DeleteMessageByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteMessageByUserId(
        (new DeleteMessageByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId('user-0001')
            ->withMessageName(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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.DeleteMessageByUserIdRequest;
import io.gs2.inbox.result.DeleteMessageByUserIdResult;

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

try {
    DeleteMessageByUserIdResult result = client.deleteMessageByUserId(
        new DeleteMessageByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withMessageName(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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.DeleteMessageByUserIdRequest;
using Gs2.Gs2Inbox.Result.DeleteMessageByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteMessageByUserId(
    new DeleteMessageByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001")
        .withMessageName(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.deleteMessageByUserId(
        new Gs2Inbox.DeleteMessageByUserIdRequest()
            .withNamespaceName('namespace1')
            .withUserId('user-0001')
            .withMessageName(undefined)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.delete_message_by_user_id(
        new inbox.DeleteMessageByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_message_name(None)
    )
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.delete_message_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    messageName=nil,
});

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

result = api_result.result

ユーザーIDを指定してメッセージを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
messageName string UUID ~ 36文字 メッセージID

Result

説明

openByStampTask

openByStampTask

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.OpenByStampTask(
    &inbox.OpenByStampTaskRequest {
        StampTask: pointy.String("$stampTask"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\OpenByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->openByStampTask(
        (new OpenByStampTaskRequest())
            ->withStampTask(self::$stampTask)
            ->withKeyId(self::$key1.keyId)
    );
    $item = $result->getItem();
    $newContextStack = $result->getNewContextStack();
} 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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.OpenByStampTaskRequest;
import io.gs2.inbox.result.OpenByStampTaskResult;

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

try {
    OpenByStampTaskResult result = client.openByStampTask(
        new OpenByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    Message item = result.getItem();
    String newContextStack = result.getNewContextStack();
} 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.OpenByStampTaskRequest;
using Gs2.Gs2Inbox.Result.OpenByStampTaskResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.openByStampTask(
    new OpenByStampTaskRequest()
        .withStampTask("$stampTask")
        .withKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.openByStampTask(
        new Gs2Inbox.OpenByStampTaskRequest()
            .withStampTask('$stampTask')
            .withKeyId('$key1.keyId')
    );
    const item = result.getItem();
    const newContextStack = result.getNewContextStack();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.open_by_stamp_task(
        new inbox.OpenByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.open_by_stamp_task({
    stampTask='$stampTask',
    keyId='$key1.keyId',
});

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

result = api_result.result
item = result.item;
newContextStack = result.newContextStack;

メッセージを作成

Request

必須 デフォルト 値の制限 説明
stampTask string ~ 5242880文字 スタンプタスク
keyId string ~ 1024文字 暗号鍵GRN

Result

説明
item Message メッセージ
newContextStack string スタンプタスクの実行結果を記録したコンテキスト

exportMaster

exportMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &inbox.ExportMasterRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\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(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.ExportMasterRequest;
import io.gs2.inbox.result.ExportMasterResult;

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

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentMessageMaster 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.ExportMasterRequest;
using Gs2.Gs2Inbox.Result.ExportMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.exportMaster(
    new ExportMasterRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.exportMaster(
        new Gs2Inbox.ExportMasterRequest()
            .withNamespaceName('namespace1')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.export_master(
        new inbox.ExportMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

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

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

result = api_result.result
item = result.item;

現在有効なグローバルメッセージ設定のマスターデータをエクスポートします

Request

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

Result

説明
item CurrentMessageMaster 現在有効なグローバルメッセージ設定

getCurrentMessageMaster

getCurrentMessageMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.GetCurrentMessageMaster(
    &inbox.GetCurrentMessageMasterRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\GetCurrentMessageMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCurrentMessageMaster(
        (new GetCurrentMessageMasterRequest())
            ->withNamespaceName(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.GetCurrentMessageMasterRequest;
import io.gs2.inbox.result.GetCurrentMessageMasterResult;

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

try {
    GetCurrentMessageMasterResult result = client.getCurrentMessageMaster(
        new GetCurrentMessageMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentMessageMaster 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.GetCurrentMessageMasterRequest;
using Gs2.Gs2Inbox.Result.GetCurrentMessageMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getCurrentMessageMaster(
    new GetCurrentMessageMasterRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.getCurrentMessageMaster(
        new Gs2Inbox.GetCurrentMessageMasterRequest()
            .withNamespaceName('namespace1')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.get_current_message_master(
        new inbox.GetCurrentMessageMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

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

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

result = api_result.result
item = result.item;

現在有効なグローバルメッセージ設定を取得します

Request

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

Result

説明
item CurrentMessageMaster 現在有効なグローバルメッセージ設定

updateCurrentMessageMaster

updateCurrentMessageMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentMessageMaster(
    &inbox.UpdateCurrentMessageMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Settings: pointy.String(`{
          "version": "2020-03-12",
          "globalMessages": [
            {
              "name": "message-0001",
              "metadata": "hoge"
            },
            {
              "name": "message-0002",
              "metadata": "fuga",
              "readAcquireActions": [
                {
                  "action": "Gs2Inventory:AcquireItemSetByUserId",
                  "request": "Gs2Inventory:AcquireItemSetByUserId-request"
                }
              ],
              "expiresTimeSpan": {
                "days": 1,
                "hours": 2,
                "minutes": 3
              }
            },
            {
              "name": "message-0003",
              "metadata": "piyo",
              "expiresAt": 1000
            }
          ]
        }`),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\UpdateCurrentMessageMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentMessageMaster(
        (new UpdateCurrentMessageMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSettings("{
              \"version\": \"2020-03-12\",
              \"globalMessages\": [
                {
                  \"name\": \"message-0001\",
                  \"metadata\": \"hoge\"
                },
                {
                  \"name\": \"message-0002\",
                  \"metadata\": \"fuga\",
                  \"readAcquireActions\": [
                    {
                      \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",
                      \"request\": \"Gs2Inventory:AcquireItemSetByUserId-request\"
                    }
                  ],
                  \"expiresTimeSpan\": {
                    \"days\": 1,
                    \"hours\": 2,
                    \"minutes\": 3
                  }
                },
                {
                  \"name\": \"message-0003\",
                  \"metadata\": \"piyo\",
                  \"expiresAt\": 1000
                }
              ]
            }")
    );
    $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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.UpdateCurrentMessageMasterRequest;
import io.gs2.inbox.result.UpdateCurrentMessageMasterResult;

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

try {
    UpdateCurrentMessageMasterResult result = client.updateCurrentMessageMaster(
        new UpdateCurrentMessageMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n  \"version\": \"2020-03-12\",\n  \"globalMessages\": [\n    {\n      \"name\": \"message-0001\",\n      \"metadata\": \"hoge\"\n    },\n    {\n      \"name\": \"message-0002\",\n      \"metadata\": \"fuga\",\n      \"readAcquireActions\": [\n        {\n          \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n          \"request\": \"Gs2Inventory:AcquireItemSetByUserId-request\"\n        }\n      ],\n      \"expiresTimeSpan\": {\n        \"days\": 1,\n        \"hours\": 2,\n        \"minutes\": 3\n      }\n    },\n    {\n      \"name\": \"message-0003\",\n      \"metadata\": \"piyo\",\n      \"expiresAt\": 1000\n    }\n  ]\n}")
    );
    CurrentMessageMaster 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.UpdateCurrentMessageMasterRequest;
using Gs2.Gs2Inbox.Result.UpdateCurrentMessageMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCurrentMessageMaster(
    new UpdateCurrentMessageMasterRequest()
        .withNamespaceName("namespace1")
        .withSettings("{\n  \"version\": \"2020-03-12\",\n  \"globalMessages\": [\n    {\n      \"name\": \"message-0001\",\n      \"metadata\": \"hoge\"\n    },\n    {\n      \"name\": \"message-0002\",\n      \"metadata\": \"fuga\",\n      \"readAcquireActions\": [\n        {\n          \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n          \"request\": \"Gs2Inventory:AcquireItemSetByUserId-request\"\n        }\n      ],\n      \"expiresTimeSpan\": {\n        \"days\": 1,\n        \"hours\": 2,\n        \"minutes\": 3\n      }\n    },\n    {\n      \"name\": \"message-0003\",\n      \"metadata\": \"piyo\",\n      \"expiresAt\": 1000\n    }\n  ]\n}"),
    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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.updateCurrentMessageMaster(
        new Gs2Inbox.UpdateCurrentMessageMasterRequest()
            .withNamespaceName('namespace1')
            .withSettings(`{
              "version": "2020-03-12",
              "globalMessages": [
                {
                  "name": "message-0001",
                  "metadata": "hoge"
                },
                {
                  "name": "message-0002",
                  "metadata": "fuga",
                  "readAcquireActions": [
                    {
                      "action": "Gs2Inventory:AcquireItemSetByUserId",
                      "request": "Gs2Inventory:AcquireItemSetByUserId-request"
                    }
                  ],
                  "expiresTimeSpan": {
                    "days": 1,
                    "hours": 2,
                    "minutes": 3
                  }
                },
                {
                  "name": "message-0003",
                  "metadata": "piyo",
                  "expiresAt": 1000
                }
              ]
            }`)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.update_current_message_master(
        new inbox.UpdateCurrentMessageMasterRequest()
            .with_namespace_name(self.hash1)
            .with_settings('{\n  "version": "2020-03-12",\n  "globalMessages": [\n    {\n      "name": "message-0001",\n      "metadata": "hoge"\n    },\n    {\n      "name": "message-0002",\n      "metadata": "fuga",\n      "readAcquireActions": [\n        {\n          "action": "Gs2Inventory:AcquireItemSetByUserId",\n          "request": "Gs2Inventory:AcquireItemSetByUserId-request"\n        }\n      ],\n      "expiresTimeSpan": {\n        "days": 1,\n        "hours": 2,\n        "minutes": 3\n      }\n    },\n    {\n      "name": "message-0003",\n      "metadata": "piyo",\n      "expiresAt": 1000\n    }\n  ]\n}')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.update_current_message_master({
    namespaceName='namespace1',
    settings='{\n  "version": "2020-03-12",\n  "globalMessages": [\n    {\n      "name": "message-0001",\n      "metadata": "hoge"\n    },\n    {\n      "name": "message-0002",\n      "metadata": "fuga",\n      "readAcquireActions": [\n        {\n          "action": "Gs2Inventory:AcquireItemSetByUserId",\n          "request": "Gs2Inventory:AcquireItemSetByUserId-request"\n        }\n      ],\n      "expiresTimeSpan": {\n        "days": 1,\n        "hours": 2,\n        "minutes": 3\n      }\n    },\n    {\n      "name": "message-0003",\n      "metadata": "piyo",\n      "expiresAt": 1000\n    }\n  ]\n}',
});

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

result = api_result.result
item = result.item;

現在有効なグローバルメッセージ設定を更新します

Request

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

Result

説明
item CurrentMessageMaster 更新した現在有効なグローバルメッセージ設定

updateCurrentMessageMasterFromGitHub

updateCurrentMessageMasterFromGitHub

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentMessageMasterFromGitHub(
    &inbox.UpdateCurrentMessageMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace1"),
        CheckoutSetting: {'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'},
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\UpdateCurrentMessageMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentMessageMasterFromGitHub(
        (new UpdateCurrentMessageMasterFromGitHubRequest())
            ->withNamespaceName(self::namespace1)
            ->withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': '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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.UpdateCurrentMessageMasterFromGitHubRequest;
import io.gs2.inbox.result.UpdateCurrentMessageMasterFromGitHubResult;

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

try {
    UpdateCurrentMessageMasterFromGitHubResult result = client.updateCurrentMessageMasterFromGitHub(
        new UpdateCurrentMessageMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    CurrentMessageMaster 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.UpdateCurrentMessageMasterFromGitHubRequest;
using Gs2.Gs2Inbox.Result.UpdateCurrentMessageMasterFromGitHubResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCurrentMessageMasterFromGitHub(
    new UpdateCurrentMessageMasterFromGitHubRequest()
        .withNamespaceName("namespace1")
        .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': '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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.updateCurrentMessageMasterFromGitHub(
        new Gs2Inbox.UpdateCurrentMessageMasterFromGitHubRequest()
            .withNamespaceName('namespace1')
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.update_current_message_master_from_git_hub(
        new inbox.UpdateCurrentMessageMasterFromGitHubRequest()
            .with_namespace_name(self.hash1)
            .with_checkout_setting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.update_current_message_master_from_git_hub({
    namespaceName='namespace1',
    checkoutSetting={'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'},
});

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

result = api_result.result
item = result.item;

現在有効なグローバルメッセージ設定を更新します

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
checkoutSetting GitHubCheckoutSetting GitHubからマスターデータをチェックアウトしてくる設定

Result

説明
item CurrentMessageMaster 更新した現在有効なグローバルメッセージ設定

describeGlobalMessageMasters

describeGlobalMessageMasters

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.DescribeGlobalMessageMasters(
    &inbox.DescribeGlobalMessageMastersRequest {
        NamespaceName: pointy.String("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\DescribeGlobalMessageMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeGlobalMessageMastersResult result = client.describeGlobalMessageMasters(
        new DescribeGlobalMessageMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<GlobalMessageMaster> 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.DescribeGlobalMessageMastersRequest;
using Gs2.Gs2Inbox.Result.DescribeGlobalMessageMastersResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeGlobalMessageMasters(
    new DescribeGlobalMessageMastersRequest()
        .withNamespaceName("namespace1")
        .withPageToken(null)
        .withLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.describeGlobalMessageMasters(
        new Gs2Inbox.DescribeGlobalMessageMastersRequest()
            .withNamespaceName('namespace1')
            .withPageToken(undefined)
            .withLimit(undefined)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.describe_global_message_masters(
        new inbox.DescribeGlobalMessageMastersRequest()
            .with_namespace_name(self.hash1)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

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

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

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

全ユーザに向けたメッセージの一覧を取得

Request

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

Result

説明
items GlobalMessageMaster[] 全ユーザに向けたメッセージのリスト
nextPageToken string リストの続きを取得するためのページトークン

createGlobalMessageMaster

createGlobalMessageMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.CreateGlobalMessageMaster(
    &inbox.CreateGlobalMessageMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("globalMessageMaster-0001"),
        Metadata: pointy.String("{\"type\": \"globalMessageMaster\", \"body\": \"hello\"}"),
        ReadAcquireActions: [].AcquireAction{
            inbox.AcquireAction{
                Action: pointy.String("Gs2Inventory:AcquireItemSetByUserId"),
                Request: pointy.String("Gs2Inventory:AcquireItemSetByUserId-request"),
            },
        },
        ExpiresTimeSpan: nil,
        ExpiresAt: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\CreateGlobalMessageMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createGlobalMessageMaster(
        (new CreateGlobalMessageMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName('globalMessageMaster-0001')
            ->withMetadata('{"type": "globalMessageMaster", "body": "hello"}')
            ->withReadAcquireActions([    (new \Gs2\Inbox\Model\AcquireAction())
                ->withAction('Gs2Inventory:AcquireItemSetByUserId')
                ->withRequest('Gs2Inventory:AcquireItemSetByUserId-request'),
            ])
            ->withExpiresTimeSpan(null)
            ->withExpiresAt(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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.CreateGlobalMessageMasterRequest;
import io.gs2.inbox.result.CreateGlobalMessageMasterResult;

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

try {
    CreateGlobalMessageMasterResult result = client.createGlobalMessageMaster(
        new CreateGlobalMessageMasterRequest()
            .withNamespaceName("namespace1")
            .withName("globalMessageMaster-0001")
            .withMetadata("{\"type\": \"globalMessageMaster\", \"body\": \"hello\"}")
            .withReadAcquireActions(Arrays.asList(
                new io.gs2.inbox.model.AcquireAction()
                    .withAction("Gs2Inventory:AcquireItemSetByUserId")
                    .withRequest("Gs2Inventory:AcquireItemSetByUserId-request")
            ))
            .withExpiresTimeSpan(null)
            .withExpiresAt(null)
    );
    GlobalMessageMaster 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.CreateGlobalMessageMasterRequest;
using Gs2.Gs2Inbox.Result.CreateGlobalMessageMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createGlobalMessageMaster(
    new CreateGlobalMessageMasterRequest()
        .withNamespaceName("namespace1")
        .withName("globalMessageMaster-0001")
        .withMetadata("{\"type\": \"globalMessageMaster\", \"body\": \"hello\"}")
        .withReadAcquireActions(new Gs2.Gs2Inbox.Model.AcquireAction[] {
            new Gs2.Gs2Inbox.Model.AcquireAction()
                .WithAction("Gs2Inventory:AcquireItemSetByUserId")
                .WithRequest("Gs2Inventory:AcquireItemSetByUserId-request")
        })
        .withExpiresTimeSpan(null)
        .withExpiresAt(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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.createGlobalMessageMaster(
        new Gs2Inbox.CreateGlobalMessageMasterRequest()
            .withNamespaceName('namespace1')
            .withName('globalMessageMaster-0001')
            .withMetadata('{"type": "globalMessageMaster", "body": "hello"}')
            .withReadAcquireActions([
                new Gs2Inbox.Model.AcquireAction()
                    .withAction('Gs2Inventory:AcquireItemSetByUserId')
                    .withRequest('Gs2Inventory:AcquireItemSetByUserId-request')
            ])
            .withExpiresTimeSpan(undefined)
            .withExpiresAt(undefined)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.create_global_message_master(
        new inbox.CreateGlobalMessageMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('globalMessageMaster-0001')
            .with_metadata('{"type": "globalMessageMaster", "body": "hello"}')
            .with_read_acquire_actions([    inbox.AcquireAction()
                .with_action('Gs2Inventory:AcquireItemSetByUserId')
                .with_request('Gs2Inventory:AcquireItemSetByUserId-request'),
            ])
            .with_expires_time_span(None)
            .with_expires_at(None)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.create_global_message_master({
    namespaceName='namespace1',
    name='globalMessageMaster-0001',
    metadata='{"type": "globalMessageMaster", "body": "hello"}',
    readAcquireActions={
        {
            action='Gs2Inventory:AcquireItemSetByUserId',
            request='Gs2Inventory:AcquireItemSetByUserId-request',
        }
    },
    expiresTimeSpan=nil,
    expiresAt=nil,
});

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

result = api_result.result
item = result.item;

全ユーザに向けたメッセージを新規作成

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
name string UUID ~ 64文字 全ユーザに向けたメッセージ名
metadata string ~ 4096文字 全ユーザに向けたメッセージの内容に相当するメタデータ
readAcquireActions AcquireAction[] [] 開封時に実行する入手アクション
expiresTimeSpan TimeSpan_ メッセージを受信したあとメッセージが削除されるまでの期間
expiresAt long 全ユーザに向けたメッセージの受信期限

Result

説明
item GlobalMessageMaster 作成した全ユーザに向けたメッセージ

getGlobalMessageMaster

getGlobalMessageMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.GetGlobalMessageMaster(
    &inbox.GetGlobalMessageMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        GlobalMessageName: pointy.String("globalMessageMaster-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\GetGlobalMessageMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getGlobalMessageMaster(
        (new GetGlobalMessageMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withGlobalMessageName('globalMessageMaster-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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.GetGlobalMessageMasterRequest;
import io.gs2.inbox.result.GetGlobalMessageMasterResult;

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

try {
    GetGlobalMessageMasterResult result = client.getGlobalMessageMaster(
        new GetGlobalMessageMasterRequest()
            .withNamespaceName("namespace1")
            .withGlobalMessageName("globalMessageMaster-0001")
    );
    GlobalMessageMaster 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.GetGlobalMessageMasterRequest;
using Gs2.Gs2Inbox.Result.GetGlobalMessageMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getGlobalMessageMaster(
    new GetGlobalMessageMasterRequest()
        .withNamespaceName("namespace1")
        .withGlobalMessageName("globalMessageMaster-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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.getGlobalMessageMaster(
        new Gs2Inbox.GetGlobalMessageMasterRequest()
            .withNamespaceName('namespace1')
            .withGlobalMessageName('globalMessageMaster-0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.get_global_message_master(
        new inbox.GetGlobalMessageMasterRequest()
            .with_namespace_name(self.hash1)
            .with_global_message_name('globalMessageMaster-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.get_global_message_master({
    namespaceName='namespace1',
    globalMessageName='globalMessageMaster-0001',
});

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

result = api_result.result
item = result.item;

全ユーザに向けたメッセージを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
globalMessageName string UUID ~ 64文字 全ユーザに向けたメッセージ名

Result

説明
item GlobalMessageMaster 全ユーザに向けたメッセージ

updateGlobalMessageMaster

updateGlobalMessageMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.UpdateGlobalMessageMaster(
    &inbox.UpdateGlobalMessageMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        GlobalMessageName: pointy.String("globalMessageMaster-0001"),
        Metadata: pointy.String("{\"type\": \"globalMessageMaster2\", \"body\": \"hello2\"}"),
        ReadAcquireActions: [].AcquireAction{
            inbox.AcquireAction{
                Action: pointy.String("Gs2Inventory:AcquireItemSetByUserId2"),
                Request: pointy.String("Gs2Inventory:AcquireItemSetByUserId-request2"),
            },
        },
        ExpiresTimeSpan: &inbox.TimeSpan{
            Days: pointy.Int32(1),
            Hours: pointy.Int32(2),
            Minutes: pointy.Int32(3),
        },
        ExpiresAt: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\UpdateGlobalMessageMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateGlobalMessageMaster(
        (new UpdateGlobalMessageMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withGlobalMessageName('globalMessageMaster-0001')
            ->withMetadata('{"type": "globalMessageMaster2", "body": "hello2"}')
            ->withReadAcquireActions([    (new \Gs2\Inbox\Model\AcquireAction())
                ->withAction('Gs2Inventory:AcquireItemSetByUserId2')
                ->withRequest('Gs2Inventory:AcquireItemSetByUserId-request2'),
            ])
            ->withExpiresTimeSpan((new \Gs2\Inbox\Model\TimeSpan())
                ->withDays(1)
                ->withHours(2)
                ->withMinutes(3))
            ->withExpiresAt(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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.UpdateGlobalMessageMasterRequest;
import io.gs2.inbox.result.UpdateGlobalMessageMasterResult;

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

try {
    UpdateGlobalMessageMasterResult result = client.updateGlobalMessageMaster(
        new UpdateGlobalMessageMasterRequest()
            .withNamespaceName("namespace1")
            .withGlobalMessageName("globalMessageMaster-0001")
            .withMetadata("{\"type\": \"globalMessageMaster2\", \"body\": \"hello2\"}")
            .withReadAcquireActions(Arrays.asList(
                new io.gs2.inbox.model.AcquireAction()
                    .withAction("Gs2Inventory:AcquireItemSetByUserId2")
                    .withRequest("Gs2Inventory:AcquireItemSetByUserId-request2")
            ))
            .withExpiresTimeSpan(new io.gs2.inbox.model.TimeSpan()
                .withDays(1)
                .withHours(2)
                .withMinutes(3))
            .withExpiresAt(null)
    );
    GlobalMessageMaster 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.UpdateGlobalMessageMasterRequest;
using Gs2.Gs2Inbox.Result.UpdateGlobalMessageMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateGlobalMessageMaster(
    new UpdateGlobalMessageMasterRequest()
        .withNamespaceName("namespace1")
        .withGlobalMessageName("globalMessageMaster-0001")
        .withMetadata("{\"type\": \"globalMessageMaster2\", \"body\": \"hello2\"}")
        .withReadAcquireActions(new Gs2.Gs2Inbox.Model.AcquireAction[] {
            new Gs2.Gs2Inbox.Model.AcquireAction()
                .WithAction("Gs2Inventory:AcquireItemSetByUserId2")
                .WithRequest("Gs2Inventory:AcquireItemSetByUserId-request2")
        })
        .withExpiresTimeSpan(new Gs2.Gs2Inbox.Model.TimeSpan_()
            .WithDays(1)
            .WithHours(2)
            .WithMinutes(3))
        .withExpiresAt(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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.updateGlobalMessageMaster(
        new Gs2Inbox.UpdateGlobalMessageMasterRequest()
            .withNamespaceName('namespace1')
            .withGlobalMessageName('globalMessageMaster-0001')
            .withMetadata('{"type": "globalMessageMaster2", "body": "hello2"}')
            .withReadAcquireActions([
                new Gs2Inbox.Model.AcquireAction()
                    .withAction('Gs2Inventory:AcquireItemSetByUserId2')
                    .withRequest('Gs2Inventory:AcquireItemSetByUserId-request2')
            ])
            .withExpiresTimeSpan(new Gs2Inbox.Model.TimeSpan()
                .withDays(1)
                .withHours(2)
                .withMinutes(3))
            .withExpiresAt(undefined)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.update_global_message_master(
        new inbox.UpdateGlobalMessageMasterRequest()
            .with_namespace_name(self.hash1)
            .with_global_message_name('globalMessageMaster-0001')
            .with_metadata('{"type": "globalMessageMaster2", "body": "hello2"}')
            .with_read_acquire_actions([    inbox.AcquireAction()
                .with_action('Gs2Inventory:AcquireItemSetByUserId2')
                .with_request('Gs2Inventory:AcquireItemSetByUserId-request2'),
            ])
            .with_expires_time_span(
                inbox.TimeSpan()
                    .with_days(1)
                    .with_hours(2)
                    .with_minutes(3))
            .with_expires_at(None)
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.update_global_message_master({
    namespaceName='namespace1',
    globalMessageName='globalMessageMaster-0001',
    metadata='{"type": "globalMessageMaster2", "body": "hello2"}',
    readAcquireActions={
        {
            action='Gs2Inventory:AcquireItemSetByUserId2',
            request='Gs2Inventory:AcquireItemSetByUserId-request2',
        }
    },
    expiresTimeSpan={
        days=1,
        hours=2,
        minutes=3,
    },
    expiresAt=nil,
});

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

result = api_result.result
item = result.item;

全ユーザに向けたメッセージを開封

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
globalMessageName string UUID ~ 64文字 全ユーザに向けたメッセージ名
metadata string ~ 4096文字 全ユーザに向けたメッセージの内容に相当するメタデータ
readAcquireActions AcquireAction[] [] 開封時に実行する入手アクション
expiresTimeSpan TimeSpan_ メッセージを受信したあとメッセージが削除されるまでの期間
expiresAt long 全ユーザに向けたメッセージの受信期限

Result

説明
item GlobalMessageMaster 全ユーザに向けたメッセージ

deleteGlobalMessageMaster

deleteGlobalMessageMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.DeleteGlobalMessageMaster(
    &inbox.DeleteGlobalMessageMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        GlobalMessageName: pointy.String("globalMessageMaster-0001"),
    }
)
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\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\DeleteGlobalMessageMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteGlobalMessageMaster(
        (new DeleteGlobalMessageMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withGlobalMessageName('globalMessageMaster-0001')
    );
} 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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.DeleteGlobalMessageMasterRequest;
import io.gs2.inbox.result.DeleteGlobalMessageMasterResult;

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

try {
    DeleteGlobalMessageMasterResult result = client.deleteGlobalMessageMaster(
        new DeleteGlobalMessageMasterRequest()
            .withNamespaceName("namespace1")
            .withGlobalMessageName("globalMessageMaster-0001")
    );
} 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.DeleteGlobalMessageMasterRequest;
using Gs2.Gs2Inbox.Result.DeleteGlobalMessageMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteGlobalMessageMaster(
    new DeleteGlobalMessageMasterRequest()
        .withNamespaceName("namespace1")
        .withGlobalMessageName("globalMessageMaster-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.deleteGlobalMessageMaster(
        new Gs2Inbox.DeleteGlobalMessageMasterRequest()
            .withNamespaceName('namespace1')
            .withGlobalMessageName('globalMessageMaster-0001')
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.delete_global_message_master(
        new inbox.DeleteGlobalMessageMasterRequest()
            .with_namespace_name(self.hash1)
            .with_global_message_name('globalMessageMaster-0001')
    )
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.delete_global_message_master({
    namespaceName='namespace1',
    globalMessageName='globalMessageMaster-0001',
});

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

result = api_result.result

全ユーザに向けたメッセージを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
globalMessageName string UUID ~ 64文字 全ユーザに向けたメッセージ名

Result

説明

describeGlobalMessages

describeGlobalMessages

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.DescribeGlobalMessages(
    &inbox.DescribeGlobalMessagesRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\DescribeGlobalMessagesRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeGlobalMessages(
        (new DescribeGlobalMessagesRequest())
            ->withNamespaceName(self::namespace1)
    );
    $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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.DescribeGlobalMessagesRequest;
import io.gs2.inbox.result.DescribeGlobalMessagesResult;

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

try {
    DescribeGlobalMessagesResult result = client.describeGlobalMessages(
        new DescribeGlobalMessagesRequest()
            .withNamespaceName("namespace1")
    );
    List<GlobalMessage> 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.DescribeGlobalMessagesRequest;
using Gs2.Gs2Inbox.Result.DescribeGlobalMessagesResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeGlobalMessages(
    new DescribeGlobalMessagesRequest()
        .withNamespaceName("namespace1"),
    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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.describeGlobalMessages(
        new Gs2Inbox.DescribeGlobalMessagesRequest()
            .withNamespaceName('namespace1')
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.describe_global_messages(
        new inbox.DescribeGlobalMessagesRequest()
            .with_namespace_name(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

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

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

result = api_result.result
items = result.items;

全ユーザに向けたメッセージの一覧を取得

Request

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

Result

説明
items GlobalMessage[] 全ユーザに向けたメッセージのリスト

getGlobalMessage

getGlobalMessage

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.GetGlobalMessage(
    &inbox.GetGlobalMessageRequest {
        NamespaceName: pointy.String("namespace1"),
        GlobalMessageName: pointy.String("globalMessage-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\GetGlobalMessageRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getGlobalMessage(
        (new GetGlobalMessageRequest())
            ->withNamespaceName(self::namespace1)
            ->withGlobalMessageName('globalMessage-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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.GetGlobalMessageRequest;
import io.gs2.inbox.result.GetGlobalMessageResult;

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

try {
    GetGlobalMessageResult result = client.getGlobalMessage(
        new GetGlobalMessageRequest()
            .withNamespaceName("namespace1")
            .withGlobalMessageName("globalMessage-0001")
    );
    GlobalMessage 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.GetGlobalMessageRequest;
using Gs2.Gs2Inbox.Result.GetGlobalMessageResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getGlobalMessage(
    new GetGlobalMessageRequest()
        .withNamespaceName("namespace1")
        .withGlobalMessageName("globalMessage-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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.getGlobalMessage(
        new Gs2Inbox.GetGlobalMessageRequest()
            .withNamespaceName('namespace1')
            .withGlobalMessageName('globalMessage-0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.get_global_message(
        new inbox.GetGlobalMessageRequest()
            .with_namespace_name(self.hash1)
            .with_global_message_name('globalMessage-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.get_global_message({
    namespaceName='namespace1',
    globalMessageName='globalMessage-0001',
});

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

result = api_result.result
item = result.item;

全ユーザに向けたメッセージを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
globalMessageName string ~ 128文字 全ユーザに向けたメッセージ名

Result

説明
item GlobalMessage 全ユーザに向けたメッセージ

getReceivedByUserId

getReceivedByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.GetReceivedByUserId(
    &inbox.GetReceivedByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\GetReceivedByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getReceivedByUserId(
        (new GetReceivedByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId('user-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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.GetReceivedByUserIdRequest;
import io.gs2.inbox.result.GetReceivedByUserIdResult;

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

try {
    GetReceivedByUserIdResult result = client.getReceivedByUserId(
        new GetReceivedByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
    );
    Received 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.GetReceivedByUserIdRequest;
using Gs2.Gs2Inbox.Result.GetReceivedByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getReceivedByUserId(
    new GetReceivedByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-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 Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.getReceivedByUserId(
        new Gs2Inbox.GetReceivedByUserIdRequest()
            .withNamespaceName('namespace1')
            .withUserId('user-0001')
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.get_received_by_user_id(
        new inbox.GetReceivedByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.get_received_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
});

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

result = api_result.result
item = result.item;

ユーザーIDを指定して受信済みグローバルメッセージ名を取得

Request

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

Result

説明
item Received 受信済みグローバルメッセージ名

updateReceivedByUserId

updateReceivedByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.UpdateReceivedByUserId(
    &inbox.UpdateReceivedByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        ReceivedGlobalMessageNames: []string{
            "message-3001",
        "message-3002",
        "message-3003",
        },
    }
)
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\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\UpdateReceivedByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateReceivedByUserId(
        (new UpdateReceivedByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId('user-0001')
            ->withReceivedGlobalMessageNames([    'message-3001',
            'message-3002',
            'message-3003',
            ])
    );
} 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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.UpdateReceivedByUserIdRequest;
import io.gs2.inbox.result.UpdateReceivedByUserIdResult;

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

try {
    UpdateReceivedByUserIdResult result = client.updateReceivedByUserId(
        new UpdateReceivedByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withReceivedGlobalMessageNames(Arrays.asList(
                "message-3001",
            "message-3002",
            "message-3003"
            ))
    );
} 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.UpdateReceivedByUserIdRequest;
using Gs2.Gs2Inbox.Result.UpdateReceivedByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateReceivedByUserId(
    new UpdateReceivedByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001")
        .withReceivedGlobalMessageNames(new string[] {
            "message-3001",
        "message-3002",
        "message-3003"
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.updateReceivedByUserId(
        new Gs2Inbox.UpdateReceivedByUserIdRequest()
            .withNamespaceName('namespace1')
            .withUserId('user-0001')
            .withReceivedGlobalMessageNames([
                'message-3001',
            'message-3002',
            'message-3003'
            ])
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.update_received_by_user_id(
        new inbox.UpdateReceivedByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_received_global_message_names([    'message-3001',
            'message-3002',
            'message-3003',
            ])
    )
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.update_received_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    receivedGlobalMessageNames={
        'message-3001',
    'message-3002',
    'message-3003'
    },
});

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

result = api_result.result

ユーザーIDを指定して受信済みグローバルメッセージ名を更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
receivedGlobalMessageNames string[] [] 受信したグローバルメッセージ名

Result

説明

deleteReceivedByUserId

deleteReceivedByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/inbox"
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 := inbox.Gs2InboxRestClient{
    Session: &session,
}
result, err := client.DeleteReceivedByUserId(
    &inbox.DeleteReceivedByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
    }
)
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\Inbox\Gs2InboxRestClient;
use Gs2\Inbox\Request\DeleteReceivedByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteReceivedByUserId(
        (new DeleteReceivedByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId('user-0001')
    );
} 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.inbox.rest.Gs2InboxRestClient;
import io.gs2.inbox.request.DeleteReceivedByUserIdRequest;
import io.gs2.inbox.result.DeleteReceivedByUserIdResult;

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

try {
    DeleteReceivedByUserIdResult result = client.deleteReceivedByUserId(
        new DeleteReceivedByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
    );
} 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.Gs2Inbox.Gs2InboxRestClient;
using Gs2.Gs2Inbox.Request.DeleteReceivedByUserIdRequest;
using Gs2.Gs2Inbox.Result.DeleteReceivedByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteReceivedByUserId(
    new DeleteReceivedByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Inbox from '@/gs2/inbox';

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

try {
    const result = await client.deleteReceivedByUserId(
        new Gs2Inbox.DeleteReceivedByUserIdRequest()
            .withNamespaceName('namespace1')
            .withUserId('user-0001')
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import inbox

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

try:
    result = client.delete_received_by_user_id(
        new inbox.DeleteReceivedByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
    )
except core.Gs2Exception as e:
    os.exit(1);

client = gs2('inbox')

api_result = client.delete_received_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
});

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

result = api_result.result

ユーザーIDを指定して受信済みグローバルメッセージ名を削除

Request

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

Result

説明