NAV
go python java php typescript csharp GS2-Script

GS2-Distributor

GS2-SDK のリファレンス

モデル

Namespace

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

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

説明
namespaceId string ネームスペースGRN
name string ネームスペース名
description string 説明文
assumeUserId string ユーザGRN
logSetting LogSetting ログの出力設定
createdAt long 作成日時
updatedAt long 最終更新日時

DistributorModelMaster

配信設定とはエンティティの入手時に所持枠を超えて入手した時のポリシーを設定するエンティティです。 GS2-Distributor を通して入手処理を行うことで、あふれたリソースを GS2-Inbox のメッセージとして転送することができます。

説明
distributorModelId string 配信設定マスターGRN
name string 配信設定名
description string 説明文
metadata string メタデータ
inboxNamespaceId string ネームスペースGRN
whiteListTargetIds string[] ディストリビューターを通して処理出来る対象のリソースGRNのホワイトリスト
createdAt long 作成日時
updatedAt long 最終更新日時

DistributorModel

配信設定とはエンティティの入手時に所持枠を超えて入手した時のポリシーを設定するエンティティです。 GS2-Distributor を通して入手処理を行うことで、あふれたリソースを GS2-Inbox のメッセージとして転送することができます。

説明
distributorModelId string 配信設定GRN
name string 配信設定名
metadata string メタデータ
inboxNamespaceId string ネームスペースGRN
whiteListTargetIds string[] ディストリビューターを通して処理出来る対象のリソースGRNのホワイトリスト

CurrentDistributorMaster

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 タグ名

DistributeResource

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

LogSetting

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

メソッド

describeNamespaces

describeNamespaces

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

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

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

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

try {
    const result = await client.describeNamespaces(
        new Gs2Distributor.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 distributor

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

try:
    result = client.describe_namespaces(
        distributor.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('distributor')

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/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &distributor.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        AssumeUserId: pointy.String("grn:gs2::YourOwnerId:identifier:user:user-0001"),
        LogSetting: &distributor.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\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\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)
            ->withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            ->withLogSetting((new \Gs2\Distributor\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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.CreateNamespaceRequest;
import io.gs2.distributor.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            .withLogSetting(new io.gs2.distributor.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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.CreateNamespaceRequest;
using Gs2.Gs2Distributor.Result.CreateNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createNamespace(
    new CreateNamespaceRequest()
        .withName("namespace1")
        .withDescription(null)
        .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
        .withLogSetting(new Gs2.Gs2Distributor.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 Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.createNamespace(
        new Gs2Distributor.CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            .withLogSetting(new Gs2Distributor.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 distributor

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

try:
    result = client.create_namespace(
        distributor.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_assume_user_id('grn:gs2::YourOwnerId:identifier:user:user-0001')
            .with_log_setting(
                distributor.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('distributor')

api_result = client.create_namespace({
    name='namespace1',
    description=nil,
    assumeUserId='grn:gs2::YourOwnerId:identifier:user:user-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文字 説明文
assumeUserId string ~ 1024文字 ユーザGRN
logSetting LogSetting ログの出力設定

Result

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

getNamespaceStatus

getNamespaceStatus

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

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

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

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

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

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

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

client = gs2('distributor')

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

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

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

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

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

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

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

client = gs2('distributor')

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/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &distributor.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        AssumeUserId: pointy.String("grn:gs2::YourOwnerId:identifier:user:user-0001"),
        LogSetting: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\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")
            ->withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            ->withLogSetting(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.UpdateNamespaceRequest;
import io.gs2.distributor.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            .withLogSetting(null)
    );
    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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.UpdateNamespaceRequest;
using Gs2.Gs2Distributor.Result.UpdateNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateNamespace(
    new UpdateNamespaceRequest()
        .withNamespaceName("namespace1")
        .withDescription("description1")
        .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
        .withLogSetting(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.updateNamespace(
        new Gs2Distributor.UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            .withLogSetting(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.update_namespace(
        distributor.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_assume_user_id('grn:gs2::YourOwnerId:identifier:user:user-0001')
            .with_log_setting(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.update_namespace({
    namespaceName='namespace1',
    description='description1',
    assumeUserId='grn:gs2::YourOwnerId:identifier:user:user-0001',
    logSetting=nil,
});

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

result = api_result.result
item = result.item;

ネームスペースを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
assumeUserId string ~ 1024文字 ユーザGRN
logSetting LogSetting ログの出力設定

Result

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

deleteNamespace

deleteNamespace

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

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

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

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

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

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

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

client = gs2('distributor')

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

describeDistributorModelMasters

describeDistributorModelMasters

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.DescribeDistributorModelMasters(
    &distributor.DescribeDistributorModelMastersRequest {
        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\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\DescribeDistributorModelMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeDistributorModelMasters(
        (new DescribeDistributorModelMastersRequest())
            ->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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.DescribeDistributorModelMastersRequest;
import io.gs2.distributor.result.DescribeDistributorModelMastersResult;

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

try {
    DescribeDistributorModelMastersResult result = client.describeDistributorModelMasters(
        new DescribeDistributorModelMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<DistributorModelMaster> 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.DescribeDistributorModelMastersRequest;
using Gs2.Gs2Distributor.Result.DescribeDistributorModelMastersResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeDistributorModelMasters(
    new DescribeDistributorModelMastersRequest()
        .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 Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.describeDistributorModelMasters(
        new Gs2Distributor.DescribeDistributorModelMastersRequest()
            .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 distributor

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

try:
    result = client.describe_distributor_model_masters(
        distributor.DescribeDistributorModelMastersRequest()
            .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('distributor')

api_result = client.describe_distributor_model_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 DistributorModelMaster[] 配信設定マスターのリスト
nextPageToken string リストの続きを取得するためのページトークン

createDistributorModelMaster

createDistributorModelMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.CreateDistributorModelMaster(
    &distributor.CreateDistributorModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("distributor-model-0001"),
        Description: nil,
        Metadata: nil,
        InboxNamespaceId: nil,
        WhiteListTargetIds: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\CreateDistributorModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createDistributorModelMaster(
        (new CreateDistributorModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("distributor-model-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withInboxNamespaceId(null)
            ->withWhiteListTargetIds(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.CreateDistributorModelMasterRequest;
import io.gs2.distributor.result.CreateDistributorModelMasterResult;

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

try {
    CreateDistributorModelMasterResult result = client.createDistributorModelMaster(
        new CreateDistributorModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("distributor-model-0001")
            .withDescription(null)
            .withMetadata(null)
            .withInboxNamespaceId(null)
            .withWhiteListTargetIds(null)
    );
    DistributorModelMaster 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.CreateDistributorModelMasterRequest;
using Gs2.Gs2Distributor.Result.CreateDistributorModelMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createDistributorModelMaster(
    new CreateDistributorModelMasterRequest()
        .withNamespaceName("namespace1")
        .withName("distributor-model-0001")
        .withDescription(null)
        .withMetadata(null)
        .withInboxNamespaceId(null)
        .withWhiteListTargetIds(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.createDistributorModelMaster(
        new Gs2Distributor.CreateDistributorModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("distributor-model-0001")
            .withDescription(null)
            .withMetadata(null)
            .withInboxNamespaceId(null)
            .withWhiteListTargetIds(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.create_distributor_model_master(
        distributor.CreateDistributorModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('distributor-model-0001')
            .with_description(None)
            .with_metadata(None)
            .with_inbox_namespace_id(None)
            .with_white_list_target_ids(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.create_distributor_model_master({
    namespaceName='namespace1',
    name='distributor-model-0001',
    description=nil,
    metadata=nil,
    inboxNamespaceId=nil,
    whiteListTargetIds=nil,
});

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

result = api_result.result
item = result.item;

配信設定マスターを新規作成

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
name string ~ 128文字 配信設定名
description string ~ 1024文字 説明文
metadata string ~ 2048文字 メタデータ
inboxNamespaceId string ~ 1024文字 ネームスペースGRN
whiteListTargetIds string[] [] ディストリビューターを通して処理出来る対象のリソースGRNのホワイトリスト

Result

説明
item DistributorModelMaster 作成した配信設定マスター

getDistributorModelMaster

getDistributorModelMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.GetDistributorModelMaster(
    &distributor.GetDistributorModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        DistributorName: pointy.String("distributor-model-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\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\GetDistributorModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getDistributorModelMaster(
        (new GetDistributorModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withDistributorName("distributor-model-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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.GetDistributorModelMasterRequest;
import io.gs2.distributor.result.GetDistributorModelMasterResult;

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

try {
    GetDistributorModelMasterResult result = client.getDistributorModelMaster(
        new GetDistributorModelMasterRequest()
            .withNamespaceName("namespace1")
            .withDistributorName("distributor-model-0001")
    );
    DistributorModelMaster 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.GetDistributorModelMasterRequest;
using Gs2.Gs2Distributor.Result.GetDistributorModelMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getDistributorModelMaster(
    new GetDistributorModelMasterRequest()
        .withNamespaceName("namespace1")
        .withDistributorName("distributor-model-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 Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.getDistributorModelMaster(
        new Gs2Distributor.GetDistributorModelMasterRequest()
            .withNamespaceName("namespace1")
            .withDistributorName("distributor-model-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.get_distributor_model_master(
        distributor.GetDistributorModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_distributor_name('distributor-model-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.get_distributor_model_master({
    namespaceName='namespace1',
    distributorName='distributor-model-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文字 ネームスペース名
distributorName string ~ 128文字 配信設定名

Result

説明
item DistributorModelMaster 配信設定マスター

updateDistributorModelMaster

updateDistributorModelMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.UpdateDistributorModelMaster(
    &distributor.UpdateDistributorModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        DistributorName: pointy.String("distributor-model-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("{\"hoge\": \"fuga\"}"),
        InboxNamespaceId: pointy.String("inbox-0001"),
        WhiteListTargetIds: []string{
            "grn:AAA",
        "grn:BBB",
        },
    }
)
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\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\UpdateDistributorModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateDistributorModelMaster(
        (new UpdateDistributorModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withDistributorName("distributor-model-0001")
            ->withDescription("description1")
            ->withMetadata("{\"hoge\": \"fuga\"}")
            ->withInboxNamespaceId("inbox-0001")
            ->withWhiteListTargetIds([    "grn:AAA",
            "grn:BBB",
            ])
    );
    $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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.UpdateDistributorModelMasterRequest;
import io.gs2.distributor.result.UpdateDistributorModelMasterResult;

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

try {
    UpdateDistributorModelMasterResult result = client.updateDistributorModelMaster(
        new UpdateDistributorModelMasterRequest()
            .withNamespaceName("namespace1")
            .withDistributorName("distributor-model-0001")
            .withDescription("description1")
            .withMetadata("{\"hoge\": \"fuga\"}")
            .withInboxNamespaceId("inbox-0001")
            .withWhiteListTargetIds(Arrays.asList(
                "grn:AAA",
            "grn:BBB"
            ))
    );
    DistributorModelMaster 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.UpdateDistributorModelMasterRequest;
using Gs2.Gs2Distributor.Result.UpdateDistributorModelMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateDistributorModelMaster(
    new UpdateDistributorModelMasterRequest()
        .withNamespaceName("namespace1")
        .withDistributorName("distributor-model-0001")
        .withDescription("description1")
        .withMetadata("{\"hoge\": \"fuga\"}")
        .withInboxNamespaceId("inbox-0001")
        .withWhiteListTargetIds(new string[] {
            "grn:AAA",
        "grn:BBB"
        }),
    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 Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.updateDistributorModelMaster(
        new Gs2Distributor.UpdateDistributorModelMasterRequest()
            .withNamespaceName("namespace1")
            .withDistributorName("distributor-model-0001")
            .withDescription("description1")
            .withMetadata("{\"hoge\": \"fuga\"}")
            .withInboxNamespaceId("inbox-0001")
            .withWhiteListTargetIds([
                "grn:AAA",
            "grn:BBB"
            ])
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.update_distributor_model_master(
        distributor.UpdateDistributorModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_distributor_name('distributor-model-0001')
            .with_description('description1')
            .with_metadata('{"hoge": "fuga"}')
            .with_inbox_namespace_id('inbox-0001')
            .with_white_list_target_ids([    'grn:AAA',
            'grn:BBB',
            ])
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.update_distributor_model_master({
    namespaceName='namespace1',
    distributorName='distributor-model-0001',
    description='description1',
    metadata='{"hoge": "fuga"}',
    inboxNamespaceId='inbox-0001',
    whiteListTargetIds={
        'grn:AAA',
    'grn:BBB'
    },
});

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

result = api_result.result
item = result.item;

配信設定マスターを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
distributorName string ~ 128文字 配信設定名
description string ~ 1024文字 説明文
metadata string ~ 2048文字 メタデータ
inboxNamespaceId string ~ 1024文字 ネームスペースGRN
whiteListTargetIds string[] [] ディストリビューターを通して処理出来る対象のリソースGRNのホワイトリスト

Result

説明
item DistributorModelMaster 更新した配信設定マスター

deleteDistributorModelMaster

deleteDistributorModelMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.DeleteDistributorModelMaster(
    &distributor.DeleteDistributorModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        DistributorName: pointy.String("distributor-model-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\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\DeleteDistributorModelMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteDistributorModelMaster(
        (new DeleteDistributorModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withDistributorName("distributor-model-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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.DeleteDistributorModelMasterRequest;
import io.gs2.distributor.result.DeleteDistributorModelMasterResult;

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

try {
    DeleteDistributorModelMasterResult result = client.deleteDistributorModelMaster(
        new DeleteDistributorModelMasterRequest()
            .withNamespaceName("namespace1")
            .withDistributorName("distributor-model-0001")
    );
    DistributorModelMaster 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.DeleteDistributorModelMasterRequest;
using Gs2.Gs2Distributor.Result.DeleteDistributorModelMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteDistributorModelMaster(
    new DeleteDistributorModelMasterRequest()
        .withNamespaceName("namespace1")
        .withDistributorName("distributor-model-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 Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.deleteDistributorModelMaster(
        new Gs2Distributor.DeleteDistributorModelMasterRequest()
            .withNamespaceName("namespace1")
            .withDistributorName("distributor-model-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.delete_distributor_model_master(
        distributor.DeleteDistributorModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_distributor_name('distributor-model-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.delete_distributor_model_master({
    namespaceName='namespace1',
    distributorName='distributor-model-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文字 ネームスペース名
distributorName string ~ 128文字 配信設定名

Result

説明
item DistributorModelMaster 削除した配信設定マスター

describeDistributorModels

describeDistributorModels

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeDistributorModels(
        (new DescribeDistributorModelsRequest())
            ->withNamespaceName(self::namespace1)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.DescribeDistributorModelsRequest;
import io.gs2.distributor.result.DescribeDistributorModelsResult;

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

try {
    DescribeDistributorModelsResult result = client.describeDistributorModels(
        new DescribeDistributorModelsRequest()
            .withNamespaceName("namespace1")
    );
    List<DistributorModel> 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.DescribeDistributorModelsRequest;
using Gs2.Gs2Distributor.Result.DescribeDistributorModelsResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeDistributorModels(
    new DescribeDistributorModelsRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.describeDistributorModels(
        new Gs2Distributor.DescribeDistributorModelsRequest()
            .withNamespaceName("namespace1")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.describe_distributor_models(
        distributor.DescribeDistributorModelsRequest()
            .with_namespace_name(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

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

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

result = api_result.result
items = result.items;

配信設定の一覧を取得

Request

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

Result

説明
items DistributorModel[] 配信設定のリスト

getDistributorModel

getDistributorModel

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.GetDistributorModel(
    &distributor.GetDistributorModelRequest {
        NamespaceName: pointy.String("namespace1"),
        DistributorName: pointy.String("distributor-model-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\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\GetDistributorModelRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getDistributorModel(
        (new GetDistributorModelRequest())
            ->withNamespaceName(self::namespace1)
            ->withDistributorName("distributor-model-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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.GetDistributorModelRequest;
import io.gs2.distributor.result.GetDistributorModelResult;

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

try {
    GetDistributorModelResult result = client.getDistributorModel(
        new GetDistributorModelRequest()
            .withNamespaceName("namespace1")
            .withDistributorName("distributor-model-0001")
    );
    DistributorModel 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.GetDistributorModelRequest;
using Gs2.Gs2Distributor.Result.GetDistributorModelResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getDistributorModel(
    new GetDistributorModelRequest()
        .withNamespaceName("namespace1")
        .withDistributorName("distributor-model-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 Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.getDistributorModel(
        new Gs2Distributor.GetDistributorModelRequest()
            .withNamespaceName("namespace1")
            .withDistributorName("distributor-model-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.get_distributor_model(
        distributor.GetDistributorModelRequest()
            .with_namespace_name(self.hash1)
            .with_distributor_name('distributor-model-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.get_distributor_model({
    namespaceName='namespace1',
    distributorName='distributor-model-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文字 ネームスペース名
distributorName string ~ 128文字 配信設定名

Result

説明
item DistributorModel 配信設定

exportMaster

exportMaster

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

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

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

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

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

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

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

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

client = gs2('distributor')

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 CurrentDistributorMaster 現在有効な配信設定

getCurrentDistributorMaster

getCurrentDistributorMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.GetCurrentDistributorMaster(
    &distributor.GetCurrentDistributorMasterRequest {
        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\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\GetCurrentDistributorMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCurrentDistributorMaster(
        (new GetCurrentDistributorMasterRequest())
            ->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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.GetCurrentDistributorMasterRequest;
import io.gs2.distributor.result.GetCurrentDistributorMasterResult;

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

try {
    GetCurrentDistributorMasterResult result = client.getCurrentDistributorMaster(
        new GetCurrentDistributorMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentDistributorMaster 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.GetCurrentDistributorMasterRequest;
using Gs2.Gs2Distributor.Result.GetCurrentDistributorMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getCurrentDistributorMaster(
    new GetCurrentDistributorMasterRequest()
        .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 Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.getCurrentDistributorMaster(
        new Gs2Distributor.GetCurrentDistributorMasterRequest()
            .withNamespaceName("namespace1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.get_current_distributor_master(
        distributor.GetCurrentDistributorMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.get_current_distributor_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 CurrentDistributorMaster 現在有効な配信設定

updateCurrentDistributorMaster

updateCurrentDistributorMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentDistributorMaster(
    &distributor.UpdateCurrentDistributorMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Settings: pointy.String("{\n  \"version\": \"2019-03-01\",\n  \"distributorModels\": [\n    {\n      \"name\": \"basic\",\n      \"metadata\": \"BASIC\",\n      \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\"\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\",\n      \"whiteListTargetIds\": [\n        \"test\"\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\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\UpdateCurrentDistributorMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentDistributorMaster(
        (new UpdateCurrentDistributorMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSettings("{\n  \"version\": \"2019-03-01\",\n  \"distributorModels\": [\n    {\n      \"name\": \"basic\",\n      \"metadata\": \"BASIC\",\n      \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\"\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\",\n      \"whiteListTargetIds\": [\n        \"test\"\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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.UpdateCurrentDistributorMasterRequest;
import io.gs2.distributor.result.UpdateCurrentDistributorMasterResult;

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

try {
    UpdateCurrentDistributorMasterResult result = client.updateCurrentDistributorMaster(
        new UpdateCurrentDistributorMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n  \"version\": \"2019-03-01\",\n  \"distributorModels\": [\n    {\n      \"name\": \"basic\",\n      \"metadata\": \"BASIC\",\n      \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\"\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\",\n      \"whiteListTargetIds\": [\n        \"test\"\n      ]\n    }\n  ]\n}")
    );
    CurrentDistributorMaster 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.UpdateCurrentDistributorMasterRequest;
using Gs2.Gs2Distributor.Result.UpdateCurrentDistributorMasterResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCurrentDistributorMaster(
    new UpdateCurrentDistributorMasterRequest()
        .withNamespaceName("namespace1")
        .withSettings("{\n  \"version\": \"2019-03-01\",\n  \"distributorModels\": [\n    {\n      \"name\": \"basic\",\n      \"metadata\": \"BASIC\",\n      \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\"\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\",\n      \"whiteListTargetIds\": [\n        \"test\"\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 Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.updateCurrentDistributorMaster(
        new Gs2Distributor.UpdateCurrentDistributorMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n  \"version\": \"2019-03-01\",\n  \"distributorModels\": [\n    {\n      \"name\": \"basic\",\n      \"metadata\": \"BASIC\",\n      \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\"\n    },\n    {\n      \"name\": \"special\",\n      \"metadata\": \"SPECIAL\",\n      \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\",\n      \"whiteListTargetIds\": [\n        \"test\"\n      ]\n    }\n  ]\n}")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.update_current_distributor_master(
        distributor.UpdateCurrentDistributorMasterRequest()
            .with_namespace_name(self.hash1)
            .with_settings('{\n  "version": "2019-03-01",\n  "distributorModels": [\n    {\n      "name": "basic",\n      "metadata": "BASIC",\n      "inboxNamespaceId": "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001"\n    },\n    {\n      "name": "special",\n      "metadata": "SPECIAL",\n      "inboxNamespaceId": "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001",\n      "whiteListTargetIds": [\n        "test"\n      ]\n    }\n  ]\n}')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.update_current_distributor_master({
    namespaceName='namespace1',
    settings='{\n  "version": "2019-03-01",\n  "distributorModels": [\n    {\n      "name": "basic",\n      "metadata": "BASIC",\n      "inboxNamespaceId": "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001"\n    },\n    {\n      "name": "special",\n      "metadata": "SPECIAL",\n      "inboxNamespaceId": "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001",\n      "whiteListTargetIds": [\n        "test"\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 CurrentDistributorMaster 更新した現在有効な配信設定

updateCurrentDistributorMasterFromGitHub

updateCurrentDistributorMasterFromGitHub

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentDistributorMasterFromGitHub(
    &distributor.UpdateCurrentDistributorMasterFromGitHubRequest {
        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\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\UpdateCurrentDistributorMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentDistributorMasterFromGitHub(
        (new UpdateCurrentDistributorMasterFromGitHubRequest())
            ->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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.UpdateCurrentDistributorMasterFromGitHubRequest;
import io.gs2.distributor.result.UpdateCurrentDistributorMasterFromGitHubResult;

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

try {
    UpdateCurrentDistributorMasterFromGitHubResult result = client.updateCurrentDistributorMasterFromGitHub(
        new UpdateCurrentDistributorMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    CurrentDistributorMaster 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.UpdateCurrentDistributorMasterFromGitHubRequest;
using Gs2.Gs2Distributor.Result.UpdateCurrentDistributorMasterFromGitHubResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCurrentDistributorMasterFromGitHub(
    new UpdateCurrentDistributorMasterFromGitHubRequest()
        .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 Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.updateCurrentDistributorMasterFromGitHub(
        new Gs2Distributor.UpdateCurrentDistributorMasterFromGitHubRequest()
            .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 distributor

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

try:
    result = client.update_current_distributor_master_from_git_hub(
        distributor.UpdateCurrentDistributorMasterFromGitHubRequest()
            .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('distributor')

api_result = client.update_current_distributor_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 CurrentDistributorMaster 更新した現在有効な配信設定

distribute

distribute

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.Distribute(
    &distributor.DistributeRequest {
        NamespaceName: pointy.String("namespace1"),
        DistributorName: pointy.String("distributor-0001"),
        UserId: pointy.String("user-0001"),
        DistributeResource: {'action': 'Gs2Money:DepositWallet', 'request': '{}'},
    }
)
if err != nil {
    panic("error occurred")
}
distributeResource := result.DistributeResource
inboxNamespaceId := result.InboxNamespaceId
result := result.Result
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\DistributeRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->distribute(
        (new DistributeRequest())
            ->withNamespaceName(self::namespace1)
            ->withDistributorName("distributor-0001")
            ->withUserId("user-0001")
            ->withDistributeResource({'action': 'Gs2Money:DepositWallet', 'request': '{}'})
    );
    $distributeResource = $result->getDistributeResource();
    $inboxNamespaceId = $result->getInboxNamespaceId();
    $result = $result->getResult();
} 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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.DistributeRequest;
import io.gs2.distributor.result.DistributeResult;

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

try {
    DistributeResult result = client.distribute(
        new DistributeRequest()
            .withNamespaceName("namespace1")
            .withDistributorName("distributor-0001")
            .withUserId("user-0001")
            .withDistributeResource({'action': 'Gs2Money:DepositWallet', 'request': '{}'})
    );
    DistributeResource distributeResource = result.getDistributeResource();
    String inboxNamespaceId = result.getInboxNamespaceId();
    String result = result.getResult();
} 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.DistributeRequest;
using Gs2.Gs2Distributor.Result.DistributeResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.distribute(
    new DistributeRequest()
        .withNamespaceName("namespace1")
        .withDistributorName("distributor-0001")
        .withUserId("user-0001")
        .withDistributeResource({'action': 'Gs2Money:DepositWallet', 'request': '{}'}),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var distributeResource = result.DistributeResource;
var inboxNamespaceId = result.InboxNamespaceId;
var result = result.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.distribute(
        new Gs2Distributor.DistributeRequest()
            .withNamespaceName("namespace1")
            .withDistributorName("distributor-0001")
            .withUserId("user-0001")
            .withDistributeResource({'action': 'Gs2Money:DepositWallet', 'request': '{}'})
    );
    const distributeResource = result.getDistributeResource();
    const inboxNamespaceId = result.getInboxNamespaceId();
    const result = result.getResult();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.distribute(
        distributor.DistributeRequest()
            .with_namespace_name(self.hash1)
            .with_distributor_name('distributor-0001')
            .with_user_id('user-0001')
            .with_distribute_resource({'action': 'Gs2Money:DepositWallet', 'request': '{}'})
    )
    distribute_resource = result.distribute_resource
    inbox_namespace_id = result.inbox_namespace_id
    result = result.result
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.distribute({
    namespaceName='namespace1',
    distributorName='distributor-0001',
    userId='user-0001',
    distributeResource={'action': 'Gs2Money:DepositWallet', 'request': '{}'},
});

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

result = api_result.result
distributeResource = result.distributeResource;
inboxNamespaceId = result.inboxNamespaceId;
result = result.result;

所持品を配布する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
distributorName string ~ 128文字 配信設定名
userId string ~ 128文字 ユーザーID
distributeResource DistributeResource 加算するリソース

Result

説明
distributeResource DistributeResource 処理した DistributeResource
inboxNamespaceId string 所持品がキャパシティをオーバーしたときに転送するプレゼントボックスのネームスペース のGRN
result string レスポンス内容

distributeWithoutOverflowProcess

distributeWithoutOverflowProcess

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.DistributeWithoutOverflowProcess(
    &distributor.DistributeWithoutOverflowProcessRequest {
        UserId: pointy.String("user-0001"),
        DistributeResource: {'action': 'Gs2Money:DepositWallet', 'request': '{}'},
    }
)
if err != nil {
    panic("error occurred")
}
distributeResource := result.DistributeResource
result := result.Result
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\DistributeWithoutOverflowProcessRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->distributeWithoutOverflowProcess(
        (new DistributeWithoutOverflowProcessRequest())
            ->withUserId("user-0001")
            ->withDistributeResource({'action': 'Gs2Money:DepositWallet', 'request': '{}'})
    );
    $distributeResource = $result->getDistributeResource();
    $result = $result->getResult();
} 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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.DistributeWithoutOverflowProcessRequest;
import io.gs2.distributor.result.DistributeWithoutOverflowProcessResult;

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

try {
    DistributeWithoutOverflowProcessResult result = client.distributeWithoutOverflowProcess(
        new DistributeWithoutOverflowProcessRequest()
            .withUserId("user-0001")
            .withDistributeResource({'action': 'Gs2Money:DepositWallet', 'request': '{}'})
    );
    DistributeResource distributeResource = result.getDistributeResource();
    String result = result.getResult();
} 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.DistributeWithoutOverflowProcessRequest;
using Gs2.Gs2Distributor.Result.DistributeWithoutOverflowProcessResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.distributeWithoutOverflowProcess(
    new DistributeWithoutOverflowProcessRequest()
        .withUserId("user-0001")
        .withDistributeResource({'action': 'Gs2Money:DepositWallet', 'request': '{}'}),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var distributeResource = result.DistributeResource;
var result = result.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.distributeWithoutOverflowProcess(
        new Gs2Distributor.DistributeWithoutOverflowProcessRequest()
            .withUserId("user-0001")
            .withDistributeResource({'action': 'Gs2Money:DepositWallet', 'request': '{}'})
    );
    const distributeResource = result.getDistributeResource();
    const result = result.getResult();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.distribute_without_overflow_process(
        distributor.DistributeWithoutOverflowProcessRequest()
            .with_user_id('user-0001')
            .with_distribute_resource({'action': 'Gs2Money:DepositWallet', 'request': '{}'})
    )
    distribute_resource = result.distribute_resource
    result = result.result
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.distribute_without_overflow_process({
    userId='user-0001',
    distributeResource={'action': 'Gs2Money:DepositWallet', 'request': '{}'},
});

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

result = api_result.result
distributeResource = result.distributeResource;
result = result.result;

所持品を配布する(溢れた際の救済処置無し)

Request

必須 デフォルト 値の制限 説明
userId string ~ 128文字 ユーザーID
distributeResource DistributeResource 加算するリソース

Result

説明
distributeResource DistributeResource 処理した DistributeResource
result string レスポンス内容

runStampTask

runStampTask

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.RunStampTask(
    &distributor.RunStampTaskRequest {
        NamespaceName: pointy.String("namespace1"),
        StampTask: pointy.String("$stampTask"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
contextStack := result.ContextStack
result := result.Result
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\RunStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->runStampTask(
        (new RunStampTaskRequest())
            ->withNamespaceName(self::namespace1)
            ->withStampTask(self::$stampTask)
            ->withKeyId(self::$key1.keyId)
    );
    $contextStack = $result->getContextStack();
    $result = $result->getResult();
} 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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.RunStampTaskRequest;
import io.gs2.distributor.result.RunStampTaskResult;

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

try {
    RunStampTaskResult result = client.runStampTask(
        new RunStampTaskRequest()
            .withNamespaceName("namespace1")
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    String contextStack = result.getContextStack();
    String result = result.getResult();
} 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.RunStampTaskRequest;
using Gs2.Gs2Distributor.Result.RunStampTaskResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.runStampTask(
    new RunStampTaskRequest()
        .withNamespaceName("namespace1")
        .withStampTask("$stampTask")
        .withKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var contextStack = result.ContextStack;
var result = result.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.runStampTask(
        new Gs2Distributor.RunStampTaskRequest()
            .withNamespaceName("namespace1")
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    const contextStack = result.getContextStack();
    const result = result.getResult();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.run_stamp_task(
        distributor.RunStampTaskRequest()
            .with_namespace_name(self.hash1)
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    context_stack = result.context_stack
    result = result.result
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.run_stamp_task({
    namespaceName='namespace1',
    stampTask='$stampTask',
    keyId='$key1.keyId',
});

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

result = api_result.result
contextStack = result.contextStack;
result = result.result;

スタンプシートのタスクを実行する

Request

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

Result

説明
contextStack string タスクの実行結果を反映したコンテキストスタック
result string レスポンス内容

runStampSheet

runStampSheet

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.RunStampSheet(
    &distributor.RunStampSheetRequest {
        NamespaceName: pointy.String("namespace1"),
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
result := result.Result
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\RunStampSheetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->runStampSheet(
        (new RunStampSheetRequest())
            ->withNamespaceName(self::namespace1)
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $result = $result->getResult();
} 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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.RunStampSheetRequest;
import io.gs2.distributor.result.RunStampSheetResult;

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

try {
    RunStampSheetResult result = client.runStampSheet(
        new RunStampSheetRequest()
            .withNamespaceName("namespace1")
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    String result = result.getResult();
} 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.RunStampSheetRequest;
using Gs2.Gs2Distributor.Result.RunStampSheetResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.runStampSheet(
    new RunStampSheetRequest()
        .withNamespaceName("namespace1")
        .withStampSheet("$stampSheet")
        .withKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var result = result.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.runStampSheet(
        new Gs2Distributor.RunStampSheetRequest()
            .withNamespaceName("namespace1")
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    const result = result.getResult();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.run_stamp_sheet(
        distributor.RunStampSheetRequest()
            .with_namespace_name(self.hash1)
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    result = result.result
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.run_stamp_sheet({
    namespaceName='namespace1',
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
});

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

result = api_result.result
result = result.result;

スタンプシートの完了を報告する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
stampSheet string ~ 5242880文字 スタンプシート
keyId string ~ 1024文字 暗号鍵GRN

Result

説明
result string レスポンス内容

runStampSheetExpress

runStampSheetExpress

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.RunStampSheetExpress(
    &distributor.RunStampSheetExpressRequest {
        NamespaceName: pointy.String("namespace1"),
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
taskResults := result.TaskResults
sheetResult := result.SheetResult
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\RunStampSheetExpressRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->runStampSheetExpress(
        (new RunStampSheetExpressRequest())
            ->withNamespaceName(self::namespace1)
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $taskResults = $result->getTaskResults();
    $sheetResult = $result->getSheetResult();
} 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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.RunStampSheetExpressRequest;
import io.gs2.distributor.result.RunStampSheetExpressResult;

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

try {
    RunStampSheetExpressResult result = client.runStampSheetExpress(
        new RunStampSheetExpressRequest()
            .withNamespaceName("namespace1")
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    List<String> taskResults = result.getTaskResults();
    String sheetResult = result.getSheetResult();
} 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.RunStampSheetExpressRequest;
using Gs2.Gs2Distributor.Result.RunStampSheetExpressResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.runStampSheetExpress(
    new RunStampSheetExpressRequest()
        .withNamespaceName("namespace1")
        .withStampSheet("$stampSheet")
        .withKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var taskResults = result.TaskResults;
var sheetResult = result.SheetResult;
import Gs2Core from '@/gs2/core';
import * as Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.runStampSheetExpress(
        new Gs2Distributor.RunStampSheetExpressRequest()
            .withNamespaceName("namespace1")
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    const taskResults = result.getTaskResults();
    const sheetResult = result.getSheetResult();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.run_stamp_sheet_express(
        distributor.RunStampSheetExpressRequest()
            .with_namespace_name(self.hash1)
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    task_results = result.task_results
    sheet_result = result.sheet_result
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.run_stamp_sheet_express({
    namespaceName='namespace1',
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
});

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

result = api_result.result
taskResults = result.taskResults;
sheetResult = result.sheetResult;

スタンプタスクおよびスタンプシートを実行する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
stampSheet string ~ 5242880文字 スタンプシート
keyId string ~ 1024文字 暗号鍵GRN

Result

説明
taskResults string[] スタンプタスクの実行結果
sheetResult string スタンプシートの実行結果レスポンス内容

runStampTaskWithoutNamespace

runStampTaskWithoutNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.RunStampTaskWithoutNamespace(
    &distributor.RunStampTaskWithoutNamespaceRequest {
        StampTask: pointy.String("$stampTask"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
contextStack := result.ContextStack
result := result.Result
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\RunStampTaskWithoutNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->runStampTaskWithoutNamespace(
        (new RunStampTaskWithoutNamespaceRequest())
            ->withStampTask(self::$stampTask)
            ->withKeyId(self::$key1.keyId)
    );
    $contextStack = $result->getContextStack();
    $result = $result->getResult();
} 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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.RunStampTaskWithoutNamespaceRequest;
import io.gs2.distributor.result.RunStampTaskWithoutNamespaceResult;

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

try {
    RunStampTaskWithoutNamespaceResult result = client.runStampTaskWithoutNamespace(
        new RunStampTaskWithoutNamespaceRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    String contextStack = result.getContextStack();
    String result = result.getResult();
} 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.RunStampTaskWithoutNamespaceRequest;
using Gs2.Gs2Distributor.Result.RunStampTaskWithoutNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.runStampTaskWithoutNamespace(
    new RunStampTaskWithoutNamespaceRequest()
        .withStampTask("$stampTask")
        .withKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var contextStack = result.ContextStack;
var result = result.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.runStampTaskWithoutNamespace(
        new Gs2Distributor.RunStampTaskWithoutNamespaceRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    const contextStack = result.getContextStack();
    const result = result.getResult();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.run_stamp_task_without_namespace(
        distributor.RunStampTaskWithoutNamespaceRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    context_stack = result.context_stack
    result = result.result
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

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

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

result = api_result.result
contextStack = result.contextStack;
result = result.result;

スタンプシートのタスクを実行する

ネームスペースの指定を省略することで、 ログが記録できない・リソース溢れ処理が実行されないなどの副作用があります。

Request

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

Result

説明
contextStack string タスクの実行結果を反映したコンテキストスタック
result string レスポンス内容

runStampSheetWithoutNamespace

runStampSheetWithoutNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.RunStampSheetWithoutNamespace(
    &distributor.RunStampSheetWithoutNamespaceRequest {
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
result := result.Result
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\RunStampSheetWithoutNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->runStampSheetWithoutNamespace(
        (new RunStampSheetWithoutNamespaceRequest())
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $result = $result->getResult();
} 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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.RunStampSheetWithoutNamespaceRequest;
import io.gs2.distributor.result.RunStampSheetWithoutNamespaceResult;

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

try {
    RunStampSheetWithoutNamespaceResult result = client.runStampSheetWithoutNamespace(
        new RunStampSheetWithoutNamespaceRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    String result = result.getResult();
} 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.RunStampSheetWithoutNamespaceRequest;
using Gs2.Gs2Distributor.Result.RunStampSheetWithoutNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.runStampSheetWithoutNamespace(
    new RunStampSheetWithoutNamespaceRequest()
        .withStampSheet("$stampSheet")
        .withKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var result = result.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.runStampSheetWithoutNamespace(
        new Gs2Distributor.RunStampSheetWithoutNamespaceRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    const result = result.getResult();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.run_stamp_sheet_without_namespace(
        distributor.RunStampSheetWithoutNamespaceRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    result = result.result
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.run_stamp_sheet_without_namespace({
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
});

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

result = api_result.result
result = result.result;

スタンプシートの完了を報告する

ネームスペースの指定を省略することで、 ログが記録できない・リソース溢れ処理が実行されないなどの副作用があります。

Request

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

Result

説明
result string レスポンス内容

runStampSheetExpressWithoutNamespace

runStampSheetExpressWithoutNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor.Gs2DistributorRestClient{
    Session: &session,
}
result, err := client.RunStampSheetExpressWithoutNamespace(
    &distributor.RunStampSheetExpressWithoutNamespaceRequest {
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
taskResults := result.TaskResults
sheetResult := result.SheetResult
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\RunStampSheetExpressWithoutNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->runStampSheetExpressWithoutNamespace(
        (new RunStampSheetExpressWithoutNamespaceRequest())
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $taskResults = $result->getTaskResults();
    $sheetResult = $result->getSheetResult();
} 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.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.RunStampSheetExpressWithoutNamespaceRequest;
import io.gs2.distributor.result.RunStampSheetExpressWithoutNamespaceResult;

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

try {
    RunStampSheetExpressWithoutNamespaceResult result = client.runStampSheetExpressWithoutNamespace(
        new RunStampSheetExpressWithoutNamespaceRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    List<String> taskResults = result.getTaskResults();
    String sheetResult = result.getSheetResult();
} 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.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.RunStampSheetExpressWithoutNamespaceRequest;
using Gs2.Gs2Distributor.Result.RunStampSheetExpressWithoutNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.runStampSheetExpressWithoutNamespace(
    new RunStampSheetExpressWithoutNamespaceRequest()
        .withStampSheet("$stampSheet")
        .withKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var taskResults = result.TaskResults;
var sheetResult = result.SheetResult;
import Gs2Core from '@/gs2/core';
import * as Gs2Distributor from '@/gs2/distributor';

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

try {
    const result = await client.runStampSheetExpressWithoutNamespace(
        new Gs2Distributor.RunStampSheetExpressWithoutNamespaceRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    const taskResults = result.getTaskResults();
    const sheetResult = result.getSheetResult();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import distributor

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

try:
    result = client.run_stamp_sheet_express_without_namespace(
        distributor.RunStampSheetExpressWithoutNamespaceRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    task_results = result.task_results
    sheet_result = result.sheet_result
except core.Gs2Exception as e:
    exit(1)

client = gs2('distributor')

api_result = client.run_stamp_sheet_express_without_namespace({
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
});

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

result = api_result.result
taskResults = result.taskResults;
sheetResult = result.sheetResult;

スタンプタスクおよびスタンプシートを実行する

Request

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

Result

説明
taskResults string[] スタンプタスクの実行結果
sheetResult string スタンプシートの実行結果レスポンス内容