NAV
go python java php typescript csharp GS2-Script

GS2-Showcase

GS2-SDK のリファレンス

モデル

Namespace

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

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

説明
namespaceId string ネームスペースGRN
name string ネームスペース名
queueNamespaceId string スタンプシートの実行に使用する GS2-JobQueue のネームスペース
keyId string スタンプシートの発行に使用する GS2-Key のネームスペース
description string 説明文
logSetting LogSetting ログの出力設定
createdAt long 作成日時
updatedAt long 最終更新日時

SalesItemMaster

商品は陳列棚に陳列するためのエンティティです。 商品を購入するために必要となる対価と商品を購入したときに得られる報酬を設定します。

説明
salesItemId string 商品マスターGRN
name string 商品名
description string 説明文
metadata string メタデータ
consumeActions ConsumeAction[] 消費アクションリスト
acquireActions AcquireAction[] 入手アクションリスト
createdAt long 作成日時
updatedAt long 最終更新日時

SalesItemGroupMaster

商品グループは陳列棚に陳列するためのエンティティです。 商品グループには複数の商品を所属させることができ、所属している商品の先頭から順番に購入可能かを判定し、一番最初に購入可能だと判定された商品が実際に陳列されます。 初回のみ割引する商品や、ステップアップガチャのように購入回数によって商品の内容が変化する仕組みに使用できます。

説明
salesItemGroupId string 商品グループマスターGRN
name string 商品名
description string 説明文
metadata string メタデータ
salesItemNames string[] 商品グループに含める商品リスト
createdAt long 作成日時
updatedAt long 最終更新日時

ShowcaseMaster

陳列棚は登録した商品を販売するために陳列するエンティティです。 陳列棚には販売期間を設定できます。

説明
showcaseId string 陳列棚マスターGRN
name string 陳列棚名
description string 説明文
metadata string メタデータ
salesPeriodEventId string 陳列棚の販売期間を設定した GS2-Schedule のイベント
displayItems DisplayItemMaster[] 陳列する商品モデル一覧
createdAt long 作成日時
updatedAt long 最終更新日時

CurrentShowcaseMaster

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

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

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

説明
namespaceId string 現在有効な陳列棚マスターGRN
settings string マスターデータ

GitHubCheckoutSetting

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

LogSetting

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

SalesItem

商品は陳列棚に陳列するためのエンティティです。 商品を購入するために必要となる対価と商品を購入したときに得られる報酬を設定します。

説明
name string 商品名
metadata string メタデータ
consumeActions ConsumeAction[] 消費アクションリスト
acquireActions AcquireAction[] 入手アクションリスト

SalesItemGroup

商品グループは陳列棚に陳列するためのエンティティです。 商品グループには複数の商品を所属させることができ、所属している商品の先頭から順番に購入可能かを判定し、一番最初に購入可能だと判定された商品が実際に陳列されます。 初回のみ割引する商品や、ステップアップガチャのように購入回数によって商品の内容が変化する仕組みに使用できます。

説明
name string 商品グループ名
metadata string メタデータ
salesItems SalesItem[] 商品リスト

Showcase

陳列棚は登録した商品を販売するために陳列するエンティティです。 陳列棚には販売期間を設定できます。

説明
showcaseId string 陳列棚GRN
name string 商品名
metadata string メタデータ
salesPeriodEventId string 陳列棚の販売期間を設定した GS2-Schedule のイベント
displayItems DisplayItem[] インベントリに格納可能なアイテムモデル一覧

DisplayItem

説明
displayItemId string 陳列商品ID
type string 種類
salesItem SalesItem 陳列する商品
salesItemGroup SalesItemGroup 陳列する商品グループ
salesPeriodEventId string 商品の販売期間を設定した GS2-Schedule のイベント

Config

説明
key string 名前
value string

ConsumeAction

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

AcquireAction

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

DisplayItemMaster

説明
displayItemId string 陳列商品ID
type string 種類
salesItemName string 陳列する商品の名前
salesItemGroupName string 陳列する商品グループの名前
salesPeriodEventId string 商品の販売期間を設定した GS2-Schedule のイベント

メソッド

describeNamespaces

describeNamespaces

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &showcase.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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DescribeNamespacesRequest;
import io.gs2.showcase.result.DescribeNamespacesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ShowcaseRestClient client = new Gs2ShowcaseRestClient(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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DescribeNamespacesRequest;
using Gs2.Gs2Showcase.Result.DescribeNamespacesResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ShowcaseRestClient(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 Gs2Showcase from '@/gs2/showcase';

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

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

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

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

client = gs2('showcase')

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/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &showcase.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"),
        KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"),
        LogSetting: &showcase.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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\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)
            ->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
            ->withKeyId('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001')
            ->withLogSetting((new \Gs2\Showcase\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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.CreateNamespaceRequest;
import io.gs2.showcase.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
            .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001")
            .withLogSetting(new io.gs2.showcase.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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.CreateNamespaceRequest;
using Gs2.Gs2Showcase.Result.CreateNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createNamespace(
    new CreateNamespaceRequest()
        .withName("namespace1")
        .withDescription(null)
        .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
        .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001")
        .withLogSetting(new Gs2.Gs2Showcase.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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.createNamespace(
        new Gs2Showcase.CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
            .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001")
            .withLogSetting(new Gs2Showcase.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 showcase

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

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

client = gs2('showcase')

api_result = client.create_namespace({
    name='namespace1',
    description=nil,
    queueNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001',
    keyId='grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001',
    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文字 説明文
queueNamespaceId string ~ 1024文字 スタンプシートの実行に使用する GS2-JobQueue のネームスペース
keyId string ~ 1024文字 スタンプシートの発行に使用する GS2-Key のネームスペース
logSetting LogSetting ログの出力設定

Result

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

getNamespaceStatus

getNamespaceStatus

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &showcase.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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetNamespaceStatusRequest;
import io.gs2.showcase.result.GetNamespaceStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ShowcaseRestClient client = new Gs2ShowcaseRestClient(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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Showcase.Result.GetNamespaceStatusResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ShowcaseRestClient(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 Gs2Showcase from '@/gs2/showcase';

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

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

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

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

client = gs2('showcase')

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/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &showcase.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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetNamespaceRequest;
import io.gs2.showcase.result.GetNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ShowcaseRestClient client = new Gs2ShowcaseRestClient(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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetNamespaceRequest;
using Gs2.Gs2Showcase.Result.GetNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ShowcaseRestClient(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 Gs2Showcase from '@/gs2/showcase';

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

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

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

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

client = gs2('showcase')

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/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &showcase.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"),
        KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"),
        LogSetting: &showcase.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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\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")
            ->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
            ->withKeyId('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002')
            ->withLogSetting((new \Gs2\Showcase\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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.UpdateNamespaceRequest;
import io.gs2.showcase.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
            .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002")
            .withLogSetting(new io.gs2.showcase.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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.UpdateNamespaceRequest;
using Gs2.Gs2Showcase.Result.UpdateNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateNamespace(
    new UpdateNamespaceRequest()
        .withNamespaceName("namespace1")
        .withDescription("description1")
        .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
        .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002")
        .withLogSetting(new Gs2.Gs2Showcase.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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.updateNamespace(
        new Gs2Showcase.UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
            .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002")
            .withLogSetting(new Gs2Showcase.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 showcase

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

try:
    result = client.update_namespace(
        showcase.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002')
            .with_key_id('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002')
            .with_log_setting(
                showcase.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.update_namespace({
    namespaceName='namespace1',
    description='description1',
    queueNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002',
    keyId='grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002',
    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文字 説明文
queueNamespaceId string ~ 1024文字 スタンプシートの実行に使用する GS2-JobQueue のネームスペース
keyId string ~ 1024文字 スタンプシートの発行に使用する GS2-Key のネームスペース
logSetting LogSetting ログの出力設定

Result

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

deleteNamespace

deleteNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &showcase.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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DeleteNamespaceRequest;
import io.gs2.showcase.result.DeleteNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ShowcaseRestClient client = new Gs2ShowcaseRestClient(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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DeleteNamespaceRequest;
using Gs2.Gs2Showcase.Result.DeleteNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ShowcaseRestClient(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 Gs2Showcase from '@/gs2/showcase';

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

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

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

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

client = gs2('showcase')

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 削除したネームスペース

describeSalesItemMasters

describeSalesItemMasters

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DescribeSalesItemMasters(
    &showcase.DescribeSalesItemMastersRequest {
        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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DescribeSalesItemMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeSalesItemMasters(
        (new DescribeSalesItemMastersRequest())
            ->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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DescribeSalesItemMastersRequest;
import io.gs2.showcase.result.DescribeSalesItemMastersResult;

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

try {
    DescribeSalesItemMastersResult result = client.describeSalesItemMasters(
        new DescribeSalesItemMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SalesItemMaster> 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DescribeSalesItemMastersRequest;
using Gs2.Gs2Showcase.Result.DescribeSalesItemMastersResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeSalesItemMasters(
    new DescribeSalesItemMastersRequest()
        .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 Gs2Showcase from '@/gs2/showcase';

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

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

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

try:
    result = client.describe_sales_item_masters(
        showcase.DescribeSalesItemMastersRequest()
            .with_namespace_name(self.hash1)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.describe_sales_item_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 SalesItemMaster[] 商品マスターのリスト
nextPageToken string リストの続きを取得するためのページトークン

createSalesItemMaster

createSalesItemMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.CreateSalesItemMaster(
    &showcase.CreateSalesItemMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("sales-item-0001"),
        Description: nil,
        Metadata: nil,
        ConsumeActions: []showcase.ConsumeAction{
            showcase.ConsumeAction{
                Action: pointy.String("Gs2Money:WithdrawByUserId"),
                Request: pointy.String("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
            },
        },
        AcquireActions: []showcase.AcquireAction{
            showcase.AcquireAction{
                Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
                Request: pointy.String("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
            },
        },
    }
)
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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\CreateSalesItemMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createSalesItemMaster(
        (new CreateSalesItemMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("sales-item-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withConsumeActions([    (new \Gs2\Showcase\Model\ConsumeAction())
                ->withAction("Gs2Money:WithdrawByUserId")
                ->withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
            ])
            ->withAcquireActions([    (new \Gs2\Showcase\Model\AcquireAction())
                ->withAction("Gs2Stamina:RecoverStaminaByUserId")
                ->withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
            ])
    );
    $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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.CreateSalesItemMasterRequest;
import io.gs2.showcase.result.CreateSalesItemMasterResult;

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

try {
    CreateSalesItemMasterResult result = client.createSalesItemMaster(
        new CreateSalesItemMasterRequest()
            .withNamespaceName("namespace1")
            .withName("sales-item-0001")
            .withDescription(null)
            .withMetadata(null)
            .withConsumeActions(Arrays.asList(
                new io.gs2.showcase.model.ConsumeAction()
                    .withAction("Gs2Money:WithdrawByUserId")
                    .withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
            ))
            .withAcquireActions(Arrays.asList(
                new io.gs2.showcase.model.AcquireAction()
                    .withAction("Gs2Stamina:RecoverStaminaByUserId")
                    .withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
            ))
    );
    SalesItemMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.CreateSalesItemMasterRequest;
using Gs2.Gs2Showcase.Result.CreateSalesItemMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createSalesItemMaster(
    new CreateSalesItemMasterRequest()
        .withNamespaceName("namespace1")
        .withName("sales-item-0001")
        .withDescription(null)
        .withMetadata(null)
        .withConsumeActions(new Gs2.Gs2Showcase.Model.ConsumeAction[] {
            new Gs2.Gs2Showcase.Model.ConsumeAction()
                .WithAction("Gs2Money:WithdrawByUserId")
                .WithRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
        })
        .withAcquireActions(new Gs2.Gs2Showcase.Model.AcquireAction[] {
            new Gs2.Gs2Showcase.Model.AcquireAction()
                .WithAction("Gs2Stamina:RecoverStaminaByUserId")
                .WithRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
        }),
    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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.createSalesItemMaster(
        new Gs2Showcase.CreateSalesItemMasterRequest()
            .withNamespaceName("namespace1")
            .withName("sales-item-0001")
            .withDescription(null)
            .withMetadata(null)
            .withConsumeActions([
                new Gs2Showcase.Model.ConsumeAction()
                    .withAction("Gs2Money:WithdrawByUserId")
                    .withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
            ])
            .withAcquireActions([
                new Gs2Showcase.Model.AcquireAction()
                    .withAction("Gs2Stamina:RecoverStaminaByUserId")
                    .withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.create_sales_item_master(
        showcase.CreateSalesItemMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('sales-item-0001')
            .with_description(None)
            .with_metadata(None)
            .with_consume_actions([    showcase.ConsumeAction()
                .with_action('Gs2Money:WithdrawByUserId')
                .with_request('{"moneyName": "money-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}'),
            ])
            .with_acquire_actions([    showcase.AcquireAction()
                .with_action('Gs2Stamina:RecoverStaminaByUserId')
                .with_request('{"moneyName": "money-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}'),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.create_sales_item_master({
    namespaceName='namespace1',
    name='sales-item-0001',
    description=nil,
    metadata=nil,
    consumeActions={
        {
            action='Gs2Money:WithdrawByUserId',
            request='{"moneyName": "money-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}',
        }
    },
    acquireActions={
        {
            action='Gs2Stamina:RecoverStaminaByUserId',
            request='{"moneyName": "money-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}',
        }
    },
});

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 ~ 128文字 商品名
description string ~ 1024文字 説明文
metadata string ~ 2048文字 メタデータ
consumeActions ConsumeAction[] 消費アクションリスト
acquireActions AcquireAction[] 入手アクションリスト

Result

説明
item SalesItemMaster 作成した商品マスター

getSalesItemMaster

getSalesItemMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetSalesItemMaster(
    &showcase.GetSalesItemMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SalesItemName: pointy.String("sales-item-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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetSalesItemMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSalesItemMaster(
        (new GetSalesItemMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSalesItemName("sales-item-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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetSalesItemMasterRequest;
import io.gs2.showcase.result.GetSalesItemMasterResult;

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

try {
    GetSalesItemMasterResult result = client.getSalesItemMaster(
        new GetSalesItemMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemName("sales-item-0001")
    );
    SalesItemMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetSalesItemMasterRequest;
using Gs2.Gs2Showcase.Result.GetSalesItemMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getSalesItemMaster(
    new GetSalesItemMasterRequest()
        .withNamespaceName("namespace1")
        .withSalesItemName("sales-item-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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.getSalesItemMaster(
        new Gs2Showcase.GetSalesItemMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemName("sales-item-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.get_sales_item_master(
        showcase.GetSalesItemMasterRequest()
            .with_namespace_name(self.hash1)
            .with_sales_item_name('sales-item-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.get_sales_item_master({
    namespaceName='namespace1',
    salesItemName='sales-item-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文字 ネームスペース名
salesItemName string ~ 128文字 商品名

Result

説明
item SalesItemMaster 商品マスター

updateSalesItemMaster

updateSalesItemMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.UpdateSalesItemMaster(
    &showcase.UpdateSalesItemMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SalesItemName: pointy.String("sales-item-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("SALES_ITEM_0001"),
        ConsumeActions: []showcase.ConsumeAction{
            showcase.ConsumeAction{
                Action: pointy.String("Gs2Money:WithdrawByUserId"),
                Request: pointy.String("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}"),
            },
        },
        AcquireActions: []showcase.AcquireAction{
            showcase.AcquireAction{
                Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
                Request: pointy.String("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}"),
            },
        },
    }
)
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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\UpdateSalesItemMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateSalesItemMaster(
        (new UpdateSalesItemMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSalesItemName("sales-item-0001")
            ->withDescription("description1")
            ->withMetadata("SALES_ITEM_0001")
            ->withConsumeActions([    (new \Gs2\Showcase\Model\ConsumeAction())
                ->withAction("Gs2Money:WithdrawByUserId")
                ->withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}"),
            ])
            ->withAcquireActions([    (new \Gs2\Showcase\Model\AcquireAction())
                ->withAction("Gs2Stamina:RecoverStaminaByUserId")
                ->withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}"),
            ])
    );
    $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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.UpdateSalesItemMasterRequest;
import io.gs2.showcase.result.UpdateSalesItemMasterResult;

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

try {
    UpdateSalesItemMasterResult result = client.updateSalesItemMaster(
        new UpdateSalesItemMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemName("sales-item-0001")
            .withDescription("description1")
            .withMetadata("SALES_ITEM_0001")
            .withConsumeActions(Arrays.asList(
                new io.gs2.showcase.model.ConsumeAction()
                    .withAction("Gs2Money:WithdrawByUserId")
                    .withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}")
            ))
            .withAcquireActions(Arrays.asList(
                new io.gs2.showcase.model.AcquireAction()
                    .withAction("Gs2Stamina:RecoverStaminaByUserId")
                    .withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}")
            ))
    );
    SalesItemMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.UpdateSalesItemMasterRequest;
using Gs2.Gs2Showcase.Result.UpdateSalesItemMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateSalesItemMaster(
    new UpdateSalesItemMasterRequest()
        .withNamespaceName("namespace1")
        .withSalesItemName("sales-item-0001")
        .withDescription("description1")
        .withMetadata("SALES_ITEM_0001")
        .withConsumeActions(new Gs2.Gs2Showcase.Model.ConsumeAction[] {
            new Gs2.Gs2Showcase.Model.ConsumeAction()
                .WithAction("Gs2Money:WithdrawByUserId")
                .WithRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}")
        })
        .withAcquireActions(new Gs2.Gs2Showcase.Model.AcquireAction[] {
            new Gs2.Gs2Showcase.Model.AcquireAction()
                .WithAction("Gs2Stamina:RecoverStaminaByUserId")
                .WithRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}")
        }),
    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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.updateSalesItemMaster(
        new Gs2Showcase.UpdateSalesItemMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemName("sales-item-0001")
            .withDescription("description1")
            .withMetadata("SALES_ITEM_0001")
            .withConsumeActions([
                new Gs2Showcase.Model.ConsumeAction()
                    .withAction("Gs2Money:WithdrawByUserId")
                    .withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}")
            ])
            .withAcquireActions([
                new Gs2Showcase.Model.AcquireAction()
                    .withAction("Gs2Stamina:RecoverStaminaByUserId")
                    .withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}")
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.update_sales_item_master(
        showcase.UpdateSalesItemMasterRequest()
            .with_namespace_name(self.hash1)
            .with_sales_item_name('sales-item-0001')
            .with_description('description1')
            .with_metadata('SALES_ITEM_0001')
            .with_consume_actions([    showcase.ConsumeAction()
                .with_action('Gs2Money:WithdrawByUserId')
                .with_request('{"moneyName": "money-0001", "userId": "user-0001", "slot": 0, "count": 200, "paidOnly": false}'),
            ])
            .with_acquire_actions([    showcase.AcquireAction()
                .with_action('Gs2Stamina:RecoverStaminaByUserId')
                .with_request('{"moneyName": "money-0001", "userId": "user-0001", "slot": 0, "count": 200, "paidOnly": false}'),
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.update_sales_item_master({
    namespaceName='namespace1',
    salesItemName='sales-item-0001',
    description='description1',
    metadata='SALES_ITEM_0001',
    consumeActions={
        {
            action='Gs2Money:WithdrawByUserId',
            request='{"moneyName": "money-0001", "userId": "user-0001", "slot": 0, "count": 200, "paidOnly": false}',
        }
    },
    acquireActions={
        {
            action='Gs2Stamina:RecoverStaminaByUserId',
            request='{"moneyName": "money-0001", "userId": "user-0001", "slot": 0, "count": 200, "paidOnly": false}',
        }
    },
});

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

result = api_result.result
item = result.item;

商品マスターを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
salesItemName string ~ 128文字 商品名
description string ~ 1024文字 説明文
metadata string ~ 2048文字 メタデータ
consumeActions ConsumeAction[] 消費アクションリスト
acquireActions AcquireAction[] 入手アクションリスト

Result

説明
item SalesItemMaster 更新した商品マスター

deleteSalesItemMaster

deleteSalesItemMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DeleteSalesItemMaster(
    &showcase.DeleteSalesItemMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SalesItemName: pointy.String("sales-item-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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DeleteSalesItemMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteSalesItemMaster(
        (new DeleteSalesItemMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSalesItemName("sales-item-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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DeleteSalesItemMasterRequest;
import io.gs2.showcase.result.DeleteSalesItemMasterResult;

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

try {
    DeleteSalesItemMasterResult result = client.deleteSalesItemMaster(
        new DeleteSalesItemMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemName("sales-item-0001")
    );
    SalesItemMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DeleteSalesItemMasterRequest;
using Gs2.Gs2Showcase.Result.DeleteSalesItemMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteSalesItemMaster(
    new DeleteSalesItemMasterRequest()
        .withNamespaceName("namespace1")
        .withSalesItemName("sales-item-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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.deleteSalesItemMaster(
        new Gs2Showcase.DeleteSalesItemMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemName("sales-item-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.delete_sales_item_master(
        showcase.DeleteSalesItemMasterRequest()
            .with_namespace_name(self.hash1)
            .with_sales_item_name('sales-item-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.delete_sales_item_master({
    namespaceName='namespace1',
    salesItemName='sales-item-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文字 ネームスペース名
salesItemName string ~ 128文字 商品名

Result

説明
item SalesItemMaster 削除した商品マスター

describeSalesItemGroupMasters

describeSalesItemGroupMasters

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DescribeSalesItemGroupMasters(
    &showcase.DescribeSalesItemGroupMastersRequest {
        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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DescribeSalesItemGroupMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeSalesItemGroupMasters(
        (new DescribeSalesItemGroupMastersRequest())
            ->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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DescribeSalesItemGroupMastersRequest;
import io.gs2.showcase.result.DescribeSalesItemGroupMastersResult;

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

try {
    DescribeSalesItemGroupMastersResult result = client.describeSalesItemGroupMasters(
        new DescribeSalesItemGroupMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SalesItemGroupMaster> 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DescribeSalesItemGroupMastersRequest;
using Gs2.Gs2Showcase.Result.DescribeSalesItemGroupMastersResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeSalesItemGroupMasters(
    new DescribeSalesItemGroupMastersRequest()
        .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 Gs2Showcase from '@/gs2/showcase';

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

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

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

try:
    result = client.describe_sales_item_group_masters(
        showcase.DescribeSalesItemGroupMastersRequest()
            .with_namespace_name(self.hash1)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.describe_sales_item_group_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 SalesItemGroupMaster[] 商品グループマスターのリスト
nextPageToken string リストの続きを取得するためのページトークン

createSalesItemGroupMaster

createSalesItemGroupMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.CreateSalesItemGroupMaster(
    &showcase.CreateSalesItemGroupMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("sales-item-group-0001"),
        Description: nil,
        Metadata: nil,
        SalesItemNames: []string{
            "$salesItem1.name",
        "$salesItem2.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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\CreateSalesItemGroupMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createSalesItemGroupMaster(
        (new CreateSalesItemGroupMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("sales-item-group-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withSalesItemNames([    self::$salesItem1.name,
            self::$salesItem2.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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.CreateSalesItemGroupMasterRequest;
import io.gs2.showcase.result.CreateSalesItemGroupMasterResult;

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

try {
    CreateSalesItemGroupMasterResult result = client.createSalesItemGroupMaster(
        new CreateSalesItemGroupMasterRequest()
            .withNamespaceName("namespace1")
            .withName("sales-item-group-0001")
            .withDescription(null)
            .withMetadata(null)
            .withSalesItemNames(Arrays.asList(
                "$salesItem1.name",
            "$salesItem2.name"
            ))
    );
    SalesItemGroupMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.CreateSalesItemGroupMasterRequest;
using Gs2.Gs2Showcase.Result.CreateSalesItemGroupMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createSalesItemGroupMaster(
    new CreateSalesItemGroupMasterRequest()
        .withNamespaceName("namespace1")
        .withName("sales-item-group-0001")
        .withDescription(null)
        .withMetadata(null)
        .withSalesItemNames(new string[] {
            "$salesItem1.name",
        "$salesItem2.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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.createSalesItemGroupMaster(
        new Gs2Showcase.CreateSalesItemGroupMasterRequest()
            .withNamespaceName("namespace1")
            .withName("sales-item-group-0001")
            .withDescription(null)
            .withMetadata(null)
            .withSalesItemNames([
                "$salesItem1.name",
            "$salesItem2.name"
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.create_sales_item_group_master(
        showcase.CreateSalesItemGroupMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('sales-item-group-0001')
            .with_description(None)
            .with_metadata(None)
            .with_sales_item_names([    self.sales_item1.name,
            self.sales_item2.name,
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.create_sales_item_group_master({
    namespaceName='namespace1',
    name='sales-item-group-0001',
    description=nil,
    metadata=nil,
    salesItemNames={
        '$salesItem1.name',
    '$salesItem2.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文字 ネームスペース名
name string ~ 128文字 商品名
description string ~ 1024文字 説明文
metadata string ~ 2048文字 メタデータ
salesItemNames string[] 商品グループに含める商品リスト

Result

説明
item SalesItemGroupMaster 作成した商品グループマスター

getSalesItemGroupMaster

getSalesItemGroupMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetSalesItemGroupMaster(
    &showcase.GetSalesItemGroupMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SalesItemGroupName: pointy.String("sales-item-group-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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetSalesItemGroupMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSalesItemGroupMaster(
        (new GetSalesItemGroupMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSalesItemGroupName("sales-item-group-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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetSalesItemGroupMasterRequest;
import io.gs2.showcase.result.GetSalesItemGroupMasterResult;

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

try {
    GetSalesItemGroupMasterResult result = client.getSalesItemGroupMaster(
        new GetSalesItemGroupMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemGroupName("sales-item-group-0001")
    );
    SalesItemGroupMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetSalesItemGroupMasterRequest;
using Gs2.Gs2Showcase.Result.GetSalesItemGroupMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getSalesItemGroupMaster(
    new GetSalesItemGroupMasterRequest()
        .withNamespaceName("namespace1")
        .withSalesItemGroupName("sales-item-group-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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.getSalesItemGroupMaster(
        new Gs2Showcase.GetSalesItemGroupMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemGroupName("sales-item-group-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.get_sales_item_group_master(
        showcase.GetSalesItemGroupMasterRequest()
            .with_namespace_name(self.hash1)
            .with_sales_item_group_name('sales-item-group-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.get_sales_item_group_master({
    namespaceName='namespace1',
    salesItemGroupName='sales-item-group-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文字 ネームスペース名
salesItemGroupName string ~ 128文字 商品名

Result

説明
item SalesItemGroupMaster 商品グループマスター

updateSalesItemGroupMaster

updateSalesItemGroupMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.UpdateSalesItemGroupMaster(
    &showcase.UpdateSalesItemGroupMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SalesItemGroupName: pointy.String("sales-item-group-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("SALES_ITEM_GROUP_0001"),
        SalesItemNames: []string{
            "$salesItem1.name",
        "$salesItem2.name",
        "$salesItem3.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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\UpdateSalesItemGroupMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateSalesItemGroupMaster(
        (new UpdateSalesItemGroupMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSalesItemGroupName("sales-item-group-0001")
            ->withDescription("description1")
            ->withMetadata("SALES_ITEM_GROUP_0001")
            ->withSalesItemNames([    self::$salesItem1.name,
            self::$salesItem2.name,
            self::$salesItem3.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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.UpdateSalesItemGroupMasterRequest;
import io.gs2.showcase.result.UpdateSalesItemGroupMasterResult;

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

try {
    UpdateSalesItemGroupMasterResult result = client.updateSalesItemGroupMaster(
        new UpdateSalesItemGroupMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemGroupName("sales-item-group-0001")
            .withDescription("description1")
            .withMetadata("SALES_ITEM_GROUP_0001")
            .withSalesItemNames(Arrays.asList(
                "$salesItem1.name",
            "$salesItem2.name",
            "$salesItem3.name"
            ))
    );
    SalesItemGroupMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.UpdateSalesItemGroupMasterRequest;
using Gs2.Gs2Showcase.Result.UpdateSalesItemGroupMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateSalesItemGroupMaster(
    new UpdateSalesItemGroupMasterRequest()
        .withNamespaceName("namespace1")
        .withSalesItemGroupName("sales-item-group-0001")
        .withDescription("description1")
        .withMetadata("SALES_ITEM_GROUP_0001")
        .withSalesItemNames(new string[] {
            "$salesItem1.name",
        "$salesItem2.name",
        "$salesItem3.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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.updateSalesItemGroupMaster(
        new Gs2Showcase.UpdateSalesItemGroupMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemGroupName("sales-item-group-0001")
            .withDescription("description1")
            .withMetadata("SALES_ITEM_GROUP_0001")
            .withSalesItemNames([
                "$salesItem1.name",
            "$salesItem2.name",
            "$salesItem3.name"
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.update_sales_item_group_master(
        showcase.UpdateSalesItemGroupMasterRequest()
            .with_namespace_name(self.hash1)
            .with_sales_item_group_name('sales-item-group-0001')
            .with_description('description1')
            .with_metadata('SALES_ITEM_GROUP_0001')
            .with_sales_item_names([    self.sales_item1.name,
            self.sales_item2.name,
            self.sales_item3.name,
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.update_sales_item_group_master({
    namespaceName='namespace1',
    salesItemGroupName='sales-item-group-0001',
    description='description1',
    metadata='SALES_ITEM_GROUP_0001',
    salesItemNames={
        '$salesItem1.name',
    '$salesItem2.name',
    '$salesItem3.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文字 ネームスペース名
salesItemGroupName string ~ 128文字 商品名
description string ~ 1024文字 説明文
metadata string ~ 2048文字 メタデータ
salesItemNames string[] 商品グループに含める商品リスト

Result

説明
item SalesItemGroupMaster 更新した商品グループマスター

deleteSalesItemGroupMaster

deleteSalesItemGroupMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DeleteSalesItemGroupMaster(
    &showcase.DeleteSalesItemGroupMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SalesItemGroupName: pointy.String("sales-item-group-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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DeleteSalesItemGroupMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteSalesItemGroupMaster(
        (new DeleteSalesItemGroupMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSalesItemGroupName("sales-item-group-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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DeleteSalesItemGroupMasterRequest;
import io.gs2.showcase.result.DeleteSalesItemGroupMasterResult;

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

try {
    DeleteSalesItemGroupMasterResult result = client.deleteSalesItemGroupMaster(
        new DeleteSalesItemGroupMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemGroupName("sales-item-group-0001")
    );
    SalesItemGroupMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DeleteSalesItemGroupMasterRequest;
using Gs2.Gs2Showcase.Result.DeleteSalesItemGroupMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteSalesItemGroupMaster(
    new DeleteSalesItemGroupMasterRequest()
        .withNamespaceName("namespace1")
        .withSalesItemGroupName("sales-item-group-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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.deleteSalesItemGroupMaster(
        new Gs2Showcase.DeleteSalesItemGroupMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemGroupName("sales-item-group-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.delete_sales_item_group_master(
        showcase.DeleteSalesItemGroupMasterRequest()
            .with_namespace_name(self.hash1)
            .with_sales_item_group_name('sales-item-group-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.delete_sales_item_group_master({
    namespaceName='namespace1',
    salesItemGroupName='sales-item-group-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文字 ネームスペース名
salesItemGroupName string ~ 128文字 商品名

Result

説明
item SalesItemGroupMaster 削除した商品グループマスター

describeShowcaseMasters

describeShowcaseMasters

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DescribeShowcaseMasters(
    &showcase.DescribeShowcaseMastersRequest {
        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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DescribeShowcaseMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeShowcaseMasters(
        (new DescribeShowcaseMastersRequest())
            ->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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DescribeShowcaseMastersRequest;
import io.gs2.showcase.result.DescribeShowcaseMastersResult;

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

try {
    DescribeShowcaseMastersResult result = client.describeShowcaseMasters(
        new DescribeShowcaseMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<ShowcaseMaster> 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DescribeShowcaseMastersRequest;
using Gs2.Gs2Showcase.Result.DescribeShowcaseMastersResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeShowcaseMasters(
    new DescribeShowcaseMastersRequest()
        .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 Gs2Showcase from '@/gs2/showcase';

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

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

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

try:
    result = client.describe_showcase_masters(
        showcase.DescribeShowcaseMastersRequest()
            .with_namespace_name(self.hash1)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.describe_showcase_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 ShowcaseMaster[] 陳列棚マスターのリスト
nextPageToken string リストの続きを取得するためのページトークン

createShowcaseMaster

createShowcaseMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.CreateShowcaseMaster(
    &showcase.CreateShowcaseMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("showcase-0001"),
        Description: nil,
        Metadata: nil,
        DisplayItems: []showcase.DisplayItemMaster{
            showcase.DisplayItemMaster{
                Type: pointy.String("salesItem"),
                SalesItemName: pointy.String("$salesItem1.name"),
            },
        showcase.DisplayItemMaster{
                Type: pointy.String("salesItemGroup"),
                SalesItemGroupName: pointy.String("$salesItemGroup1.name"),
                SalesPeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001"),
            },
        },
        SalesPeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\CreateShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createShowcaseMaster(
        (new CreateShowcaseMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("showcase-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withDisplayItems([    (new \Gs2\Showcase\Model\DisplayItemMaster())
                ->withType("salesItem")
                ->withSalesItemName(self::$salesItem1.name),
            (new \Gs2\Showcase\Model\DisplayItemMaster())
                ->withType("salesItemGroup")
                ->withSalesItemGroupName(self::$salesItemGroup1.name)
                ->withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001"),
            ])
            ->withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.CreateShowcaseMasterRequest;
import io.gs2.showcase.result.CreateShowcaseMasterResult;

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

try {
    CreateShowcaseMasterResult result = client.createShowcaseMaster(
        new CreateShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withName("showcase-0001")
            .withDescription(null)
            .withMetadata(null)
            .withDisplayItems(Arrays.asList(
                new io.gs2.showcase.model.DisplayItemMaster()
                    .withType("salesItem")
                    .withSalesItemName("$salesItem1.name"),
            new io.gs2.showcase.model.DisplayItemMaster()
                    .withType("salesItemGroup")
                    .withSalesItemGroupName("$salesItemGroup1.name")
                    .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
            ))
            .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
    );
    ShowcaseMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.CreateShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.CreateShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createShowcaseMaster(
    new CreateShowcaseMasterRequest()
        .withNamespaceName("namespace1")
        .withName("showcase-0001")
        .withDescription(null)
        .withMetadata(null)
        .withDisplayItems(new Gs2.Gs2Showcase.Model.DisplayItemMaster[] {
            new Gs2.Gs2Showcase.Model.DisplayItemMaster()
                .WithType("salesItem")
                .WithSalesItemName("$salesItem1.name"),
        new Gs2.Gs2Showcase.Model.DisplayItemMaster()
                .WithType("salesItemGroup")
                .WithSalesItemGroupName("$salesItemGroup1.name")
                .WithSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
        })
        .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.createShowcaseMaster(
        new Gs2Showcase.CreateShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withName("showcase-0001")
            .withDescription(null)
            .withMetadata(null)
            .withDisplayItems([
                new Gs2Showcase.Model.DisplayItemMaster()
                    .withType("salesItem")
                    .withSalesItemName("$salesItem1.name"),
            new Gs2Showcase.Model.DisplayItemMaster()
                    .withType("salesItemGroup")
                    .withSalesItemGroupName("$salesItemGroup1.name")
                    .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
            ])
            .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.create_showcase_master(
        showcase.CreateShowcaseMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('showcase-0001')
            .with_description(None)
            .with_metadata(None)
            .with_display_items([    showcase.DisplayItemMaster()
                .with_type('salesItem')
                .with_sales_item_name(self.sales_item1.name),
            showcase.DisplayItemMaster()
                .with_type('salesItemGroup')
                .with_sales_item_group_name(self.sales_item_group1.name)
                .with_sales_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001'),
            ])
            .with_sales_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.create_showcase_master({
    namespaceName='namespace1',
    name='showcase-0001',
    description=nil,
    metadata=nil,
    displayItems={
        {
            type='salesItem',
            salesItemName='$salesItem1.name',
        },
    {
            type='salesItemGroup',
            salesItemGroupName='$salesItemGroup1.name',
            salesPeriodEventId='grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001',
        }
    },
    salesPeriodEventId='grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-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文字 ネームスペース名
name string ~ 128文字 陳列棚名
description string ~ 1024文字 説明文
metadata string ~ 2048文字 メタデータ
displayItems DisplayItemMaster[] 陳列する商品モデル一覧
salesPeriodEventId string ~ 1024文字 陳列棚の販売期間を設定した GS2-Schedule のイベント

Result

説明
item ShowcaseMaster 作成した陳列棚マスター

getShowcaseMaster

getShowcaseMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetShowcaseMaster(
    &showcase.GetShowcaseMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getShowcaseMaster(
        (new GetShowcaseMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetShowcaseMasterRequest;
import io.gs2.showcase.result.GetShowcaseMasterResult;

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

try {
    GetShowcaseMasterResult result = client.getShowcaseMaster(
        new GetShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
    );
    ShowcaseMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.GetShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getShowcaseMaster(
    new GetShowcaseMasterRequest()
        .withNamespaceName("namespace1")
        .withShowcaseName("showcase-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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.getShowcaseMaster(
        new Gs2Showcase.GetShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.get_showcase_master(
        showcase.GetShowcaseMasterRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.get_showcase_master({
    namespaceName='namespace1',
    showcaseName='showcase-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文字 ネームスペース名
showcaseName string ~ 128文字 陳列棚名

Result

説明
item ShowcaseMaster 陳列棚マスター

updateShowcaseMaster

updateShowcaseMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.UpdateShowcaseMaster(
    &showcase.UpdateShowcaseMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("SHOWCASE_0001"),
        DisplayItems: []showcase.DisplayItemMaster{
            showcase.DisplayItemMaster{
                Type: pointy.String("salesItem"),
                SalesItemName: pointy.String("$salesItem3.name"),
            },
        showcase.DisplayItemMaster{
                Type: pointy.String("salesItemGroup"),
                SalesItemGroupName: pointy.String("$salesItemGroup1.name"),
                SalesPeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001"),
            },
        },
        SalesPeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\UpdateShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateShowcaseMaster(
        (new UpdateShowcaseMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withDescription("description1")
            ->withMetadata("SHOWCASE_0001")
            ->withDisplayItems([    (new \Gs2\Showcase\Model\DisplayItemMaster())
                ->withType("salesItem")
                ->withSalesItemName(self::$salesItem3.name),
            (new \Gs2\Showcase\Model\DisplayItemMaster())
                ->withType("salesItemGroup")
                ->withSalesItemGroupName(self::$salesItemGroup1.name)
                ->withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001"),
            ])
            ->withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.UpdateShowcaseMasterRequest;
import io.gs2.showcase.result.UpdateShowcaseMasterResult;

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

try {
    UpdateShowcaseMasterResult result = client.updateShowcaseMaster(
        new UpdateShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDescription("description1")
            .withMetadata("SHOWCASE_0001")
            .withDisplayItems(Arrays.asList(
                new io.gs2.showcase.model.DisplayItemMaster()
                    .withType("salesItem")
                    .withSalesItemName("$salesItem3.name"),
            new io.gs2.showcase.model.DisplayItemMaster()
                    .withType("salesItemGroup")
                    .withSalesItemGroupName("$salesItemGroup1.name")
                    .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
            ))
            .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002")
    );
    ShowcaseMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.UpdateShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.UpdateShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateShowcaseMaster(
    new UpdateShowcaseMasterRequest()
        .withNamespaceName("namespace1")
        .withShowcaseName("showcase-0001")
        .withDescription("description1")
        .withMetadata("SHOWCASE_0001")
        .withDisplayItems(new Gs2.Gs2Showcase.Model.DisplayItemMaster[] {
            new Gs2.Gs2Showcase.Model.DisplayItemMaster()
                .WithType("salesItem")
                .WithSalesItemName("$salesItem3.name"),
        new Gs2.Gs2Showcase.Model.DisplayItemMaster()
                .WithType("salesItemGroup")
                .WithSalesItemGroupName("$salesItemGroup1.name")
                .WithSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
        })
        .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.updateShowcaseMaster(
        new Gs2Showcase.UpdateShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDescription("description1")
            .withMetadata("SHOWCASE_0001")
            .withDisplayItems([
                new Gs2Showcase.Model.DisplayItemMaster()
                    .withType("salesItem")
                    .withSalesItemName("$salesItem3.name"),
            new Gs2Showcase.Model.DisplayItemMaster()
                    .withType("salesItemGroup")
                    .withSalesItemGroupName("$salesItemGroup1.name")
                    .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
            ])
            .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.update_showcase_master(
        showcase.UpdateShowcaseMasterRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_description('description1')
            .with_metadata('SHOWCASE_0001')
            .with_display_items([    showcase.DisplayItemMaster()
                .with_type('salesItem')
                .with_sales_item_name(self.sales_item3.name),
            showcase.DisplayItemMaster()
                .with_type('salesItemGroup')
                .with_sales_item_group_name(self.sales_item_group1.name)
                .with_sales_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001'),
            ])
            .with_sales_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.update_showcase_master({
    namespaceName='namespace1',
    showcaseName='showcase-0001',
    description='description1',
    metadata='SHOWCASE_0001',
    displayItems={
        {
            type='salesItem',
            salesItemName='$salesItem3.name',
        },
    {
            type='salesItemGroup',
            salesItemGroupName='$salesItemGroup1.name',
            salesPeriodEventId='grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001',
        }
    },
    salesPeriodEventId='grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002',
});

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

result = api_result.result
item = result.item;

陳列棚マスターを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
showcaseName string ~ 128文字 陳列棚名
description string ~ 1024文字 説明文
metadata string ~ 2048文字 メタデータ
displayItems DisplayItemMaster[] 陳列する商品モデル一覧
salesPeriodEventId string ~ 1024文字 陳列棚の販売期間を設定した GS2-Schedule のイベント

Result

説明
item ShowcaseMaster 更新した陳列棚マスター

deleteShowcaseMaster

deleteShowcaseMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DeleteShowcaseMaster(
    &showcase.DeleteShowcaseMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DeleteShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteShowcaseMaster(
        (new DeleteShowcaseMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DeleteShowcaseMasterRequest;
import io.gs2.showcase.result.DeleteShowcaseMasterResult;

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

try {
    DeleteShowcaseMasterResult result = client.deleteShowcaseMaster(
        new DeleteShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
    );
    ShowcaseMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DeleteShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.DeleteShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteShowcaseMaster(
    new DeleteShowcaseMasterRequest()
        .withNamespaceName("namespace1")
        .withShowcaseName("showcase-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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.deleteShowcaseMaster(
        new Gs2Showcase.DeleteShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.delete_showcase_master(
        showcase.DeleteShowcaseMasterRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.delete_showcase_master({
    namespaceName='namespace1',
    showcaseName='showcase-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文字 ネームスペース名
showcaseName string ~ 128文字 陳列棚名

Result

説明
item ShowcaseMaster 削除した陳列棚マスター

exportMaster

exportMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &showcase.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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.ExportMasterRequest;
import io.gs2.showcase.result.ExportMasterResult;

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

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

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ShowcaseRestClient(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 Gs2Showcase from '@/gs2/showcase';

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

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

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

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

client = gs2('showcase')

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 CurrentShowcaseMaster 現在有効な陳列棚マスター

getCurrentShowcaseMaster

getCurrentShowcaseMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetCurrentShowcaseMaster(
    &showcase.GetCurrentShowcaseMasterRequest {
        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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetCurrentShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCurrentShowcaseMaster(
        (new GetCurrentShowcaseMasterRequest())
            ->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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetCurrentShowcaseMasterRequest;
import io.gs2.showcase.result.GetCurrentShowcaseMasterResult;

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

try {
    GetCurrentShowcaseMasterResult result = client.getCurrentShowcaseMaster(
        new GetCurrentShowcaseMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentShowcaseMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetCurrentShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.GetCurrentShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getCurrentShowcaseMaster(
    new GetCurrentShowcaseMasterRequest()
        .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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.getCurrentShowcaseMaster(
        new Gs2Showcase.GetCurrentShowcaseMasterRequest()
            .withNamespaceName("namespace1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.get_current_showcase_master(
        showcase.GetCurrentShowcaseMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.get_current_showcase_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 CurrentShowcaseMaster 現在有効な陳列棚マスター

updateCurrentShowcaseMaster

updateCurrentShowcaseMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentShowcaseMaster(
    &showcase.UpdateCurrentShowcaseMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Settings: pointy.String("{\n      \"version\": \"2019-04-04\",\n      \"showcases\": [\n        {\n          \"name\": \"gem\",\n          \"metadata\": \"GEM\",\n          \"displayItems\": [\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"gem_3000\",\n                \"metadata\": \"GEM_3000\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:InAppPurchase\",\n                    \"request\": \"Gs2Money:InAppPurchase:request\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Money:DepositByUserId\",\n                    \"request\": \"Gs2Money:DepositByUserId:request\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"salesItemGroup\",\n              \"salesPeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001\",\n              \"salesItemGroup\": {\n                \"name\": \"step_gem\",\n                \"metadata\": \"STEP_GEM\",\n                \"salesItems\": [\n                  {\n                    \"name\": \"step1_gem_1000\",\n                    \"metadata\": \"STEP1_GEM_1000\",\n                    \"consumeActions\": [\n                      {\n                        \"action\": \"Gs2Money:InAppPurchase\",\n                        \"request\": \"Gs2Money:InAppPurchase:request\"\n                      },\n                      {\n                        \"action\": \"Gs2Limit:CountUpByUserId\",\n                        \"request\": \"Gs2Limit:CountUpByUserId:request\"\n                      }\n                    ],\n                    \"acquireActions\": [\n                      {\n                        \"action\": \"Gs2Money:DepositByUserId\",\n                        \"request\": \"Gs2Money:DepositByUserId:request\"\n                      }\n                    ]\n                  },\n                  {\n                    \"name\": \"step2_gem_2000\",\n                    \"metadata\": \"STEP1_GEM_2000\",\n                    \"consumeActions\": [\n                      {\n                        \"action\": \"Gs2Money:InAppPurchase\",\n                        \"request\": \"Gs2Money:InAppPurchase:request\"\n                      },\n                      {\n                        \"action\": \"Gs2Limit:CountUpByUserId\",\n                        \"request\": \"Gs2Limit:CountUpByUserId:request\"\n                      }\n                    ],\n                    \"acquireActions\": [\n                      {\n                        \"action\": \"Gs2Money:DepositByUserId\",\n                        \"request\": \"Gs2Money:DepositByUserId:request\"\n                      }\n                    ]\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"displayItems\": [\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"single\",\n                \"metadata\": \"SINGLE\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:WithdrawByUserId\",\n                    \"request\": \"{\\\"moneyName\\\": \\\"money-0001\\\", \\\"userId\\\": \\\"{userId}\\\", \\\"slot\\\": \\\"{slot}\\\", \\\"count\\\": 100, \\\"paidOnly\\\": false}\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"{\\\"categoryName\\\": \\\"category-0001\\\", \\\"inventoryModelName\\\": \\\"character\\\", \\\"itemModelName\\\": \\\"ssr-0001\\\", \\\"userId\\\": \\\"{userId}\\\", \\\"acquireCount\\\": 1}\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"10times\",\n                \"metadata\": \"10TIMES\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:WithdrawByUserId\",\n                    \"request\": \"Gs2Money:WithdrawByUserId:request\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  }\n                ]\n              }\n            }\n          ]\n        }\n      ]\n    }"),
    }
)
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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\UpdateCurrentShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentShowcaseMaster(
        (new UpdateCurrentShowcaseMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSettings("{\n      \"version\": \"2019-04-04\",\n      \"showcases\": [\n        {\n          \"name\": \"gem\",\n          \"metadata\": \"GEM\",\n          \"displayItems\": [\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"gem_3000\",\n                \"metadata\": \"GEM_3000\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:InAppPurchase\",\n                    \"request\": \"Gs2Money:InAppPurchase:request\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Money:DepositByUserId\",\n                    \"request\": \"Gs2Money:DepositByUserId:request\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"salesItemGroup\",\n              \"salesPeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001\",\n              \"salesItemGroup\": {\n                \"name\": \"step_gem\",\n                \"metadata\": \"STEP_GEM\",\n                \"salesItems\": [\n                  {\n                    \"name\": \"step1_gem_1000\",\n                    \"metadata\": \"STEP1_GEM_1000\",\n                    \"consumeActions\": [\n                      {\n                        \"action\": \"Gs2Money:InAppPurchase\",\n                        \"request\": \"Gs2Money:InAppPurchase:request\"\n                      },\n                      {\n                        \"action\": \"Gs2Limit:CountUpByUserId\",\n                        \"request\": \"Gs2Limit:CountUpByUserId:request\"\n                      }\n                    ],\n                    \"acquireActions\": [\n                      {\n                        \"action\": \"Gs2Money:DepositByUserId\",\n                        \"request\": \"Gs2Money:DepositByUserId:request\"\n                      }\n                    ]\n                  },\n                  {\n                    \"name\": \"step2_gem_2000\",\n                    \"metadata\": \"STEP1_GEM_2000\",\n                    \"consumeActions\": [\n                      {\n                        \"action\": \"Gs2Money:InAppPurchase\",\n                        \"request\": \"Gs2Money:InAppPurchase:request\"\n                      },\n                      {\n                        \"action\": \"Gs2Limit:CountUpByUserId\",\n                        \"request\": \"Gs2Limit:CountUpByUserId:request\"\n                      }\n                    ],\n                    \"acquireActions\": [\n                      {\n                        \"action\": \"Gs2Money:DepositByUserId\",\n                        \"request\": \"Gs2Money:DepositByUserId:request\"\n                      }\n                    ]\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"displayItems\": [\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"single\",\n                \"metadata\": \"SINGLE\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:WithdrawByUserId\",\n                    \"request\": \"{\\\"moneyName\\\": \\\"money-0001\\\", \\\"userId\\\": \\\"{userId}\\\", \\\"slot\\\": \\\"{slot}\\\", \\\"count\\\": 100, \\\"paidOnly\\\": false}\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"{\\\"categoryName\\\": \\\"category-0001\\\", \\\"inventoryModelName\\\": \\\"character\\\", \\\"itemModelName\\\": \\\"ssr-0001\\\", \\\"userId\\\": \\\"{userId}\\\", \\\"acquireCount\\\": 1}\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"10times\",\n                \"metadata\": \"10TIMES\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:WithdrawByUserId\",\n                    \"request\": \"Gs2Money:WithdrawByUserId:request\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  }\n                ]\n              }\n            }\n          ]\n        }\n      ]\n    }")
    );
    $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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.UpdateCurrentShowcaseMasterRequest;
import io.gs2.showcase.result.UpdateCurrentShowcaseMasterResult;

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

try {
    UpdateCurrentShowcaseMasterResult result = client.updateCurrentShowcaseMaster(
        new UpdateCurrentShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n      \"version\": \"2019-04-04\",\n      \"showcases\": [\n        {\n          \"name\": \"gem\",\n          \"metadata\": \"GEM\",\n          \"displayItems\": [\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"gem_3000\",\n                \"metadata\": \"GEM_3000\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:InAppPurchase\",\n                    \"request\": \"Gs2Money:InAppPurchase:request\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Money:DepositByUserId\",\n                    \"request\": \"Gs2Money:DepositByUserId:request\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"salesItemGroup\",\n              \"salesPeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001\",\n              \"salesItemGroup\": {\n                \"name\": \"step_gem\",\n                \"metadata\": \"STEP_GEM\",\n                \"salesItems\": [\n                  {\n                    \"name\": \"step1_gem_1000\",\n                    \"metadata\": \"STEP1_GEM_1000\",\n                    \"consumeActions\": [\n                      {\n                        \"action\": \"Gs2Money:InAppPurchase\",\n                        \"request\": \"Gs2Money:InAppPurchase:request\"\n                      },\n                      {\n                        \"action\": \"Gs2Limit:CountUpByUserId\",\n                        \"request\": \"Gs2Limit:CountUpByUserId:request\"\n                      }\n                    ],\n                    \"acquireActions\": [\n                      {\n                        \"action\": \"Gs2Money:DepositByUserId\",\n                        \"request\": \"Gs2Money:DepositByUserId:request\"\n                      }\n                    ]\n                  },\n                  {\n                    \"name\": \"step2_gem_2000\",\n                    \"metadata\": \"STEP1_GEM_2000\",\n                    \"consumeActions\": [\n                      {\n                        \"action\": \"Gs2Money:InAppPurchase\",\n                        \"request\": \"Gs2Money:InAppPurchase:request\"\n                      },\n                      {\n                        \"action\": \"Gs2Limit:CountUpByUserId\",\n                        \"request\": \"Gs2Limit:CountUpByUserId:request\"\n                      }\n                    ],\n                    \"acquireActions\": [\n                      {\n                        \"action\": \"Gs2Money:DepositByUserId\",\n                        \"request\": \"Gs2Money:DepositByUserId:request\"\n                      }\n                    ]\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"displayItems\": [\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"single\",\n                \"metadata\": \"SINGLE\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:WithdrawByUserId\",\n                    \"request\": \"{\\\"moneyName\\\": \\\"money-0001\\\", \\\"userId\\\": \\\"{userId}\\\", \\\"slot\\\": \\\"{slot}\\\", \\\"count\\\": 100, \\\"paidOnly\\\": false}\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"{\\\"categoryName\\\": \\\"category-0001\\\", \\\"inventoryModelName\\\": \\\"character\\\", \\\"itemModelName\\\": \\\"ssr-0001\\\", \\\"userId\\\": \\\"{userId}\\\", \\\"acquireCount\\\": 1}\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"10times\",\n                \"metadata\": \"10TIMES\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:WithdrawByUserId\",\n                    \"request\": \"Gs2Money:WithdrawByUserId:request\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  }\n                ]\n              }\n            }\n          ]\n        }\n      ]\n    }")
    );
    CurrentShowcaseMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.UpdateCurrentShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.UpdateCurrentShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCurrentShowcaseMaster(
    new UpdateCurrentShowcaseMasterRequest()
        .withNamespaceName("namespace1")
        .withSettings("{\n      \"version\": \"2019-04-04\",\n      \"showcases\": [\n        {\n          \"name\": \"gem\",\n          \"metadata\": \"GEM\",\n          \"displayItems\": [\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"gem_3000\",\n                \"metadata\": \"GEM_3000\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:InAppPurchase\",\n                    \"request\": \"Gs2Money:InAppPurchase:request\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Money:DepositByUserId\",\n                    \"request\": \"Gs2Money:DepositByUserId:request\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"salesItemGroup\",\n              \"salesPeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001\",\n              \"salesItemGroup\": {\n                \"name\": \"step_gem\",\n                \"metadata\": \"STEP_GEM\",\n                \"salesItems\": [\n                  {\n                    \"name\": \"step1_gem_1000\",\n                    \"metadata\": \"STEP1_GEM_1000\",\n                    \"consumeActions\": [\n                      {\n                        \"action\": \"Gs2Money:InAppPurchase\",\n                        \"request\": \"Gs2Money:InAppPurchase:request\"\n                      },\n                      {\n                        \"action\": \"Gs2Limit:CountUpByUserId\",\n                        \"request\": \"Gs2Limit:CountUpByUserId:request\"\n                      }\n                    ],\n                    \"acquireActions\": [\n                      {\n                        \"action\": \"Gs2Money:DepositByUserId\",\n                        \"request\": \"Gs2Money:DepositByUserId:request\"\n                      }\n                    ]\n                  },\n                  {\n                    \"name\": \"step2_gem_2000\",\n                    \"metadata\": \"STEP1_GEM_2000\",\n                    \"consumeActions\": [\n                      {\n                        \"action\": \"Gs2Money:InAppPurchase\",\n                        \"request\": \"Gs2Money:InAppPurchase:request\"\n                      },\n                      {\n                        \"action\": \"Gs2Limit:CountUpByUserId\",\n                        \"request\": \"Gs2Limit:CountUpByUserId:request\"\n                      }\n                    ],\n                    \"acquireActions\": [\n                      {\n                        \"action\": \"Gs2Money:DepositByUserId\",\n                        \"request\": \"Gs2Money:DepositByUserId:request\"\n                      }\n                    ]\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"displayItems\": [\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"single\",\n                \"metadata\": \"SINGLE\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:WithdrawByUserId\",\n                    \"request\": \"{\\\"moneyName\\\": \\\"money-0001\\\", \\\"userId\\\": \\\"{userId}\\\", \\\"slot\\\": \\\"{slot}\\\", \\\"count\\\": 100, \\\"paidOnly\\\": false}\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"{\\\"categoryName\\\": \\\"category-0001\\\", \\\"inventoryModelName\\\": \\\"character\\\", \\\"itemModelName\\\": \\\"ssr-0001\\\", \\\"userId\\\": \\\"{userId}\\\", \\\"acquireCount\\\": 1}\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"10times\",\n                \"metadata\": \"10TIMES\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:WithdrawByUserId\",\n                    \"request\": \"Gs2Money:WithdrawByUserId:request\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  }\n                ]\n              }\n            }\n          ]\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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.updateCurrentShowcaseMaster(
        new Gs2Showcase.UpdateCurrentShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n      \"version\": \"2019-04-04\",\n      \"showcases\": [\n        {\n          \"name\": \"gem\",\n          \"metadata\": \"GEM\",\n          \"displayItems\": [\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"gem_3000\",\n                \"metadata\": \"GEM_3000\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:InAppPurchase\",\n                    \"request\": \"Gs2Money:InAppPurchase:request\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Money:DepositByUserId\",\n                    \"request\": \"Gs2Money:DepositByUserId:request\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"salesItemGroup\",\n              \"salesPeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001\",\n              \"salesItemGroup\": {\n                \"name\": \"step_gem\",\n                \"metadata\": \"STEP_GEM\",\n                \"salesItems\": [\n                  {\n                    \"name\": \"step1_gem_1000\",\n                    \"metadata\": \"STEP1_GEM_1000\",\n                    \"consumeActions\": [\n                      {\n                        \"action\": \"Gs2Money:InAppPurchase\",\n                        \"request\": \"Gs2Money:InAppPurchase:request\"\n                      },\n                      {\n                        \"action\": \"Gs2Limit:CountUpByUserId\",\n                        \"request\": \"Gs2Limit:CountUpByUserId:request\"\n                      }\n                    ],\n                    \"acquireActions\": [\n                      {\n                        \"action\": \"Gs2Money:DepositByUserId\",\n                        \"request\": \"Gs2Money:DepositByUserId:request\"\n                      }\n                    ]\n                  },\n                  {\n                    \"name\": \"step2_gem_2000\",\n                    \"metadata\": \"STEP1_GEM_2000\",\n                    \"consumeActions\": [\n                      {\n                        \"action\": \"Gs2Money:InAppPurchase\",\n                        \"request\": \"Gs2Money:InAppPurchase:request\"\n                      },\n                      {\n                        \"action\": \"Gs2Limit:CountUpByUserId\",\n                        \"request\": \"Gs2Limit:CountUpByUserId:request\"\n                      }\n                    ],\n                    \"acquireActions\": [\n                      {\n                        \"action\": \"Gs2Money:DepositByUserId\",\n                        \"request\": \"Gs2Money:DepositByUserId:request\"\n                      }\n                    ]\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"displayItems\": [\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"single\",\n                \"metadata\": \"SINGLE\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:WithdrawByUserId\",\n                    \"request\": \"{\\\"moneyName\\\": \\\"money-0001\\\", \\\"userId\\\": \\\"{userId}\\\", \\\"slot\\\": \\\"{slot}\\\", \\\"count\\\": 100, \\\"paidOnly\\\": false}\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"{\\\"categoryName\\\": \\\"category-0001\\\", \\\"inventoryModelName\\\": \\\"character\\\", \\\"itemModelName\\\": \\\"ssr-0001\\\", \\\"userId\\\": \\\"{userId}\\\", \\\"acquireCount\\\": 1}\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"10times\",\n                \"metadata\": \"10TIMES\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:WithdrawByUserId\",\n                    \"request\": \"Gs2Money:WithdrawByUserId:request\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  }\n                ]\n              }\n            }\n          ]\n        }\n      ]\n    }")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.update_current_showcase_master(
        showcase.UpdateCurrentShowcaseMasterRequest()
            .with_namespace_name(self.hash1)
            .with_settings('{\n      "version": "2019-04-04",\n      "showcases": [\n        {\n          "name": "gem",\n          "metadata": "GEM",\n          "displayItems": [\n            {\n              "type": "salesItem",\n              "salesItem": {\n                "name": "gem_3000",\n                "metadata": "GEM_3000",\n                "consumeActions": [\n                  {\n                    "action": "Gs2Money:InAppPurchase",\n                    "request": "Gs2Money:InAppPurchase:request"\n                  }\n                ],\n                "acquireActions": [\n                  {\n                    "action": "Gs2Money:DepositByUserId",\n                    "request": "Gs2Money:DepositByUserId:request"\n                  }\n                ]\n              }\n            },\n            {\n              "type": "salesItemGroup",\n              "salesPeriodEventId": "grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001",\n              "salesItemGroup": {\n                "name": "step_gem",\n                "metadata": "STEP_GEM",\n                "salesItems": [\n                  {\n                    "name": "step1_gem_1000",\n                    "metadata": "STEP1_GEM_1000",\n                    "consumeActions": [\n                      {\n                        "action": "Gs2Money:InAppPurchase",\n                        "request": "Gs2Money:InAppPurchase:request"\n                      },\n                      {\n                        "action": "Gs2Limit:CountUpByUserId",\n                        "request": "Gs2Limit:CountUpByUserId:request"\n                      }\n                    ],\n                    "acquireActions": [\n                      {\n                        "action": "Gs2Money:DepositByUserId",\n                        "request": "Gs2Money:DepositByUserId:request"\n                      }\n                    ]\n                  },\n                  {\n                    "name": "step2_gem_2000",\n                    "metadata": "STEP1_GEM_2000",\n                    "consumeActions": [\n                      {\n                        "action": "Gs2Money:InAppPurchase",\n                        "request": "Gs2Money:InAppPurchase:request"\n                      },\n                      {\n                        "action": "Gs2Limit:CountUpByUserId",\n                        "request": "Gs2Limit:CountUpByUserId:request"\n                      }\n                    ],\n                    "acquireActions": [\n                      {\n                        "action": "Gs2Money:DepositByUserId",\n                        "request": "Gs2Money:DepositByUserId:request"\n                      }\n                    ]\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          "name": "gacha",\n          "metadata": "GACHA",\n          "displayItems": [\n            {\n              "type": "salesItem",\n              "salesItem": {\n                "name": "single",\n                "metadata": "SINGLE",\n                "consumeActions": [\n                  {\n                    "action": "Gs2Money:WithdrawByUserId",\n                    "request": "{\\"moneyName\\": \\"money-0001\\", \\"userId\\": \\"{userId}\\", \\"slot\\": \\"{slot}\\", \\"count\\": 100, \\"paidOnly\\": false}"\n                  }\n                ],\n                "acquireActions": [\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "{\\"categoryName\\": \\"category-0001\\", \\"inventoryModelName\\": \\"character\\", \\"itemModelName\\": \\"ssr-0001\\", \\"userId\\": \\"{userId}\\", \\"acquireCount\\": 1}"\n                  }\n                ]\n              }\n            },\n            {\n              "type": "salesItem",\n              "salesItem": {\n                "name": "10times",\n                "metadata": "10TIMES",\n                "consumeActions": [\n                  {\n                    "action": "Gs2Money:WithdrawByUserId",\n                    "request": "Gs2Money:WithdrawByUserId:request"\n                  }\n                ],\n                "acquireActions": [\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  }\n                ]\n              }\n            }\n          ]\n        }\n      ]\n    }')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.update_current_showcase_master({
    namespaceName='namespace1',
    settings='{\n      "version": "2019-04-04",\n      "showcases": [\n        {\n          "name": "gem",\n          "metadata": "GEM",\n          "displayItems": [\n            {\n              "type": "salesItem",\n              "salesItem": {\n                "name": "gem_3000",\n                "metadata": "GEM_3000",\n                "consumeActions": [\n                  {\n                    "action": "Gs2Money:InAppPurchase",\n                    "request": "Gs2Money:InAppPurchase:request"\n                  }\n                ],\n                "acquireActions": [\n                  {\n                    "action": "Gs2Money:DepositByUserId",\n                    "request": "Gs2Money:DepositByUserId:request"\n                  }\n                ]\n              }\n            },\n            {\n              "type": "salesItemGroup",\n              "salesPeriodEventId": "grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001",\n              "salesItemGroup": {\n                "name": "step_gem",\n                "metadata": "STEP_GEM",\n                "salesItems": [\n                  {\n                    "name": "step1_gem_1000",\n                    "metadata": "STEP1_GEM_1000",\n                    "consumeActions": [\n                      {\n                        "action": "Gs2Money:InAppPurchase",\n                        "request": "Gs2Money:InAppPurchase:request"\n                      },\n                      {\n                        "action": "Gs2Limit:CountUpByUserId",\n                        "request": "Gs2Limit:CountUpByUserId:request"\n                      }\n                    ],\n                    "acquireActions": [\n                      {\n                        "action": "Gs2Money:DepositByUserId",\n                        "request": "Gs2Money:DepositByUserId:request"\n                      }\n                    ]\n                  },\n                  {\n                    "name": "step2_gem_2000",\n                    "metadata": "STEP1_GEM_2000",\n                    "consumeActions": [\n                      {\n                        "action": "Gs2Money:InAppPurchase",\n                        "request": "Gs2Money:InAppPurchase:request"\n                      },\n                      {\n                        "action": "Gs2Limit:CountUpByUserId",\n                        "request": "Gs2Limit:CountUpByUserId:request"\n                      }\n                    ],\n                    "acquireActions": [\n                      {\n                        "action": "Gs2Money:DepositByUserId",\n                        "request": "Gs2Money:DepositByUserId:request"\n                      }\n                    ]\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          "name": "gacha",\n          "metadata": "GACHA",\n          "displayItems": [\n            {\n              "type": "salesItem",\n              "salesItem": {\n                "name": "single",\n                "metadata": "SINGLE",\n                "consumeActions": [\n                  {\n                    "action": "Gs2Money:WithdrawByUserId",\n                    "request": "{\\"moneyName\\": \\"money-0001\\", \\"userId\\": \\"{userId}\\", \\"slot\\": \\"{slot}\\", \\"count\\": 100, \\"paidOnly\\": false}"\n                  }\n                ],\n                "acquireActions": [\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "{\\"categoryName\\": \\"category-0001\\", \\"inventoryModelName\\": \\"character\\", \\"itemModelName\\": \\"ssr-0001\\", \\"userId\\": \\"{userId}\\", \\"acquireCount\\": 1}"\n                  }\n                ]\n              }\n            },\n            {\n              "type": "salesItem",\n              "salesItem": {\n                "name": "10times",\n                "metadata": "10TIMES",\n                "consumeActions": [\n                  {\n                    "action": "Gs2Money:WithdrawByUserId",\n                    "request": "Gs2Money:WithdrawByUserId:request"\n                  }\n                ],\n                "acquireActions": [\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  }\n                ]\n              }\n            }\n          ]\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 CurrentShowcaseMaster 更新した現在有効な陳列棚マスター

updateCurrentShowcaseMasterFromGitHub

updateCurrentShowcaseMasterFromGitHub

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentShowcaseMasterFromGitHub(
    &showcase.UpdateCurrentShowcaseMasterFromGitHubRequest {
        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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\UpdateCurrentShowcaseMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentShowcaseMasterFromGitHub(
        (new UpdateCurrentShowcaseMasterFromGitHubRequest())
            ->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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.UpdateCurrentShowcaseMasterFromGitHubRequest;
import io.gs2.showcase.result.UpdateCurrentShowcaseMasterFromGitHubResult;

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

try {
    UpdateCurrentShowcaseMasterFromGitHubResult result = client.updateCurrentShowcaseMasterFromGitHub(
        new UpdateCurrentShowcaseMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    CurrentShowcaseMaster 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.UpdateCurrentShowcaseMasterFromGitHubRequest;
using Gs2.Gs2Showcase.Result.UpdateCurrentShowcaseMasterFromGitHubResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCurrentShowcaseMasterFromGitHub(
    new UpdateCurrentShowcaseMasterFromGitHubRequest()
        .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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.updateCurrentShowcaseMasterFromGitHub(
        new Gs2Showcase.UpdateCurrentShowcaseMasterFromGitHubRequest()
            .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 showcase

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

try:
    result = client.update_current_showcase_master_from_git_hub(
        showcase.UpdateCurrentShowcaseMasterFromGitHubRequest()
            .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:
    exit(1)

client = gs2('showcase')

api_result = client.update_current_showcase_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 CurrentShowcaseMaster 更新した現在有効な陳列棚マスター

describeShowcases

describeShowcases

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DescribeShowcases(
    &showcase.DescribeShowcasesRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
    }
)
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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DescribeShowcasesRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeShowcases(
        (new DescribeShowcasesRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
    );
    $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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DescribeShowcasesRequest;
import io.gs2.showcase.result.DescribeShowcasesResult;

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

try {
    DescribeShowcasesResult result = client.describeShowcases(
        new DescribeShowcasesRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
    );
    List<Showcase> 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DescribeShowcasesRequest;
using Gs2.Gs2Showcase.Result.DescribeShowcasesResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeShowcases(
    new DescribeShowcasesRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.describeShowcases(
        new Gs2Showcase.DescribeShowcasesRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.describe_showcases(
        showcase.DescribeShowcasesRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

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

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

result = api_result.result
items = result.items;

陳列棚の一覧を取得

Request

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

Result

説明
items Showcase[] 陳列棚のリスト

describeShowcasesByUserId

describeShowcasesByUserId

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeShowcasesByUserId(
        (new DescribeShowcasesByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DescribeShowcasesByUserIdRequest;
import io.gs2.showcase.result.DescribeShowcasesByUserIdResult;

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

try {
    DescribeShowcasesByUserIdResult result = client.describeShowcasesByUserId(
        new DescribeShowcasesByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
    );
    List<Showcase> 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DescribeShowcasesByUserIdRequest;
using Gs2.Gs2Showcase.Result.DescribeShowcasesByUserIdResult;

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

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

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

try {
    const result = await client.describeShowcasesByUserId(
        new Gs2Showcase.DescribeShowcasesByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.describe_showcases_by_user_id(
        showcase.DescribeShowcasesByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.describe_showcases_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
items = result.items;

ユーザIDを指定して陳列棚の一覧を取得

Request

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

Result

説明
items Showcase[] 陳列棚のリスト

getShowcase

getShowcase

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetShowcase(
    &showcase.GetShowcaseRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetShowcaseRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getShowcase(
        (new GetShowcaseRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetShowcaseRequest;
import io.gs2.showcase.result.GetShowcaseResult;

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

try {
    GetShowcaseResult result = client.getShowcase(
        new GetShowcaseRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withAccessToken("$access_token_0001")
    );
    Showcase 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetShowcaseRequest;
using Gs2.Gs2Showcase.Result.GetShowcaseResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getShowcase(
    new GetShowcaseRequest()
        .withNamespaceName("namespace1")
        .withShowcaseName("showcase-0001")
        .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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.getShowcase(
        new Gs2Showcase.GetShowcaseRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withAccessToken("$access_token_0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.get_showcase(
        showcase.GetShowcaseRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_access_token(self.access_token_0001)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.get_showcase({
    namespaceName='namespace1',
    showcaseName='showcase-0001',
    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文字 ネームスペース名
showcaseName string ~ 128文字 商品名
accessToken string ~ 128文字 ユーザーID

Result

説明
item Showcase 陳列棚

getShowcaseByUserId

getShowcaseByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetShowcaseByUserId(
    &showcase.GetShowcaseByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetShowcaseByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getShowcaseByUserId(
        (new GetShowcaseByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetShowcaseByUserIdRequest;
import io.gs2.showcase.result.GetShowcaseByUserIdResult;

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

try {
    GetShowcaseByUserIdResult result = client.getShowcaseByUserId(
        new GetShowcaseByUserIdRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withUserId("user-0001")
    );
    Showcase 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetShowcaseByUserIdRequest;
using Gs2.Gs2Showcase.Result.GetShowcaseByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getShowcaseByUserId(
    new GetShowcaseByUserIdRequest()
        .withNamespaceName("namespace1")
        .withShowcaseName("showcase-0001")
        .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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.getShowcaseByUserId(
        new Gs2Showcase.GetShowcaseByUserIdRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withUserId("user-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.get_showcase_by_user_id(
        showcase.GetShowcaseByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_user_id('user-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('showcase')

api_result = client.get_showcase_by_user_id({
    namespaceName='namespace1',
    showcaseName='showcase-0001',
    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文字 ネームスペース名
showcaseName string ~ 128文字 商品名
userId string ~ 128文字 ユーザーID

Result

説明
item Showcase 陳列棚

buy

buy

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.Buy(
    &showcase.BuyRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        DisplayItemId: pointy.String("display-item-0001"),
        AccessToken: pointy.String("$access_token_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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\BuyRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->buy(
        (new BuyRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withDisplayItemId("display-item-0001")
            ->withAccessToken(self::$accessToken0001)
            ->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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.BuyRequest;
import io.gs2.showcase.result.BuyResult;

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

try {
    BuyResult result = client.buy(
        new BuyRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemId("display-item-0001")
            .withAccessToken("$access_token_0001")
            .withConfig(null)
    );
    SalesItem 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.BuyRequest;
using Gs2.Gs2Showcase.Result.BuyResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.buy(
    new BuyRequest()
        .withNamespaceName("namespace1")
        .withShowcaseName("showcase-0001")
        .withDisplayItemId("display-item-0001")
        .withAccessToken("$access_token_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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.buy(
        new Gs2Showcase.BuyRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemId("display-item-0001")
            .withAccessToken("$access_token_0001")
            .withConfig(null)
    );
    const item = result.getItem();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.buy(
        showcase.BuyRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_display_item_id('display-item-0001')
            .with_access_token(self.access_token_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:
    exit(1)

client = gs2('showcase')

api_result = client.buy({
    namespaceName='namespace1',
    showcaseName='showcase-0001',
    displayItemId='display-item-0001',
    accessToken='$access_token_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文字 ネームスペース名
showcaseName string ~ 128文字 商品名
displayItemId string UUID ~ 36文字 陳列商品ID
accessToken string ~ 128文字 ユーザーID
config Config[] [] 設定値

Result

説明
item SalesItem 商品
stampSheet string 購入処理の実行に使用するスタンプシート
stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN

buyByUserId

buyByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
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 := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.BuyByUserId(
    &showcase.BuyByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        DisplayItemId: pointy.String("display-item-0001"),
        UserId: pointy.String("user-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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\BuyByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->buyByUserId(
        (new BuyByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withDisplayItemId("display-item-0001")
            ->withUserId("user-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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.BuyByUserIdRequest;
import io.gs2.showcase.result.BuyByUserIdResult;

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

try {
    BuyByUserIdResult result = client.buyByUserId(
        new BuyByUserIdRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemId("display-item-0001")
            .withUserId("user-0001")
            .withConfig(null)
    );
    SalesItem 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.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.BuyByUserIdRequest;
using Gs2.Gs2Showcase.Result.BuyByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.buyByUserId(
    new BuyByUserIdRequest()
        .withNamespaceName("namespace1")
        .withShowcaseName("showcase-0001")
        .withDisplayItemId("display-item-0001")
        .withUserId("user-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 Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.buyByUserId(
        new Gs2Showcase.BuyByUserIdRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemId("display-item-0001")
            .withUserId("user-0001")
            .withConfig(null)
    );
    const item = result.getItem();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.buy_by_user_id(
        showcase.BuyByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_display_item_id('display-item-0001')
            .with_user_id('user-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:
    exit(1)

client = gs2('showcase')

api_result = client.buy_by_user_id({
    namespaceName='namespace1',
    showcaseName='showcase-0001',
    displayItemId='display-item-0001',
    userId='user-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文字 ネームスペース名
showcaseName string ~ 128文字 商品名
displayItemId string UUID ~ 36文字 陳列商品ID
userId string ~ 128文字 ユーザーID
config Config[] [] 設定値

Result

説明
item SalesItem 商品
stampSheet string 購入処理の実行に使用するスタンプシート
stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN