API Reference of GS2-Distributor SDK

Model

Namespace

Namespace

Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.

Therefore, it is necessary to create a namespace before starting to use each service.

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsNamespace Grn
namestring~ 128 charsNamespace name
descriptionstring~ 1024 charsDescription
assumeUserIdstring~ 1024 charsUser GRN
autoRunStampSheetNotificationNotificationSettingPush notification when transaction auto-execution is complete
logSettingLogSettingLog output settings
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
updatedAtlongNowDatetime of last update (Unix time unit:milliseconds)
revisionlong0~ 9223372036854775805Revision

DistributorModelMaster

Delivery Setting Model Master

A delivery setting is an entity that sets the policy when an entity’s acquisition exceeds its possession quota. By processing acquisitions through GS2-Distributor, overflow resources can be forwarded as GS2-Inbox messages.

TypeConditionRequireDefaultLimitationDescription
distributorModelIdstring~ 1024 charsDelivery Setting Master GRN
namestring~ 128 charsdelivery setting name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
inboxNamespaceIdstring~ 1024 charsGS2-Inbox namespace GRN to transfer overflow resources
whiteListTargetIdsList<string>[]~ 100 itemsWhitelist of target resource GRNs that can be processed through the distributor
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
updatedAtlongNowDatetime of last update (Unix time unit:milliseconds)
revisionlong0~ 9223372036854775805Revision

DistributorModel

Delivery Setting Model

A delivery setting is an entity that sets the policy when an entity’s acquisition exceeds its possession quota. By processing acquisitions through GS2-Distributor, overflow resources can be forwarded as GS2-Inbox messages.

TypeConditionRequireDefaultLimitationDescription
distributorModelIdstring~ 1024 charsDelivery Setting GRN
namestring~ 128 charsDelivery setting name
metadatastring~ 2048 charsmetadata
inboxNamespaceIdstring~ 1024 charsGS2-Inbox namespace GRN to transfer overflow resources
whiteListTargetIdsList<string>[]~ 1000 itemsWhitelist of target resource GRNs that can be processed through the distributor

CurrentDistributorMaster

Currently available master data

GS2 uses JSON format files for master data management. By uploading the file, you can actually reflect the settings on the server.

We provide a master data editor on the management console as a way to create JSON files, but we also provide a master data editor on the management console as a way to create JSON files. The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsCurrently available delivery settings GRN
settingsstring~ 5242880 charsMaster data

StampSheetResult

Transaction execution results

Transaction execution results executed using server-side transaction auto-execution functionality

TypeConditionRequireDefaultLimitationDescription
stampSheetResultIdstring~ 1024 charsTransaction Result GRN
userIdstring~ 128 charsUser Id
transactionIdstring36 ~ 36 charsTransaction ID
verifyTaskRequestsList<VerifyAction>~ 10 itemsList of verify action request payload
taskRequestsList<ConsumeAction>~ 10 itemsList of consume action request payload
sheetRequestAcquireActionAcquire action request payload
verifyTaskResultCodesList<int>~ 10 itemsVerify action execution status code
verifyTaskResultsList<string>~ 10 itemsVerify action execution results
taskResultCodesList<int>~ 10 itemsConsume action execution status code
taskResultsList<string>~ 10 itemsConsume action execution results
sheetResultCodeint~ 999Acquire action execution status code
sheetResultstring~ 1048576 charsAcquire action execution results
nextTransactionIdstring36 ~ 36 charsTransaction ID of the newly issued transaction by executing the transaction
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
revisionlong0~ 9223372036854775805Revision

AcquireAction

Acquire Action

TypeConditionRequireDefaultLimitationDescription
actionenum {
"Gs2AdReward:AcquirePointByUserId",
"Gs2Dictionary:AddEntriesByUserId",
"Gs2Enchant:ReDrawBalanceParameterStatusByUserId",
"Gs2Enchant:SetBalanceParameterStatusByUserId",
"Gs2Enchant:ReDrawRarityParameterStatusByUserId",
"Gs2Enchant:AddRarityParameterStatusByUserId",
"Gs2Enchant:SetRarityParameterStatusByUserId",
"Gs2Enhance:DirectEnhanceByUserId",
"Gs2Enhance:UnleashByUserId",
"Gs2Enhance:CreateProgressByUserId",
"Gs2Exchange:ExchangeByUserId",
"Gs2Exchange:IncrementalExchangeByUserId",
"Gs2Exchange:CreateAwaitByUserId",
"Gs2Exchange:AcquireForceByUserId",
"Gs2Exchange:SkipByUserId",
"Gs2Experience:AddExperienceByUserId",
"Gs2Experience:SetExperienceByUserId",
"Gs2Experience:AddRankCapByUserId",
"Gs2Experience:SetRankCapByUserId",
"Gs2Experience:MultiplyAcquireActionsByUserId",
"Gs2Formation:AddMoldCapacityByUserId",
"Gs2Formation:SetMoldCapacityByUserId",
"Gs2Formation:AcquireActionsToFormProperties",
"Gs2Formation:SetFormByUserId",
"Gs2Formation:AcquireActionsToPropertyFormProperties",
"Gs2Friend:UpdateProfileByUserId",
"Gs2Grade:AddGradeByUserId",
"Gs2Grade:ApplyRankCapByUserId",
"Gs2Grade:MultiplyAcquireActionsByUserId",
"Gs2Guild:IncreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Guild:SetMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:IncreaseMaximumIdleMinutesByUserId",
"Gs2Idle:SetMaximumIdleMinutesByUserId",
"Gs2Idle:ReceiveByUserId",
"Gs2Inbox:SendMessageByUserId",
"Gs2Inventory:AddCapacityByUserId",
"Gs2Inventory:SetCapacityByUserId",
"Gs2Inventory:AcquireItemSetByUserId",
"Gs2Inventory:AcquireItemSetWithGradeByUserId",
"Gs2Inventory:AddReferenceOfByUserId",
"Gs2Inventory:DeleteReferenceOfByUserId",
"Gs2Inventory:AcquireSimpleItemsByUserId",
"Gs2Inventory:SetSimpleItemsByUserId",
"Gs2Inventory:AcquireBigItemByUserId",
"Gs2Inventory:SetBigItemByUserId",
"Gs2JobQueue:PushByUserId",
"Gs2Limit:CountDownByUserId",
"Gs2Limit:DeleteCounterByUserId",
"Gs2LoginReward:DeleteReceiveStatusByUserId",
"Gs2LoginReward:UnmarkReceivedByUserId",
"Gs2Lottery:DrawByUserId",
"Gs2Lottery:ResetBoxByUserId",
"Gs2Mission:RevertReceiveByUserId",
"Gs2Mission:IncreaseCounterByUserId",
"Gs2Mission:SetCounterByUserId",
"Gs2Money:DepositByUserId",
"Gs2Money:RevertRecordReceipt",
"Gs2Money2:DepositByUserId",
"Gs2Quest:CreateProgressByUserId",
"Gs2Schedule:TriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
~ 128 charsTypes of actions to be performed in the acquire action
requeststring~ 1048576 charsJSON of request

ConsumeAction

Consume Action

TypeConditionRequireDefaultLimitationDescription
actionenum {
"Gs2Matchmaking:VerifyIncludeParticipantByUserId",
"Gs2AdReward:ConsumePointByUserId",
"Gs2Dictionary:DeleteEntriesByUserId",
"Gs2Distributor:IfExpressionByUserId",
"Gs2Enhance:DeleteProgressByUserId",
"Gs2Exchange:DeleteAwaitByUserId",
"Gs2Experience:SubExperienceByUserId",
"Gs2Experience:SubRankCapByUserId",
"Gs2Formation:SubMoldCapacityByUserId",
"Gs2Grade:SubGradeByUserId",
"Gs2Guild:DecreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:DecreaseMaximumIdleMinutesByUserId",
"Gs2Inbox:OpenMessageByUserId",
"Gs2Inbox:DeleteMessageByUserId",
"Gs2Inventory:ConsumeItemSetByUserId",
"Gs2Inventory:ConsumeSimpleItemsByUserId",
"Gs2Inventory:ConsumeBigItemByUserId",
"Gs2JobQueue:DeleteJobByUserId",
"Gs2Limit:CountUpByUserId",
"Gs2LoginReward:MarkReceivedByUserId",
"Gs2Mission:ReceiveByUserId",
"Gs2Mission:BatchReceiveByUserId",
"Gs2Mission:DecreaseCounterByUserId",
"Gs2Money:WithdrawByUserId",
"Gs2Money:RecordReceipt",
"Gs2Money2:WithdrawByUserId",
"Gs2Money2:VerifyReceiptByUserId",
"Gs2Quest:DeleteProgressByUserId",
"Gs2Ranking2:CreateGlobalRankingReceivedRewardByUserId",
"Gs2Ranking2:CreateClusterRankingReceivedRewardByUserId",
"Gs2Schedule:DeleteTriggerByUserId",
"Gs2SerialKey:UseByUserId",
"Gs2Showcase:IncrementPurchaseCountByUserId",
"Gs2SkillTree:MarkRestrainByUserId",
"Gs2Stamina:DecreaseMaxValueByUserId",
"Gs2Stamina:ConsumeStaminaByUserId",
}
~ 128 charsTypes of actions to be performed in the consume action
requeststring~ 1048576 charsJSON of request

VerifyAction

Verify Action

TypeConditionRequireDefaultLimitationDescription
actionenum {
"Gs2Dictionary:VerifyEntryByUserId",
"Gs2Distributor:AndExpressionByUserId",
"Gs2Distributor:OrExpressionByUserId",
"Gs2Enchant:VerifyRarityParameterStatusByUserId",
"Gs2Experience:VerifyRankByUserId",
"Gs2Experience:VerifyRankCapByUserId",
"Gs2Grade:VerifyGradeByUserId",
"Gs2Grade:VerifyGradeUpMaterialByUserId",
"Gs2Guild:VerifyCurrentMaximumMemberCountByGuildName",
"Gs2Guild:VerifyIncludeMemberByUserId",
"Gs2Inventory:VerifyInventoryCurrentMaxCapacityByUserId",
"Gs2Inventory:VerifyItemSetByUserId",
"Gs2Inventory:VerifyReferenceOfByUserId",
"Gs2Inventory:VerifySimpleItemByUserId",
"Gs2Inventory:VerifyBigItemByUserId",
"Gs2Limit:VerifyCounterByUserId",
"Gs2Mission:VerifyCompleteByUserId",
"Gs2Mission:VerifyCounterValueByUserId",
"Gs2Ranking2:VerifyGlobalRankingScoreByUserId",
"Gs2Ranking2:VerifyClusterRankingScoreByUserId",
"Gs2Ranking2:VerifySubscribeRankingScoreByUserId",
"Gs2Schedule:VerifyTriggerByUserId",
"Gs2Schedule:VerifyEventByUserId",
"Gs2SerialKey:VerifyCodeByUserId",
}
~ 128 charsTypes of actions to be performed in the verify task
requeststring~ 1048576 charsJSON of request

Config

Configration

Set values to be applied to transaction variables

TypeConditionRequireDefaultLimitationDescription
keystring~ 64 charsName
valuestring~ 51200 charsValue

GitHubCheckoutSetting

Setup to check out master data from GitHub

TypeConditionRequireDefaultLimitationDescription
apiKeyIdstring~ 1024 charsGitHub API key GRN
repositoryNamestring~ 1024 charsRepository Name
sourcePathstring~ 1024 charsSource code file path
referenceTypeenum {
    “commit_hash”,
    “branch”,
    “tag”
}
~ 128 charsSource of code
commitHashstring{referenceType} == “commit_hash”~ 1024 charsCommit hash
branchNamestring{referenceType} == “branch”~ 1024 charsBranch Name
tagNamestring{referenceType} == “tag”~ 1024 charsTag Name

Enumeration type definition to specify as referenceType

Enumerator String DefinitionDescription
commit_hashCommit hash
branchBranch
tagTag

DistributeResource

Distribute Resource

TypeConditionRequireDefaultLimitationDescription
actionenum {
"Gs2AdReward:AcquirePointByUserId",
"Gs2Dictionary:AddEntriesByUserId",
"Gs2Enchant:ReDrawBalanceParameterStatusByUserId",
"Gs2Enchant:SetBalanceParameterStatusByUserId",
"Gs2Enchant:ReDrawRarityParameterStatusByUserId",
"Gs2Enchant:AddRarityParameterStatusByUserId",
"Gs2Enchant:SetRarityParameterStatusByUserId",
"Gs2Enhance:DirectEnhanceByUserId",
"Gs2Enhance:UnleashByUserId",
"Gs2Enhance:CreateProgressByUserId",
"Gs2Exchange:ExchangeByUserId",
"Gs2Exchange:IncrementalExchangeByUserId",
"Gs2Exchange:CreateAwaitByUserId",
"Gs2Exchange:AcquireForceByUserId",
"Gs2Exchange:SkipByUserId",
"Gs2Experience:AddExperienceByUserId",
"Gs2Experience:SetExperienceByUserId",
"Gs2Experience:AddRankCapByUserId",
"Gs2Experience:SetRankCapByUserId",
"Gs2Experience:MultiplyAcquireActionsByUserId",
"Gs2Formation:AddMoldCapacityByUserId",
"Gs2Formation:SetMoldCapacityByUserId",
"Gs2Formation:AcquireActionsToFormProperties",
"Gs2Formation:SetFormByUserId",
"Gs2Formation:AcquireActionsToPropertyFormProperties",
"Gs2Friend:UpdateProfileByUserId",
"Gs2Grade:AddGradeByUserId",
"Gs2Grade:ApplyRankCapByUserId",
"Gs2Grade:MultiplyAcquireActionsByUserId",
"Gs2Guild:IncreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Guild:SetMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:IncreaseMaximumIdleMinutesByUserId",
"Gs2Idle:SetMaximumIdleMinutesByUserId",
"Gs2Idle:ReceiveByUserId",
"Gs2Inbox:SendMessageByUserId",
"Gs2Inventory:AddCapacityByUserId",
"Gs2Inventory:SetCapacityByUserId",
"Gs2Inventory:AcquireItemSetByUserId",
"Gs2Inventory:AcquireItemSetWithGradeByUserId",
"Gs2Inventory:AddReferenceOfByUserId",
"Gs2Inventory:DeleteReferenceOfByUserId",
"Gs2Inventory:AcquireSimpleItemsByUserId",
"Gs2Inventory:SetSimpleItemsByUserId",
"Gs2Inventory:AcquireBigItemByUserId",
"Gs2Inventory:SetBigItemByUserId",
"Gs2JobQueue:PushByUserId",
"Gs2Limit:CountDownByUserId",
"Gs2Limit:DeleteCounterByUserId",
"Gs2LoginReward:DeleteReceiveStatusByUserId",
"Gs2LoginReward:UnmarkReceivedByUserId",
"Gs2Lottery:DrawByUserId",
"Gs2Lottery:ResetBoxByUserId",
"Gs2Mission:RevertReceiveByUserId",
"Gs2Mission:IncreaseCounterByUserId",
"Gs2Mission:SetCounterByUserId",
"Gs2Money:DepositByUserId",
"Gs2Money:RevertRecordReceipt",
"Gs2Money2:DepositByUserId",
"Gs2Quest:CreateProgressByUserId",
"Gs2Schedule:TriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
~ 128 charsTypes of actions to be performed in the acquire action
requeststring~ 1048576 charsJSON of request

LogSetting

Log setting

This type manages log output settings. This type holds the identifier of the log namespace used to output log data. The log namespace ID specifies the GS2-Log namespace to aggregate and store the log data. Through this setting, API request and response log data under this namespace will be output to the target GS2-Log. GS2-Log provides logs in real time, which can be used for system monitoring, analysis, debugging, etc.

TypeConditionRequireDefaultLimitationDescription
loggingNamespaceIdstring~ 1024 charsNamespace GRN

NotificationSetting

Push notification settings

This is a setting for sending push notifications when an event occurs in a GS2 microservice. The push notification here refers to the processing via the WebSocket interface provided by GS2-Gateway, and is different from the push notification of a smartphone. For example, when a matchmaking is completed or a friend request is received, the GS2-Gateway can send a push notification via the WebSocket interface, and the game client can detect the change of the state.

GS2-Gateway’s push notifications can be used to send additional processing to mobile push notifications when the destination device is offline. If you use mobile push notifications well, you may be able to realize a flow in which you can notify the player by using mobile push notifications even if you end the game during matchmaking and return to the game.

TypeConditionRequireDefaultLimitationDescription
gatewayNamespaceIdstring“grn:gs2:{region}:{ownerId}:gateway:default”~ 1024 charsGS2-Gateway namespace to use for push notifications
enableTransferMobileNotificationbool?falseForwarding to mobile push notification
soundstring{enableTransferMobileNotification} == true~ 1024 charsSound file name to be used for mobile push notifications

Methods

describeNamespaces

Get list of namespaces

Request

TypeConditionRequireDefaultLimitationDescription
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<Namespace>List of Namespace
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

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.Gs2Distributor.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Distributor.Request.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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('distributor')

api_result_handler = client.describe_namespaces_async({
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

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

createNamespace

Create a new namespace

Request

TypeConditionRequireDefaultLimitationDescription
namestring~ 128 charsNamespace name
descriptionstring~ 1024 charsDescription
assumeUserIdstring~ 1024 charsUser GRN
autoRunStampSheetNotificationNotificationSettingPush notification when transaction auto-execution is complete
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceNamespace created

Implementation Example

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"),
        AutoRunStampSheetNotification: nil,
        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")
            ->withAutoRunStampSheetNotification(null)
            ->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")
            .withAutoRunStampSheetNotification(null)
            .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.Gs2Distributor.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Distributor.Request.CreateNamespaceRequest()
        .WithName("namespace1")
        .WithDescription(null)
        .WithAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
        .WithAutoRunStampSheetNotification(null)
        .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")
            .withAutoRunStampSheetNotification(null)
            .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_auto_run_stamp_sheet_notification(None)
            .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",
    autoRunStampSheetNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

api_result_handler = client.create_namespace_async({
    name="namespace1",
    description=nil,
    assumeUserId="grn:gs2::YourOwnerId:identifier:user:user-0001",
    autoRunStampSheetNotification=nil,
    logSetting={
        loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getNamespaceStatus

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Result

TypeDescription
statusstring

Implementation Example

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.Gs2Distributor.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Distributor.Request.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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
status = result.status;
client = gs2('distributor')

api_result_handler = client.get_namespace_status_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
status = result.status;

getNamespace

Get namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Result

TypeDescription
itemNamespaceNamespace

Implementation Example

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.Gs2Distributor.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Distributor.Request.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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

api_result_handler = client.get_namespace_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

updateNamespace

Update namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
descriptionstring~ 1024 charsDescription
assumeUserIdstring~ 1024 charsUser GRN
autoRunStampSheetNotificationNotificationSettingPush notification when transaction auto-execution is complete
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceUpdated namespace

Implementation Example

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"),
        AutoRunStampSheetNotification: nil,
        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")
            ->withAutoRunStampSheetNotification(null)
            ->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")
            .withAutoRunStampSheetNotification(null)
            .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.Gs2Distributor.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Distributor.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace1")
        .WithDescription("description1")
        .WithAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
        .WithAutoRunStampSheetNotification(null)
        .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")
            .withAutoRunStampSheetNotification(null)
            .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_auto_run_stamp_sheet_notification(None)
            .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",
    autoRunStampSheetNotification=nil,
    logSetting=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace1",
    description="description1",
    assumeUserId="grn:gs2::YourOwnerId:identifier:user:user-0001",
    autoRunStampSheetNotification=nil,
    logSetting=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

deleteNamespace

Delete namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Result

TypeDescription
itemNamespaceDeleted namespace

Implementation Example

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.Gs2Distributor.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Distributor.Request.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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

api_result_handler = client.delete_namespace_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

describeDistributorModelMasters

Get list of delivery setting masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<DistributorModelMaster>List of delivery setting masters
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

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.Gs2Distributor.Result.DescribeDistributorModelMastersResult> asyncResult = null;
yield return client.DescribeDistributorModelMasters(
    new Gs2.Gs2Distributor.Request.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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('distributor')

api_result_handler = client.describe_distributor_model_masters_async({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

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

createDistributorModelMaster

Create a new master distribution setting

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
namestring~ 128 charsdelivery setting name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
inboxNamespaceIdstring~ 1024 charsGS2-Inbox namespace GRN to transfer overflow resources
whiteListTargetIdsList<string>[]~ 100 itemsWhitelist of target resource GRNs that can be processed through the distributor

Result

TypeDescription
itemDistributorModelMasterCreated distribution setting master

Implementation Example

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.Gs2Distributor.Result.CreateDistributorModelMasterResult> asyncResult = null;
yield return client.CreateDistributorModelMaster(
    new Gs2.Gs2Distributor.Request.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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

api_result_handler = client.create_distributor_model_master_async({
    namespaceName="namespace1",
    name="distributor-model-0001",
    description=nil,
    metadata=nil,
    inboxNamespaceId=nil,
    whiteListTargetIds=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getDistributorModelMaster

Get delivery setting master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
distributorNamestring~ 128 charsdelivery setting name

Result

TypeDescription
itemDistributorModelMasterDelivery Setting Master

Implementation Example

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.Gs2Distributor.Result.GetDistributorModelMasterResult> asyncResult = null;
yield return client.GetDistributorModelMaster(
    new Gs2.Gs2Distributor.Request.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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

api_result_handler = client.get_distributor_model_master_async({
    namespaceName="namespace1",
    distributorName="distributor-model-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

updateDistributorModelMaster

Update distribution setting master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
distributorNamestring~ 128 charsdelivery setting name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
inboxNamespaceIdstring~ 1024 charsGS2-Inbox namespace GRN to transfer overflow resources
whiteListTargetIdsList<string>[]~ 100 itemsWhitelist of target resource GRNs that can be processed through the distributor

Result

TypeDescription
itemDistributorModelMasterUpdated distribution setting master

Implementation Example

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{
            pointy.String("grn:AAA"),
            pointy.String("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.Gs2Distributor.Result.UpdateDistributorModelMasterResult> asyncResult = null;
yield return client.UpdateDistributorModelMaster(
    new Gs2.Gs2Distributor.Request.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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

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

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

deleteDistributorModelMaster

Delete distribution setting master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
distributorNamestring~ 128 charsdelivery setting name

Result

TypeDescription
itemDistributorModelMasterDeleted distribution setting master

Implementation Example

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.Gs2Distributor.Result.DeleteDistributorModelMasterResult> asyncResult = null;
yield return client.DeleteDistributorModelMaster(
    new Gs2.Gs2Distributor.Request.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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

api_result_handler = client.delete_distributor_model_master_async({
    namespaceName="namespace1",
    distributorName="distributor-model-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

describeDistributorModels

Get list of delivery settings

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Result

TypeDescription
itemsList<DistributorModel>List of delivery settings

Implementation Example

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.Gs2Distributor.Result.DescribeDistributorModelsResult> asyncResult = null;
yield return client.DescribeDistributorModels(
    new Gs2.Gs2Distributor.Request.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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;
client = gs2('distributor')

api_result_handler = client.describe_distributor_models_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
items = result.items;

getDistributorModel

Get delivery setting

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
distributorNamestring~ 128 charsDelivery setting name

Result

TypeDescription
itemDistributorModelDelivery Setting

Implementation Example

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.Gs2Distributor.Result.GetDistributorModelResult> asyncResult = null;
yield return client.GetDistributorModel(
    new Gs2.Gs2Distributor.Request.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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

api_result_handler = client.get_distributor_model_async({
    namespaceName="namespace1",
    distributorName="distributor-model-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

exportMaster

Export master data for currently active delivery configurations

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Result

TypeDescription
itemCurrentDistributorMasterCurrently active delivery settings

Implementation Example

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.Gs2Distributor.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Distributor.Request.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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

api_result_handler = client.export_master_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getCurrentDistributorMaster

Retrieve the currently active delivery settings

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Result

TypeDescription
itemCurrentDistributorMasterCurrently active delivery settings

Implementation Example

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.Gs2Distributor.Result.GetCurrentDistributorMasterResult> asyncResult = null;
yield return client.GetCurrentDistributorMaster(
    new Gs2.Gs2Distributor.Request.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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

api_result_handler = client.get_current_distributor_master_async({
    namespaceName="namespace1",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

updateCurrentDistributorMaster

Update the currently active delivery settings

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
settingsstring~ 5242880 charsMaster data

Result

TypeDescription
itemCurrentDistributorMasterUpdated and currently available delivery settings

Implementation Example

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.Gs2Distributor.Result.UpdateCurrentDistributorMasterResult> asyncResult = null;
yield return client.UpdateCurrentDistributorMaster(
    new Gs2.Gs2Distributor.Request.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
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

api_result_handler = client.update_current_distributor_master_async({
    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}",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

updateCurrentDistributorMasterFromGitHub

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
checkoutSettingGitHubCheckoutSettingSetup to check out master data from GitHub

Result

TypeDescription
itemCurrentDistributorMasterUpdated and currently available delivery settings

Implementation Example

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: &distributor.GitHubCheckoutSetting{
            ApiKeyId: pointy.String("$gitHubApiKey1.apiKeyId"),
            RepositoryName: pointy.String("gs2io/master-data"),
            SourcePath: pointy.String("path/to/file.json"),
            ReferenceType: pointy.String("branch"),
            BranchName: pointy.String("develop"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.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((new GitHubCheckoutSetting())
                ->withApiKeyId(self::$gitHubApiKey1.apiKeyId)
                ->withRepositoryName("gs2io/master-data")
                ->withSourcePath("path/to/file.json")
                ->withReferenceType("branch")
                ->withBranchName("develop")
            )
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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(new GitHubCheckoutSetting()
                .withApiKeyId("$gitHubApiKey1.apiKeyId")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("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.Gs2Distributor.Result.UpdateCurrentDistributorMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentDistributorMasterFromGitHub(
    new Gs2.Gs2Distributor.Request.UpdateCurrentDistributorMasterFromGitHubRequest()
        .WithNamespaceName("namespace1")
        .WithCheckoutSetting(new Gs2.Gs2Distributor.Model.GitHubCheckoutSetting()
            .WithApiKeyId("$gitHubApiKey1.apiKeyId")
            .WithRepositoryName("gs2io/master-data")
            .WithSourcePath("path/to/file.json")
            .WithReferenceType("branch")
            .WithBranchName("develop")
        ),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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(new Gs2Distributor.model.GitHubCheckoutSetting()
                .withApiKeyId("$gitHubApiKey1.apiKeyId")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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(distributor.GitHubCheckoutSetting()
                .with_api_key_id(self.git_hub_api_key1.api_key_id)
                .with_repository_name('gs2io/master-data')
                .with_source_path('path/to/file.json')
                .with_reference_type('branch')
                .with_branch_name('develop')
            )
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.update_current_distributor_master_from_git_hub({
    namespaceName="namespace1",
    checkoutSetting={
        api_key_id="$gitHubApiKey1.apiKeyId",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

api_result_handler = client.update_current_distributor_master_from_git_hub_async({
    namespaceName="namespace1",
    checkoutSetting={
        api_key_id="$gitHubApiKey1.apiKeyId",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

distribute

Distribution of possessions

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
distributorNamestring~ 128 charsDelivery setting name
userIdstring~ 128 charsUser Id
distributeResourceDistributeResourceResources to be added
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
distributeResourceDistributeResourceProcessed DistributeResource
inboxNamespaceIdstringGRN of the namespace of the gift box to be forwarded when the holdings are over capacity.
resultstringResponse content

Implementation Example

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: &distributor.DistributeResource{
            Action: pointy.String("Gs2Money:DepositWallet"),
            Request: pointy.String("{}"),
        },
        TimeOffsetToken: nil,
    }
)
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((new DistributeResource())
                ->withAction("Gs2Money:DepositWallet")
                ->withRequest("{}")
            )
            ->withTimeOffsetToken(null)
    );
    $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(new DistributeResource()
                .withAction("Gs2Money:DepositWallet")
                .withRequest("{}")
            )
            .withTimeOffsetToken(null)
    );
    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.Gs2Distributor.Result.DistributeResult> asyncResult = null;
yield return client.Distribute(
    new Gs2.Gs2Distributor.Request.DistributeRequest()
        .WithNamespaceName("namespace1")
        .WithDistributorName("distributor-0001")
        .WithUserId("user-0001")
        .WithDistributeResource(new Gs2.Gs2Distributor.Model.DistributeResource()
            .WithAction("Gs2Money:DepositWallet")
            .WithRequest("{}")
        )
        .WithTimeOffsetToken(null),
    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(new Gs2Distributor.model.DistributeResource()
                .withAction("Gs2Money:DepositWallet")
                .withRequest("{}")
            )
            .withTimeOffsetToken(null)
    );
    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(distributor.DistributeResource()
                .with_action('Gs2Money:DepositWallet')
                .with_request('{}')
            )
            .with_time_offset_token(None)
    )
    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="{}",
    },
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
distributeResource = result.distributeResource;
inboxNamespaceId = result.inboxNamespaceId;
result = result.result;
client = gs2('distributor')

api_result_handler = client.distribute_async({
    namespaceName="namespace1",
    distributorName="distributor-0001",
    userId="user-0001",
    distributeResource={
        action="Gs2Money:DepositWallet",
        request="{}",
    },
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

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

distributeWithoutOverflowProcess

Distribute possessions (no bailout in case of overflow)

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
distributeResourceDistributeResourceResources to be added
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
distributeResourceDistributeResourceProcessed DistributeResource
resultstringResponse content

Implementation Example

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: &distributor.DistributeResource{
            Action: pointy.String("Gs2Money:DepositWallet"),
            Request: pointy.String("{}"),
        },
        TimeOffsetToken: nil,
    }
)
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((new DistributeResource())
                ->withAction("Gs2Money:DepositWallet")
                ->withRequest("{}")
            )
            ->withTimeOffsetToken(null)
    );
    $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(new DistributeResource()
                .withAction("Gs2Money:DepositWallet")
                .withRequest("{}")
            )
            .withTimeOffsetToken(null)
    );
    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.Gs2Distributor.Result.DistributeWithoutOverflowProcessResult> asyncResult = null;
yield return client.DistributeWithoutOverflowProcess(
    new Gs2.Gs2Distributor.Request.DistributeWithoutOverflowProcessRequest()
        .WithUserId("user-0001")
        .WithDistributeResource(new Gs2.Gs2Distributor.Model.DistributeResource()
            .WithAction("Gs2Money:DepositWallet")
            .WithRequest("{}")
        )
        .WithTimeOffsetToken(null),
    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(new Gs2Distributor.model.DistributeResource()
                .withAction("Gs2Money:DepositWallet")
                .withRequest("{}")
            )
            .withTimeOffsetToken(null)
    );
    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(distributor.DistributeResource()
                .with_action('Gs2Money:DepositWallet')
                .with_request('{}')
            )
            .with_time_offset_token(None)
    )
    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="{}",
    },
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
distributeResource = result.distributeResource;
result = result.result;
client = gs2('distributor')

api_result_handler = client.distribute_without_overflow_process_async({
    userId="user-0001",
    distributeResource={
        action="Gs2Money:DepositWallet",
        request="{}",
    },
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

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

runVerifyTask

Execute verify action of transaction

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
verifyTaskstring~ 5242880 charsVerify Action
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
contextStackstringRequest of context reflecting task execution results
statusCodeintStatus code
resultstringResponse content

Implementation Example

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.RunVerifyTask(
    &distributor.RunVerifyTaskRequest {
        NamespaceName: pointy.String("namespace1"),
        VerifyTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
contextStack := result.ContextStack
statusCode := result.StatusCode
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\RunVerifyTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->runVerifyTask(
        (new RunVerifyTaskRequest())
            ->withNamespaceName(self::namespace1)
            ->withVerifyTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $contextStack = $result->getContextStack();
    $statusCode = $result->getStatusCode();
    $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.RunVerifyTaskRequest;
import io.gs2.distributor.result.RunVerifyTaskResult;

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

try {
    RunVerifyTaskResult result = client.runVerifyTask(
        new RunVerifyTaskRequest()
            .withNamespaceName("namespace1")
            .withVerifyTask("stampTask")
            .withKeyId("key-0001")
    );
    String contextStack = result.getContextStack();
    int statusCode = result.getStatusCode();
    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.RunVerifyTaskRequest;
using Gs2.Gs2Distributor.Result.RunVerifyTaskResult;

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.Gs2Distributor.Result.RunVerifyTaskResult> asyncResult = null;
yield return client.RunVerifyTask(
    new Gs2.Gs2Distributor.Request.RunVerifyTaskRequest()
        .WithNamespaceName("namespace1")
        .WithVerifyTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var contextStack = result.ContextStack;
var statusCode = result.StatusCode;
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.runVerifyTask(
        new Gs2Distributor.RunVerifyTaskRequest()
            .withNamespaceName("namespace1")
            .withVerifyTask("stampTask")
            .withKeyId("key-0001")
    );
    const contextStack = result.getContextStack();
    const statusCode = result.getStatusCode();
    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_verify_task(
        distributor.RunVerifyTaskRequest()
            .with_namespace_name(self.hash1)
            .with_verify_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    context_stack = result.context_stack
    status_code = result.status_code
    result = result.result
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.run_verify_task({
    namespaceName="namespace1",
    verifyTask="stampTask",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
contextStack = result.contextStack;
statusCode = result.statusCode;
result = result.result;
client = gs2('distributor')

api_result_handler = client.run_verify_task_async({
    namespaceName="namespace1",
    verifyTask="stampTask",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

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

runStampTask

Execute consume action of transaction

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
stampTaskstring~ 5242880 charsConsume Action
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
contextStackstringRequest of context reflecting task execution results
statusCodeintStatus code
resultstringResponse content

Implementation Example

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("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
contextStack := result.ContextStack
statusCode := result.StatusCode
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::key-0001)
    );
    $contextStack = $result->getContextStack();
    $statusCode = $result->getStatusCode();
    $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("key-0001")
    );
    String contextStack = result.getContextStack();
    int statusCode = result.getStatusCode();
    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.Gs2Distributor.Result.RunStampTaskResult> asyncResult = null;
yield return client.RunStampTask(
    new Gs2.Gs2Distributor.Request.RunStampTaskRequest()
        .WithNamespaceName("namespace1")
        .WithStampTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var contextStack = result.ContextStack;
var statusCode = result.StatusCode;
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("key-0001")
    );
    const contextStack = result.getContextStack();
    const statusCode = result.getStatusCode();
    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
    status_code = result.status_code
    result = result.result
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.run_stamp_task({
    namespaceName="namespace1",
    stampTask="stampTask",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
contextStack = result.contextStack;
statusCode = result.statusCode;
result = result.result;
client = gs2('distributor')

api_result_handler = client.run_stamp_task_async({
    namespaceName="namespace1",
    stampTask="stampTask",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

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

runStampSheet

Execute acquire action of transaction

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
stampSheetstring~ 5242880 charsTransaction
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
statusCodeintStatus code
resultstringResponse content

Implementation Example

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("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
statusCode := result.StatusCode
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::key-0001)
    );
    $statusCode = $result->getStatusCode();
    $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("key-0001")
    );
    int statusCode = result.getStatusCode();
    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.Gs2Distributor.Result.RunStampSheetResult> asyncResult = null;
yield return client.RunStampSheet(
    new Gs2.Gs2Distributor.Request.RunStampSheetRequest()
        .WithNamespaceName("namespace1")
        .WithStampSheet("stampSheet")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var statusCode = result.StatusCode;
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("key-0001")
    );
    const statusCode = result.getStatusCode();
    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)
    )
    status_code = result.status_code
    result = result.result
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.run_stamp_sheet({
    namespaceName="namespace1",
    stampSheet="stampSheet",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
statusCode = result.statusCode;
result = result.result;
client = gs2('distributor')

api_result_handler = client.run_stamp_sheet_async({
    namespaceName="namespace1",
    stampSheet="stampSheet",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
statusCode = result.statusCode;
result = result.result;

runStampSheetExpress

Execute transaction

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
stampSheetstring~ 5242880 charsTransaction
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
verifyTaskResultCodesList<int>Verify action execution status code
verifyTaskResultsList<string>Verify action execution results
taskResultCodesList<int>Consume action execution status code
taskResultsList<string>Consume action execution results
sheetResultCodeintAcquire action execution status code
sheetResultstringAcquire action execution result response content

Implementation Example

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("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
verifyTaskResultCodes := result.VerifyTaskResultCodes
verifyTaskResults := result.VerifyTaskResults
taskResultCodes := result.TaskResultCodes
taskResults := result.TaskResults
sheetResultCode := result.SheetResultCode
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::key-0001)
    );
    $verifyTaskResultCodes = $result->getVerifyTaskResultCodes();
    $verifyTaskResults = $result->getVerifyTaskResults();
    $taskResultCodes = $result->getTaskResultCodes();
    $taskResults = $result->getTaskResults();
    $sheetResultCode = $result->getSheetResultCode();
    $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("key-0001")
    );
    List<int> verifyTaskResultCodes = result.getVerifyTaskResultCodes();
    List<String> verifyTaskResults = result.getVerifyTaskResults();
    List<int> taskResultCodes = result.getTaskResultCodes();
    List<String> taskResults = result.getTaskResults();
    int sheetResultCode = result.getSheetResultCode();
    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.Gs2Distributor.Result.RunStampSheetExpressResult> asyncResult = null;
yield return client.RunStampSheetExpress(
    new Gs2.Gs2Distributor.Request.RunStampSheetExpressRequest()
        .WithNamespaceName("namespace1")
        .WithStampSheet("stampSheet")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var verifyTaskResultCodes = result.VerifyTaskResultCodes;
var verifyTaskResults = result.VerifyTaskResults;
var taskResultCodes = result.TaskResultCodes;
var taskResults = result.TaskResults;
var sheetResultCode = result.SheetResultCode;
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("key-0001")
    );
    const verifyTaskResultCodes = result.getVerifyTaskResultCodes();
    const verifyTaskResults = result.getVerifyTaskResults();
    const taskResultCodes = result.getTaskResultCodes();
    const taskResults = result.getTaskResults();
    const sheetResultCode = result.getSheetResultCode();
    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)
    )
    verify_task_result_codes = result.verify_task_result_codes
    verify_task_results = result.verify_task_results
    task_result_codes = result.task_result_codes
    task_results = result.task_results
    sheet_result_code = result.sheet_result_code
    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="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
verifyTaskResultCodes = result.verifyTaskResultCodes;
verifyTaskResults = result.verifyTaskResults;
taskResultCodes = result.taskResultCodes;
taskResults = result.taskResults;
sheetResultCode = result.sheetResultCode;
sheetResult = result.sheetResult;
client = gs2('distributor')

api_result_handler = client.run_stamp_sheet_express_async({
    namespaceName="namespace1",
    stampSheet="stampSheet",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
verifyTaskResultCodes = result.verifyTaskResultCodes;
verifyTaskResults = result.verifyTaskResults;
taskResultCodes = result.taskResultCodes;
taskResults = result.taskResults;
sheetResultCode = result.sheetResultCode;
sheetResult = result.sheetResult;

runVerifyTaskWithoutNamespace

Execute verify action of transaction without specifying the GS2-Distributor namespace

By omitting the namespace specification, the There are side effects such as logging not being possible, resource overflow processing not being executed, etc.

Request

TypeConditionRequireDefaultLimitationDescription
verifyTaskstring~ 5242880 charsVerify Action
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
contextStackstringRequest of context reflecting task execution results
statusCodeintStatus code
resultstringResponse content

Implementation Example

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.RunVerifyTaskWithoutNamespace(
    &distributor.RunVerifyTaskWithoutNamespaceRequest {
        VerifyTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
contextStack := result.ContextStack
statusCode := result.StatusCode
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\RunVerifyTaskWithoutNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->runVerifyTaskWithoutNamespace(
        (new RunVerifyTaskWithoutNamespaceRequest())
            ->withVerifyTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $contextStack = $result->getContextStack();
    $statusCode = $result->getStatusCode();
    $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.RunVerifyTaskWithoutNamespaceRequest;
import io.gs2.distributor.result.RunVerifyTaskWithoutNamespaceResult;

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

try {
    RunVerifyTaskWithoutNamespaceResult result = client.runVerifyTaskWithoutNamespace(
        new RunVerifyTaskWithoutNamespaceRequest()
            .withVerifyTask("stampTask")
            .withKeyId("key-0001")
    );
    String contextStack = result.getContextStack();
    int statusCode = result.getStatusCode();
    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.RunVerifyTaskWithoutNamespaceRequest;
using Gs2.Gs2Distributor.Result.RunVerifyTaskWithoutNamespaceResult;

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.Gs2Distributor.Result.RunVerifyTaskWithoutNamespaceResult> asyncResult = null;
yield return client.RunVerifyTaskWithoutNamespace(
    new Gs2.Gs2Distributor.Request.RunVerifyTaskWithoutNamespaceRequest()
        .WithVerifyTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var contextStack = result.ContextStack;
var statusCode = result.StatusCode;
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.runVerifyTaskWithoutNamespace(
        new Gs2Distributor.RunVerifyTaskWithoutNamespaceRequest()
            .withVerifyTask("stampTask")
            .withKeyId("key-0001")
    );
    const contextStack = result.getContextStack();
    const statusCode = result.getStatusCode();
    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_verify_task_without_namespace(
        distributor.RunVerifyTaskWithoutNamespaceRequest()
            .with_verify_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    context_stack = result.context_stack
    status_code = result.status_code
    result = result.result
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.run_verify_task_without_namespace({
    verifyTask="stampTask",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
contextStack = result.contextStack;
statusCode = result.statusCode;
result = result.result;
client = gs2('distributor')

api_result_handler = client.run_verify_task_without_namespace_async({
    verifyTask="stampTask",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

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

runStampTaskWithoutNamespace

Execute consume action of transaction without specifying the GS2-Distributor namespace

By omitting the namespace specification, the There are side effects such as logging not being possible, resource overflow processing not being executed, etc.

Request

TypeConditionRequireDefaultLimitationDescription
stampTaskstring~ 5242880 charsConsume Action
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
contextStackstringRequest of context reflecting task execution results
statusCodeintStatus code
resultstringResponse content

Implementation Example

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("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
contextStack := result.ContextStack
statusCode := result.StatusCode
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::key-0001)
    );
    $contextStack = $result->getContextStack();
    $statusCode = $result->getStatusCode();
    $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("key-0001")
    );
    String contextStack = result.getContextStack();
    int statusCode = result.getStatusCode();
    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.Gs2Distributor.Result.RunStampTaskWithoutNamespaceResult> asyncResult = null;
yield return client.RunStampTaskWithoutNamespace(
    new Gs2.Gs2Distributor.Request.RunStampTaskWithoutNamespaceRequest()
        .WithStampTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var contextStack = result.ContextStack;
var statusCode = result.StatusCode;
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("key-0001")
    );
    const contextStack = result.getContextStack();
    const statusCode = result.getStatusCode();
    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
    status_code = result.status_code
    result = result.result
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.run_stamp_task_without_namespace({
    stampTask="stampTask",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
contextStack = result.contextStack;
statusCode = result.statusCode;
result = result.result;
client = gs2('distributor')

api_result_handler = client.run_stamp_task_without_namespace_async({
    stampTask="stampTask",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

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

runStampSheetWithoutNamespace

Execute acquire action of transaction without specifying the GS2-Distributor namespace

By omitting the namespace specification, the There are side effects such as logging not being possible, resource overflow processing not being executed, etc.

Request

TypeConditionRequireDefaultLimitationDescription
stampSheetstring~ 5242880 charsTransaction
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
statusCodeintStatus code
resultstringResponse content

Implementation Example

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("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
statusCode := result.StatusCode
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::key-0001)
    );
    $statusCode = $result->getStatusCode();
    $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("key-0001")
    );
    int statusCode = result.getStatusCode();
    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.Gs2Distributor.Result.RunStampSheetWithoutNamespaceResult> asyncResult = null;
yield return client.RunStampSheetWithoutNamespace(
    new Gs2.Gs2Distributor.Request.RunStampSheetWithoutNamespaceRequest()
        .WithStampSheet("stampSheet")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var statusCode = result.StatusCode;
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("key-0001")
    );
    const statusCode = result.getStatusCode();
    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)
    )
    status_code = result.status_code
    result = result.result
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.run_stamp_sheet_without_namespace({
    stampSheet="stampSheet",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
statusCode = result.statusCode;
result = result.result;
client = gs2('distributor')

api_result_handler = client.run_stamp_sheet_without_namespace_async({
    stampSheet="stampSheet",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
statusCode = result.statusCode;
result = result.result;

runStampSheetExpressWithoutNamespace

Execute transactions without specifying the GS2-Distributor namespace

Request

TypeConditionRequireDefaultLimitationDescription
stampSheetstring~ 5242880 charsTransaction
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
verifyTaskResultCodesList<int>Verify action execution status code
verifyTaskResultsList<string>Verify action execution results
taskResultCodesList<int>Consume action execution status code
taskResultsList<string>Consume action execution results
sheetResultCodeintAcquire action execution status code
sheetResultstringAcquire action execution result response content

Implementation Example

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("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
verifyTaskResultCodes := result.VerifyTaskResultCodes
verifyTaskResults := result.VerifyTaskResults
taskResultCodes := result.TaskResultCodes
taskResults := result.TaskResults
sheetResultCode := result.SheetResultCode
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::key-0001)
    );
    $verifyTaskResultCodes = $result->getVerifyTaskResultCodes();
    $verifyTaskResults = $result->getVerifyTaskResults();
    $taskResultCodes = $result->getTaskResultCodes();
    $taskResults = $result->getTaskResults();
    $sheetResultCode = $result->getSheetResultCode();
    $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("key-0001")
    );
    List<int> verifyTaskResultCodes = result.getVerifyTaskResultCodes();
    List<String> verifyTaskResults = result.getVerifyTaskResults();
    List<int> taskResultCodes = result.getTaskResultCodes();
    List<String> taskResults = result.getTaskResults();
    int sheetResultCode = result.getSheetResultCode();
    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.Gs2Distributor.Result.RunStampSheetExpressWithoutNamespaceResult> asyncResult = null;
yield return client.RunStampSheetExpressWithoutNamespace(
    new Gs2.Gs2Distributor.Request.RunStampSheetExpressWithoutNamespaceRequest()
        .WithStampSheet("stampSheet")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var verifyTaskResultCodes = result.VerifyTaskResultCodes;
var verifyTaskResults = result.VerifyTaskResults;
var taskResultCodes = result.TaskResultCodes;
var taskResults = result.TaskResults;
var sheetResultCode = result.SheetResultCode;
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("key-0001")
    );
    const verifyTaskResultCodes = result.getVerifyTaskResultCodes();
    const verifyTaskResults = result.getVerifyTaskResults();
    const taskResultCodes = result.getTaskResultCodes();
    const taskResults = result.getTaskResults();
    const sheetResultCode = result.getSheetResultCode();
    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)
    )
    verify_task_result_codes = result.verify_task_result_codes
    verify_task_results = result.verify_task_results
    task_result_codes = result.task_result_codes
    task_results = result.task_results
    sheet_result_code = result.sheet_result_code
    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="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
verifyTaskResultCodes = result.verifyTaskResultCodes;
verifyTaskResults = result.verifyTaskResults;
taskResultCodes = result.taskResultCodes;
taskResults = result.taskResults;
sheetResultCode = result.sheetResultCode;
sheetResult = result.sheetResult;
client = gs2('distributor')

api_result_handler = client.run_stamp_sheet_express_without_namespace_async({
    stampSheet="stampSheet",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
verifyTaskResultCodes = result.verifyTaskResultCodes;
verifyTaskResults = result.verifyTaskResults;
taskResultCodes = result.taskResultCodes;
taskResults = result.taskResults;
sheetResultCode = result.sheetResultCode;
sheetResult = result.sheetResult;

setTransactionDefaultConfig

Set the default value of Config to be specified for the Transaction Issuance API

By using the return value ContextStack to communicate, you can set the default value of Config. The default value is valid for 18 hours, and the value will be ignored after that.

Request

TypeConditionRequireDefaultLimitationDescription
accessTokenstring~ 128 charsUser Id
configList<Config>1 ~ 1000 itemsTransaction placeholder applied settings values

Result

TypeDescription
newContextStackstringContext stack reflecting the results of the task

Implementation Example

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.SetTransactionDefaultConfig(
    &distributor.SetTransactionDefaultConfigRequest {
        AccessToken: pointy.String("accessToken-0001"),
        Config: []distributor.Config{
            distributor.Config{
                Key: pointy.String("key-0001"),
                Value: pointy.String("value-0001"),
            },
            distributor.Config{
                Key: pointy.String("key-0002"),
                Value: pointy.String("value-0002"),
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\SetTransactionDefaultConfigRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->setTransactionDefaultConfig(
        (new SetTransactionDefaultConfigRequest())
            ->withAccessToken(self::$accessToken0001)
            ->withConfig([
                (new Config())
                    ->withKey("key-0001")
                    ->withValue("value-0001"),
                (new Config())
                    ->withKey("key-0002")
                    ->withValue("value-0002"),
            ])
    );
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.SetTransactionDefaultConfigRequest;
import io.gs2.distributor.result.SetTransactionDefaultConfigResult;

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

try {
    SetTransactionDefaultConfigResult result = client.setTransactionDefaultConfig(
        new SetTransactionDefaultConfigRequest()
            .withAccessToken("accessToken-0001")
            .withConfig(Arrays.asList(
                new Config()
                    .withKey("key-0001")
                    .withValue("value-0001"),
                new Config()
                    .withKey("key-0002")
                    .withValue("value-0002")
            ))
    );
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.SetTransactionDefaultConfigRequest;
using Gs2.Gs2Distributor.Result.SetTransactionDefaultConfigResult;

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.Gs2Distributor.Result.SetTransactionDefaultConfigResult> asyncResult = null;
yield return client.SetTransactionDefaultConfig(
    new Gs2.Gs2Distributor.Request.SetTransactionDefaultConfigRequest()
        .WithAccessToken("accessToken-0001")
        .WithConfig(new Gs2.Gs2Distributor.Model.Config[] {
            new Gs2.Gs2Distributor.Model.Config()
                .WithKey("key-0001")
                .WithValue("value-0001"),
            new Gs2.Gs2Distributor.Model.Config()
                .WithKey("key-0002")
                .WithValue("value-0002"),
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.setTransactionDefaultConfig(
        new Gs2Distributor.SetTransactionDefaultConfigRequest()
            .withAccessToken("accessToken-0001")
            .withConfig([
                new Gs2Distributor.model.Config()
                    .withKey("key-0001")
                    .withValue("value-0001"),
                new Gs2Distributor.model.Config()
                    .withKey("key-0002")
                    .withValue("value-0002"),
            ])
    );
    const newContextStack = result.getNewContextStack();
} 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.set_transaction_default_config(
        distributor.SetTransactionDefaultConfigRequest()
            .with_access_token(self.access_token_0001)
            .with_config([
                distributor.Config()
                    .with_key('key-0001')
                    .with_value('value-0001'),
                distributor.Config()
                    .with_key('key-0002')
                    .with_value('value-0002'),
            ])
    )
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.set_transaction_default_config({
    accessToken="accessToken-0001",
    config={
        {
            key="key-0001",
            value="value-0001",
        },
        {
            key="key-0002",
            value="value-0002",
        }
    },
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;
client = gs2('distributor')

api_result_handler = client.set_transaction_default_config_async({
    accessToken="accessToken-0001",
    config={
        {
            key="key-0001",
            value="value-0001",
        },
        {
            key="key-0002",
            value="value-0002",
        }
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;

setTransactionDefaultConfigByUserId

Set the default value of Config to be specified for the Transaction Issuance API specified by user ID

By using the return value ContextStack to communicate, you can set the default value of Config. The default value is valid for 18 hours, and the value will be ignored after that.

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
configList<Config>1 ~ 1000 itemsTransaction placeholder applied settings values
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
newContextStackstringContext stack reflecting the results of the task

Implementation Example

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.SetTransactionDefaultConfigByUserId(
    &distributor.SetTransactionDefaultConfigByUserIdRequest {
        UserId: pointy.String("user-0001"),
        Config: []distributor.Config{
            distributor.Config{
                Key: pointy.String("key-0001"),
                Value: pointy.String("value-0001"),
            },
            distributor.Config{
                Key: pointy.String("key-0002"),
                Value: pointy.String("value-0002"),
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\SetTransactionDefaultConfigByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->setTransactionDefaultConfigByUserId(
        (new SetTransactionDefaultConfigByUserIdRequest())
            ->withUserId("user-0001")
            ->withConfig([
                (new Config())
                    ->withKey("key-0001")
                    ->withValue("value-0001"),
                (new Config())
                    ->withKey("key-0002")
                    ->withValue("value-0002"),
            ])
            ->withTimeOffsetToken(null)
    );
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.SetTransactionDefaultConfigByUserIdRequest;
import io.gs2.distributor.result.SetTransactionDefaultConfigByUserIdResult;

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

try {
    SetTransactionDefaultConfigByUserIdResult result = client.setTransactionDefaultConfigByUserId(
        new SetTransactionDefaultConfigByUserIdRequest()
            .withUserId("user-0001")
            .withConfig(Arrays.asList(
                new Config()
                    .withKey("key-0001")
                    .withValue("value-0001"),
                new Config()
                    .withKey("key-0002")
                    .withValue("value-0002")
            ))
            .withTimeOffsetToken(null)
    );
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.SetTransactionDefaultConfigByUserIdRequest;
using Gs2.Gs2Distributor.Result.SetTransactionDefaultConfigByUserIdResult;

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.Gs2Distributor.Result.SetTransactionDefaultConfigByUserIdResult> asyncResult = null;
yield return client.SetTransactionDefaultConfigByUserId(
    new Gs2.Gs2Distributor.Request.SetTransactionDefaultConfigByUserIdRequest()
        .WithUserId("user-0001")
        .WithConfig(new Gs2.Gs2Distributor.Model.Config[] {
            new Gs2.Gs2Distributor.Model.Config()
                .WithKey("key-0001")
                .WithValue("value-0001"),
            new Gs2.Gs2Distributor.Model.Config()
                .WithKey("key-0002")
                .WithValue("value-0002"),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.setTransactionDefaultConfigByUserId(
        new Gs2Distributor.SetTransactionDefaultConfigByUserIdRequest()
            .withUserId("user-0001")
            .withConfig([
                new Gs2Distributor.model.Config()
                    .withKey("key-0001")
                    .withValue("value-0001"),
                new Gs2Distributor.model.Config()
                    .withKey("key-0002")
                    .withValue("value-0002"),
            ])
            .withTimeOffsetToken(null)
    );
    const newContextStack = result.getNewContextStack();
} 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.set_transaction_default_config_by_user_id(
        distributor.SetTransactionDefaultConfigByUserIdRequest()
            .with_user_id('user-0001')
            .with_config([
                distributor.Config()
                    .with_key('key-0001')
                    .with_value('value-0001'),
                distributor.Config()
                    .with_key('key-0002')
                    .with_value('value-0002'),
            ])
            .with_time_offset_token(None)
    )
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.set_transaction_default_config_by_user_id({
    userId="user-0001",
    config={
        {
            key="key-0001",
            value="value-0001",
        },
        {
            key="key-0002",
            value="value-0002",
        }
    },
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;
client = gs2('distributor')

api_result_handler = client.set_transaction_default_config_by_user_id_async({
    userId="user-0001",
    config={
        {
            key="key-0001",
            value="value-0001",
        },
        {
            key="key-0002",
            value="value-0002",
        }
    },
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;

freezeMasterData

Freeze master data at the current time

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
accessTokenstring~ 128 charsUser Id

Result

TypeDescription
newContextStackstringRequest of context in time to freeze the master data

Implementation Example

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.FreezeMasterData(
    &distributor.FreezeMasterDataRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\FreezeMasterDataRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->freezeMasterData(
        (new FreezeMasterDataRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
    );
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.FreezeMasterDataRequest;
import io.gs2.distributor.result.FreezeMasterDataResult;

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

try {
    FreezeMasterDataResult result = client.freezeMasterData(
        new FreezeMasterDataRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
    );
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.FreezeMasterDataRequest;
using Gs2.Gs2Distributor.Result.FreezeMasterDataResult;

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.Gs2Distributor.Result.FreezeMasterDataResult> asyncResult = null;
yield return client.FreezeMasterData(
    new Gs2.Gs2Distributor.Request.FreezeMasterDataRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.freezeMasterData(
        new Gs2Distributor.FreezeMasterDataRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
    );
    const newContextStack = result.getNewContextStack();
} 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.freeze_master_data(
        distributor.FreezeMasterDataRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
    )
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.freeze_master_data({
    namespaceName="namespace1",
    accessToken="accessToken-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;
client = gs2('distributor')

api_result_handler = client.freeze_master_data_async({
    namespaceName="namespace1",
    accessToken="accessToken-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;

freezeMasterDataByUserId

Freeze master data at the current time by specifying a user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
newContextStackstringRequest of context in time to freeze the master data

Implementation Example

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.FreezeMasterDataByUserId(
    &distributor.FreezeMasterDataByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\FreezeMasterDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->freezeMasterDataByUserId(
        (new FreezeMasterDataByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.FreezeMasterDataByUserIdRequest;
import io.gs2.distributor.result.FreezeMasterDataByUserIdResult;

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

try {
    FreezeMasterDataByUserIdResult result = client.freezeMasterDataByUserId(
        new FreezeMasterDataByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.FreezeMasterDataByUserIdRequest;
using Gs2.Gs2Distributor.Result.FreezeMasterDataByUserIdResult;

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.Gs2Distributor.Result.FreezeMasterDataByUserIdResult> asyncResult = null;
yield return client.FreezeMasterDataByUserId(
    new Gs2.Gs2Distributor.Request.FreezeMasterDataByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.freezeMasterDataByUserId(
        new Gs2Distributor.FreezeMasterDataByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const newContextStack = result.getNewContextStack();
} 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.freeze_master_data_by_user_id(
        distributor.FreezeMasterDataByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.freeze_master_data_by_user_id({
    namespaceName="namespace1",
    userId="user-0001",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;
client = gs2('distributor')

api_result_handler = client.freeze_master_data_by_user_id_async({
    namespaceName="namespace1",
    userId="user-0001",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;

ifExpressionByUserId

Validate the condition and switch the contents of the consume action

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
userIdstring~ 128 charsUser Id
conditionVerifyActionCondition
trueActionsList<ConsumeAction>~ 10 itemsList of consume actions to be executed when the condition is true
falseActionsList<ConsumeAction>~ 10 itemsList of consume actions to be executed when the condition is true
multiplyValueSpecifyingQuantitybooltrueWhether to multiply the value used for verification when specifying the quantity
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

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.IfExpressionByUserId(
    &distributor.IfExpressionByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        Condition: &distributor.VerifyAction{
            Action: pointy.String("Gs2Inventory:VerifyItemSetByUserId"),
            Request: pointy.String("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
        },
        TrueActions: []distributor.ConsumeAction{
            distributor.ConsumeAction{
                Action: pointy.String("Gs2Inventory:ConsumeItemSetByUserId"),
                Request: pointy.String("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"consumeCount\": 1}"),
            },
        },
        FalseActions: []distributor.ConsumeAction{
            distributor.ConsumeAction{
                Action: pointy.String("Gs2Inventory:ConsumeSimpleItemsByUserId"),
                Request: pointy.String("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"consumeCounts\": [{\"itemName\": \"item-0001\", \"count\": 1}]}"),
            },
        },
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\IfExpressionByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->ifExpressionByUserId(
        (new IfExpressionByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withCondition((new VerifyAction())
                ->withAction("Gs2Inventory:VerifyItemSetByUserId")
                ->withRequest("{\"namespaceName\": \"\namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}")
            )
            ->withTrueActions([
                (new ConsumeAction())
                    ->withAction("Gs2Inventory:ConsumeItemSetByUserId")
                    ->withRequest("{\"namespaceName\": \"\namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"consumeCount\": 1}"),
            ])
            ->withFalseActions([
                (new ConsumeAction())
                    ->withAction("Gs2Inventory:ConsumeSimpleItemsByUserId")
                    ->withRequest("{\"namespaceName\": \"\namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"consumeCounts\": [{\"itemName\": \"item-0001\", \"count\": 1}]}"),
            ])
            ->withMultiplyValueSpecifyingQuantity(null)
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.IfExpressionByUserIdRequest;
import io.gs2.distributor.result.IfExpressionByUserIdResult;

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

try {
    IfExpressionByUserIdResult result = client.ifExpressionByUserId(
        new IfExpressionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withCondition(new VerifyAction()
                .withAction("Gs2Inventory:VerifyItemSetByUserId")
                .withRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}")
            )
            .withTrueActions(Arrays.asList(
                new ConsumeAction()
                    .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                    .withRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"consumeCount\": 1}")
            ))
            .withFalseActions(Arrays.asList(
                new ConsumeAction()
                    .withAction("Gs2Inventory:ConsumeSimpleItemsByUserId")
                    .withRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"consumeCounts\": [{\"itemName\": \"item-0001\", \"count\": 1}]}")
            ))
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.IfExpressionByUserIdRequest;
using Gs2.Gs2Distributor.Result.IfExpressionByUserIdResult;

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.Gs2Distributor.Result.IfExpressionByUserIdResult> asyncResult = null;
yield return client.IfExpressionByUserId(
    new Gs2.Gs2Distributor.Request.IfExpressionByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithCondition(new Gs2.Core.Model.VerifyAction()
            .WithAction("Gs2Inventory:VerifyItemSetByUserId")
            .WithRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}")
        )
        .WithTrueActions(new Gs2.Core.Model.ConsumeAction[] {
            new Gs2.Core.Model.ConsumeAction()
                .WithAction("Gs2Inventory:ConsumeItemSetByUserId")
                .WithRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"consumeCount\": 1}"),
        })
        .WithFalseActions(new Gs2.Core.Model.ConsumeAction[] {
            new Gs2.Core.Model.ConsumeAction()
                .WithAction("Gs2Inventory:ConsumeSimpleItemsByUserId")
                .WithRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"consumeCounts\": [{\"itemName\": \"item-0001\", \"count\": 1}]}"),
        })
        .WithMultiplyValueSpecifyingQuantity(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.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.ifExpressionByUserId(
        new Gs2Distributor.IfExpressionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withCondition(new Gs2Distributor.model.VerifyAction()
                .withAction("Gs2Inventory:VerifyItemSetByUserId")
                .withRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}")
            )
            .withTrueActions([
                new Gs2Distributor.model.ConsumeAction()
                    .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                    .withRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"consumeCount\": 1}"),
            ])
            .withFalseActions([
                new Gs2Distributor.model.ConsumeAction()
                    .withAction("Gs2Inventory:ConsumeSimpleItemsByUserId")
                    .withRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"consumeCounts\": [{\"itemName\": \"item-0001\", \"count\": 1}]}"),
            ])
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
} 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.if_expression_by_user_id(
        distributor.IfExpressionByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_condition(distributor.VerifyAction()
                .with_action('Gs2Inventory:VerifyItemSetByUserId')
                .with_request('{"namespaceName": "namespace1", "userId": "user-0001", "inventoryName": "inventory-0001", "itemName": "item-0001", "verifyType": "greaterEqual", "count": 1}')
            )
            .with_true_actions([
                distributor.ConsumeAction()
                    .with_action('Gs2Inventory:ConsumeItemSetByUserId')
                    .with_request('{"namespaceName": "namespace1", "userId": "user-0001", "inventoryName": "inventory-0001", "itemName": "item-0001", "consumeCount": 1}'),
            ])
            .with_false_actions([
                distributor.ConsumeAction()
                    .with_action('Gs2Inventory:ConsumeSimpleItemsByUserId')
                    .with_request('{"namespaceName": "namespace1", "userId": "user-0001", "inventoryName": "inventory-0001", "consumeCounts": [{"itemName": "item-0001", "count": 1}]}'),
            ])
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.if_expression_by_user_id({
    namespaceName="namespace1",
    userId="user-0001",
    condition={
        action="Gs2Inventory:VerifyItemSetByUserId",
        request="{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}",
    },
    trueActions={
        {
            action="Gs2Inventory:ConsumeItemSetByUserId",
            request="{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"consumeCount\": 1}",
        }
    },
    falseActions={
        {
            action="Gs2Inventory:ConsumeSimpleItemsByUserId",
            request="{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"consumeCounts\": [{\"itemName\": \"item-0001\", \"count\": 1}]}",
        }
    },
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
client = gs2('distributor')

api_result_handler = client.if_expression_by_user_id_async({
    namespaceName="namespace1",
    userId="user-0001",
    condition={
        action="Gs2Inventory:VerifyItemSetByUserId",
        request="{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}",
    },
    trueActions={
        {
            action="Gs2Inventory:ConsumeItemSetByUserId",
            request="{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"consumeCount\": 1}",
        }
    },
    falseActions={
        {
            action="Gs2Inventory:ConsumeSimpleItemsByUserId",
            request="{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"consumeCounts\": [{\"itemName\": \"item-0001\", \"count\": 1}]}",
        }
    },
    multiplyValueSpecifyingQuantity=nil,
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result

andExpressionByUserId

Perform multiple verification actions and determine if all are true

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
userIdstring~ 128 charsUser Id
actionsList<VerifyAction>~ 10 itemsList of verify actions to be executed
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

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.AndExpressionByUserId(
    &distributor.AndExpressionByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        Actions: []distributor.VerifyAction{
            distributor.VerifyAction{
                Action: pointy.String("Gs2Inventory:VerifyItemSetByUserId"),
                Request: pointy.String("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
            },
            distributor.VerifyAction{
                Action: pointy.String("Gs2Inventory:ConsumeItemSetByUserId"),
                Request: pointy.String("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0002\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\AndExpressionByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->andExpressionByUserId(
        (new AndExpressionByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withActions([
                (new VerifyAction())
                    ->withAction("Gs2Inventory:VerifyItemSetByUserId")
                    ->withRequest("{\"namespaceName\": \"\namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
                (new VerifyAction())
                    ->withAction("Gs2Inventory:ConsumeItemSetByUserId")
                    ->withRequest("{\"namespaceName\": \"\namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0002\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
            ])
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.AndExpressionByUserIdRequest;
import io.gs2.distributor.result.AndExpressionByUserIdResult;

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

try {
    AndExpressionByUserIdResult result = client.andExpressionByUserId(
        new AndExpressionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withActions(Arrays.asList(
                new VerifyAction()
                    .withAction("Gs2Inventory:VerifyItemSetByUserId")
                    .withRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
                new VerifyAction()
                    .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                    .withRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0002\", \"verifyType\": \"greaterEqual\", \"count\": 1}")
            ))
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.AndExpressionByUserIdRequest;
using Gs2.Gs2Distributor.Result.AndExpressionByUserIdResult;

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.Gs2Distributor.Result.AndExpressionByUserIdResult> asyncResult = null;
yield return client.AndExpressionByUserId(
    new Gs2.Gs2Distributor.Request.AndExpressionByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithActions(new Gs2.Core.Model.VerifyAction[] {
            new Gs2.Core.Model.VerifyAction()
                .WithAction("Gs2Inventory:VerifyItemSetByUserId")
                .WithRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
            new Gs2.Core.Model.VerifyAction()
                .WithAction("Gs2Inventory:ConsumeItemSetByUserId")
                .WithRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0002\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.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.andExpressionByUserId(
        new Gs2Distributor.AndExpressionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withActions([
                new Gs2Distributor.model.VerifyAction()
                    .withAction("Gs2Inventory:VerifyItemSetByUserId")
                    .withRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
                new Gs2Distributor.model.VerifyAction()
                    .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                    .withRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0002\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
            ])
            .withTimeOffsetToken(null)
    );
} 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.and_expression_by_user_id(
        distributor.AndExpressionByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_actions([
                distributor.VerifyAction()
                    .with_action('Gs2Inventory:VerifyItemSetByUserId')
                    .with_request('{"namespaceName": "namespace1", "userId": "user-0001", "inventoryName": "inventory-0001", "itemName": "item-0001", "verifyType": "greaterEqual", "count": 1}'),
                distributor.VerifyAction()
                    .with_action('Gs2Inventory:ConsumeItemSetByUserId')
                    .with_request('{"namespaceName": "namespace1", "userId": "user-0001", "inventoryName": "inventory-0001", "itemName": "item-0002", "verifyType": "greaterEqual", "count": 1}'),
            ])
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.and_expression_by_user_id({
    namespaceName="namespace1",
    userId="user-0001",
    actions={
        {
            action="Gs2Inventory:VerifyItemSetByUserId",
            request="{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}",
        },
        {
            action="Gs2Inventory:ConsumeItemSetByUserId",
            request="{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0002\", \"verifyType\": \"greaterEqual\", \"count\": 1}",
        }
    },
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
client = gs2('distributor')

api_result_handler = client.and_expression_by_user_id_async({
    namespaceName="namespace1",
    userId="user-0001",
    actions={
        {
            action="Gs2Inventory:VerifyItemSetByUserId",
            request="{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}",
        },
        {
            action="Gs2Inventory:ConsumeItemSetByUserId",
            request="{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0002\", \"verifyType\": \"greaterEqual\", \"count\": 1}",
        }
    },
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result

orExpressionByUserId

Perform multiple verification actions and determine if any are true

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
userIdstring~ 128 charsUser Id
actionsList<VerifyAction>~ 10 itemsList of verify actions to be executed
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

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.OrExpressionByUserId(
    &distributor.OrExpressionByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        Actions: []distributor.VerifyAction{
            distributor.VerifyAction{
                Action: pointy.String("Gs2Inventory:VerifyItemSetByUserId"),
                Request: pointy.String("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
            },
            distributor.VerifyAction{
                Action: pointy.String("Gs2Inventory:ConsumeItemSetByUserId"),
                Request: pointy.String("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0002\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\OrExpressionByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->orExpressionByUserId(
        (new OrExpressionByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withActions([
                (new VerifyAction())
                    ->withAction("Gs2Inventory:VerifyItemSetByUserId")
                    ->withRequest("{\"namespaceName\": \"\namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
                (new VerifyAction())
                    ->withAction("Gs2Inventory:ConsumeItemSetByUserId")
                    ->withRequest("{\"namespaceName\": \"\namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0002\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
            ])
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.OrExpressionByUserIdRequest;
import io.gs2.distributor.result.OrExpressionByUserIdResult;

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

try {
    OrExpressionByUserIdResult result = client.orExpressionByUserId(
        new OrExpressionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withActions(Arrays.asList(
                new VerifyAction()
                    .withAction("Gs2Inventory:VerifyItemSetByUserId")
                    .withRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
                new VerifyAction()
                    .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                    .withRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0002\", \"verifyType\": \"greaterEqual\", \"count\": 1}")
            ))
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.OrExpressionByUserIdRequest;
using Gs2.Gs2Distributor.Result.OrExpressionByUserIdResult;

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.Gs2Distributor.Result.OrExpressionByUserIdResult> asyncResult = null;
yield return client.OrExpressionByUserId(
    new Gs2.Gs2Distributor.Request.OrExpressionByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithActions(new Gs2.Core.Model.VerifyAction[] {
            new Gs2.Core.Model.VerifyAction()
                .WithAction("Gs2Inventory:VerifyItemSetByUserId")
                .WithRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
            new Gs2.Core.Model.VerifyAction()
                .WithAction("Gs2Inventory:ConsumeItemSetByUserId")
                .WithRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0002\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.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.orExpressionByUserId(
        new Gs2Distributor.OrExpressionByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withActions([
                new Gs2Distributor.model.VerifyAction()
                    .withAction("Gs2Inventory:VerifyItemSetByUserId")
                    .withRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
                new Gs2Distributor.model.VerifyAction()
                    .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                    .withRequest("{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0002\", \"verifyType\": \"greaterEqual\", \"count\": 1}"),
            ])
            .withTimeOffsetToken(null)
    );
} 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.or_expression_by_user_id(
        distributor.OrExpressionByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_actions([
                distributor.VerifyAction()
                    .with_action('Gs2Inventory:VerifyItemSetByUserId')
                    .with_request('{"namespaceName": "namespace1", "userId": "user-0001", "inventoryName": "inventory-0001", "itemName": "item-0001", "verifyType": "greaterEqual", "count": 1}'),
                distributor.VerifyAction()
                    .with_action('Gs2Inventory:ConsumeItemSetByUserId')
                    .with_request('{"namespaceName": "namespace1", "userId": "user-0001", "inventoryName": "inventory-0001", "itemName": "item-0002", "verifyType": "greaterEqual", "count": 1}'),
            ])
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.or_expression_by_user_id({
    namespaceName="namespace1",
    userId="user-0001",
    actions={
        {
            action="Gs2Inventory:VerifyItemSetByUserId",
            request="{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}",
        },
        {
            action="Gs2Inventory:ConsumeItemSetByUserId",
            request="{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0002\", \"verifyType\": \"greaterEqual\", \"count\": 1}",
        }
    },
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
client = gs2('distributor')

api_result_handler = client.or_expression_by_user_id_async({
    namespaceName="namespace1",
    userId="user-0001",
    actions={
        {
            action="Gs2Inventory:VerifyItemSetByUserId",
            request="{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0001\", \"verifyType\": \"greaterEqual\", \"count\": 1}",
        },
        {
            action="Gs2Inventory:ConsumeItemSetByUserId",
            request="{\"namespaceName\": \"namespace1\", \"userId\": \"user-0001\", \"inventoryName\": \"inventory-0001\", \"itemName\": \"item-0002\", \"verifyType\": \"greaterEqual\", \"count\": 1}",
        }
    },
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result

ifExpressionByStampTask

Execute the consume action as a condition for the consume action and switch the contents

Request

TypeConditionRequireDefaultLimitationDescription
stampTaskstring~ 5242880 charsVerify Action
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
newContextStackstringRequest of context in which consume action execution results are recorded

Implementation Example

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.IfExpressionByStampTask(
    &distributor.IfExpressionByStampTaskRequest {
        StampTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\IfExpressionByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->ifExpressionByStampTask(
        (new IfExpressionByStampTaskRequest())
            ->withStampTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.IfExpressionByStampTaskRequest;
import io.gs2.distributor.result.IfExpressionByStampTaskResult;

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

try {
    IfExpressionByStampTaskResult result = client.ifExpressionByStampTask(
        new IfExpressionByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.IfExpressionByStampTaskRequest;
using Gs2.Gs2Distributor.Result.IfExpressionByStampTaskResult;

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.Gs2Distributor.Result.IfExpressionByStampTaskResult> asyncResult = null;
yield return client.IfExpressionByStampTask(
    new Gs2.Gs2Distributor.Request.IfExpressionByStampTaskRequest()
        .WithStampTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.ifExpressionByStampTask(
        new Gs2Distributor.IfExpressionByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    const newContextStack = result.getNewContextStack();
} 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.if_expression_by_stamp_task(
        distributor.IfExpressionByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.if_expression_by_stamp_task({
    stampTask="stampTask",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;
client = gs2('distributor')

api_result_handler = client.if_expression_by_stamp_task_async({
    stampTask="stampTask",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;

andExpressionByStampTask

Execute verify actions as consume actions and determine if all are true as verify actions

Request

TypeConditionRequireDefaultLimitationDescription
stampTaskstring~ 5242880 charsVerify Action
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
newContextStackstringRequest of context in which verify action execution results are recorded

Implementation Example

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.AndExpressionByStampTask(
    &distributor.AndExpressionByStampTaskRequest {
        StampTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\AndExpressionByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->andExpressionByStampTask(
        (new AndExpressionByStampTaskRequest())
            ->withStampTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.AndExpressionByStampTaskRequest;
import io.gs2.distributor.result.AndExpressionByStampTaskResult;

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

try {
    AndExpressionByStampTaskResult result = client.andExpressionByStampTask(
        new AndExpressionByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.AndExpressionByStampTaskRequest;
using Gs2.Gs2Distributor.Result.AndExpressionByStampTaskResult;

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.Gs2Distributor.Result.AndExpressionByStampTaskResult> asyncResult = null;
yield return client.AndExpressionByStampTask(
    new Gs2.Gs2Distributor.Request.AndExpressionByStampTaskRequest()
        .WithStampTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.andExpressionByStampTask(
        new Gs2Distributor.AndExpressionByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    const newContextStack = result.getNewContextStack();
} 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.and_expression_by_stamp_task(
        distributor.AndExpressionByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.and_expression_by_stamp_task({
    stampTask="stampTask",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;
client = gs2('distributor')

api_result_handler = client.and_expression_by_stamp_task_async({
    stampTask="stampTask",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;

orExpressionByStampTask

Execute verify actions and determine if any are true as verify actions

Request

TypeConditionRequireDefaultLimitationDescription
stampTaskstring~ 5242880 charsVerify Action
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
newContextStackstringRequest of context in which verify action execution results are recorded

Implementation Example

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.OrExpressionByStampTask(
    &distributor.OrExpressionByStampTaskRequest {
        StampTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Distributor\Gs2DistributorRestClient;
use Gs2\Distributor\Request\OrExpressionByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->orExpressionByStampTask(
        (new OrExpressionByStampTaskRequest())
            ->withStampTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.OrExpressionByStampTaskRequest;
import io.gs2.distributor.result.OrExpressionByStampTaskResult;

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

try {
    OrExpressionByStampTaskResult result = client.orExpressionByStampTask(
        new OrExpressionByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Distributor.Gs2DistributorRestClient;
using Gs2.Gs2Distributor.Request.OrExpressionByStampTaskRequest;
using Gs2.Gs2Distributor.Result.OrExpressionByStampTaskResult;

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.Gs2Distributor.Result.OrExpressionByStampTaskResult> asyncResult = null;
yield return client.OrExpressionByStampTask(
    new Gs2.Gs2Distributor.Request.OrExpressionByStampTaskRequest()
        .WithStampTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.orExpressionByStampTask(
        new Gs2Distributor.OrExpressionByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    const newContextStack = result.getNewContextStack();
} 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.or_expression_by_stamp_task(
        distributor.OrExpressionByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.or_expression_by_stamp_task({
    stampTask="stampTask",
    keyId="key-0001",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;
client = gs2('distributor')

api_result_handler = client.or_expression_by_stamp_task_async({
    stampTask="stampTask",
    keyId="key-0001",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
newContextStack = result.newContextStack;

getStampSheetResult

Get transaction execution results

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
accessTokenstring~ 128 charsUser Id
transactionIdstring36 ~ 36 charsTransaction ID

Result

TypeDescription
itemStampSheetResultTransaction execution results

Implementation Example

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.GetStampSheetResult(
    &distributor.GetStampSheetResultRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("accessToken-0001"),
        TransactionId: pointy.String("cc1985c3-54f0-4fc3-b295-dc30214284ec"),
    }
)
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\GetStampSheetResultRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getStampSheetResult(
        (new GetStampSheetResultRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withTransactionId("cc1985c3-54f0-4fc3-b295-dc30214284ec")
    );
    $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.GetStampSheetResultRequest;
import io.gs2.distributor.result.GetStampSheetResultResult;

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

try {
    GetStampSheetResultResult result = client.getStampSheetResult(
        new GetStampSheetResultRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withTransactionId("cc1985c3-54f0-4fc3-b295-dc30214284ec")
    );
    StampSheetResult 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.GetStampSheetResultRequest;
using Gs2.Gs2Distributor.Result.GetStampSheetResultResult;

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.Gs2Distributor.Result.GetStampSheetResultResult> asyncResult = null;
yield return client.GetStampSheetResult(
    new Gs2.Gs2Distributor.Request.GetStampSheetResultRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("accessToken-0001")
        .WithTransactionId("cc1985c3-54f0-4fc3-b295-dc30214284ec"),
    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.getStampSheetResult(
        new Gs2Distributor.GetStampSheetResultRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
            .withTransactionId("cc1985c3-54f0-4fc3-b295-dc30214284ec")
    );
    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_stamp_sheet_result(
        distributor.GetStampSheetResultRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_transaction_id('cc1985c3-54f0-4fc3-b295-dc30214284ec')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.get_stamp_sheet_result({
    namespaceName="namespace1",
    accessToken="accessToken-0001",
    transactionId="cc1985c3-54f0-4fc3-b295-dc30214284ec",
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

api_result_handler = client.get_stamp_sheet_result_async({
    namespaceName="namespace1",
    accessToken="accessToken-0001",
    transactionId="cc1985c3-54f0-4fc3-b295-dc30214284ec",
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

getStampSheetResultByUserId

Get transaction execution results

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
userIdstring~ 128 charsUser Id
transactionIdstring36 ~ 36 charsTransaction ID
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemStampSheetResultTransaction execution results

Implementation Example

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.GetStampSheetResultByUserId(
    &distributor.GetStampSheetResultByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        TransactionId: pointy.String("cc1985c3-54f0-4fc3-b295-dc30214284ec"),
        TimeOffsetToken: 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\GetStampSheetResultByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getStampSheetResultByUserId(
        (new GetStampSheetResultByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withTransactionId("cc1985c3-54f0-4fc3-b295-dc30214284ec")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.distributor.rest.Gs2DistributorRestClient;
import io.gs2.distributor.request.GetStampSheetResultByUserIdRequest;
import io.gs2.distributor.result.GetStampSheetResultByUserIdResult;

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

try {
    GetStampSheetResultByUserIdResult result = client.getStampSheetResultByUserId(
        new GetStampSheetResultByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withTransactionId("cc1985c3-54f0-4fc3-b295-dc30214284ec")
            .withTimeOffsetToken(null)
    );
    StampSheetResult 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.GetStampSheetResultByUserIdRequest;
using Gs2.Gs2Distributor.Result.GetStampSheetResultByUserIdResult;

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.Gs2Distributor.Result.GetStampSheetResultByUserIdResult> asyncResult = null;
yield return client.GetStampSheetResultByUserId(
    new Gs2.Gs2Distributor.Request.GetStampSheetResultByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithUserId("user-0001")
        .WithTransactionId("cc1985c3-54f0-4fc3-b295-dc30214284ec")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.getStampSheetResultByUserId(
        new Gs2Distributor.GetStampSheetResultByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withTransactionId("cc1985c3-54f0-4fc3-b295-dc30214284ec")
            .withTimeOffsetToken(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.get_stamp_sheet_result_by_user_id(
        distributor.GetStampSheetResultByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_transaction_id('cc1985c3-54f0-4fc3-b295-dc30214284ec')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('distributor')

api_result = client.get_stamp_sheet_result_by_user_id({
    namespaceName="namespace1",
    userId="user-0001",
    transactionId="cc1985c3-54f0-4fc3-b295-dc30214284ec",
    timeOffsetToken=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;
client = gs2('distributor')

api_result_handler = client.get_stamp_sheet_result_by_user_id_async({
    namespaceName="namespace1",
    userId="user-0001",
    transactionId="cc1985c3-54f0-4fc3-b295-dc30214284ec",
    timeOffsetToken=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;