API Reference of GS2-Showcase 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
transactionSettingTransactionSettingTransaction settings
buyScriptScriptSettingScript to run when attempting to execute a purchase
logSettingLogSettingLog output settings
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
updatedAtlongNowDatetime of last update (Unix time unit:milliseconds)
revisionlong0~ 9223372036854775805Revision

SalesItemMaster

Product Master Data

Set the price required to purchase the product and the reward you will receive for purchasing the product.

TypeConditionRequireDefaultLimitationDescription
salesItemIdstring~ 1024 charsProduct Master GRN
namestring~ 128 charsProduct Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
verifyActionsList<VerifyAction>~ 10 itemsList of Verify Action
consumeActionsList<ConsumeAction>~ 10 itemsList of Consumption Action
acquireActionsList<AcquireAction>1 ~ 100 itemsList of Acquire Action
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
updatedAtlongNowDatetime of last update (Unix time unit:milliseconds)
revisionlong0~ 9223372036854775805Revision

SalesItemGroupMaster

Product Group Master Data

A product group is an entity for display on a display shelf. The first product that is determined to be available for purchase is actually displayed on the shelves. This can be used for products that are discounted only for the first time, or for a system in which the contents of products change depending on the number of times they are purchased, such as a step-up gacha.

TypeConditionRequireDefaultLimitationDescription
salesItemGroupIdstring~ 1024 charsProduct Group Master GRN
namestring~ 128 charsProduct Group Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
salesItemNamesList<string>2 ~ 10 itemsList of products to be included in the product group
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
updatedAtlongNowDatetime of last update (Unix time unit:milliseconds)
revisionlong0~ 9223372036854775805Revision

ShowcaseMaster

Showcase Master

The sales period can be set for the display shelf.

TypeConditionRequireDefaultLimitationDescription
showcaseIdstring~ 1024 charsShowcase master GRN
namestring~ 128 charsShowcase Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
salesPeriodEventIdstring~ 1024 charsGS2-Schedule events with sales periods for display shelves
displayItemsList<DisplayItemMaster>1 ~ 1000 itemsList of Products on display
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
updatedAtlongNowDatetime of last update (Unix time unit:milliseconds)
revisionlong0~ 9223372036854775805Revision

CurrentShowcaseMaster

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 you can also create JSON files using the 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 showcase master GRN
settingsstring~ 5242880 charsMaster data

SalesItem

Product

Set the price required to purchase the product and the reward earned for the purchase of the product.

TypeConditionRequireDefaultLimitationDescription
namestring~ 128 charsProduct Name
metadatastring~ 2048 charsmetadata
verifyActionsList<VerifyAction>~ 10 itemsList of Verify Action
consumeActionsList<ConsumeAction>~ 10 itemsList of Consumption Action
acquireActionsList<AcquireAction>1 ~ 100 itemsList of Acquire Action

SalesItemGroup

Product Group

A product group is an entity for display on a showcase. The first product that is determined to be available for purchase is actually displayed on the shelves. This can be used for products that are discounted only for the first time, or for a system in which the contents of products change depending on the number of times they are purchased, such as a step-up gacha.

TypeConditionRequireDefaultLimitationDescription
namestring~ 128 charsProduct Group Name
metadatastring~ 2048 charsmetadata
salesItemsList<SalesItem>2 ~ 10 itemsProducts to be included in the product group

Showcase

Showcase

The sales period can be set for the display shelf.

TypeConditionRequireDefaultLimitationDescription
showcaseIdstring~ 1024 charsShowcase GRN
namestring~ 128 charsShowcase Name
metadatastring~ 2048 charsmetadata
salesPeriodEventIdstring~ 1024 charsGS2-Schedule events with sales periods for display shelves
displayItemsList<DisplayItem>1 ~ 1000 itemsList of Products on display

DisplayItem

Displayed Item

TypeConditionRequireDefaultLimitationDescription
displayItemIdstringUUID~ 128 charsDisplayed Item ID
typeenum {
    “salesItem”,
    “salesItemGroup”
}
~ 128 charsType
salesItemSalesItem{type} == “salesItem”Products to be displayed
salesItemGroupSalesItemGroup{type} == “salesItemGroup”Product group to be displayed
salesPeriodEventIdstring~ 1024 charsGS2-Schedule events with product sales periods

Enumeration type definition to specify as type

Enumerator String DefinitionDescription
salesItemProduct
salesItemGroupProduct Group

DisplayItemMaster

Displayed Item Master Data

TypeConditionRequireDefaultLimitationDescription
displayItemIdstringUUID~ 128 charsDisplayed Item ID
typeenum {
    “salesItem”,
    “salesItemGroup”
}
~ 128 charsType
salesItemNamestring{type} == “salesItem”~ 128 charsName of the product to be displayed
salesItemGroupNamestring{type} == “salesItemGroup”~ 128 charsName of the product group to be displayed
salesPeriodEventIdstring~ 1024 charsProduct group to be displayed
revisionlong0~ 9223372036854775805Revision

Enumeration type definition to specify as type

Enumerator String DefinitionDescription
salesItemProduct
salesItemGroupProduct Group

RandomShowcaseMaster

Random Showcase Model Master

A display shelf where randomly selected products are displayed at specified intervals.

The products to be selected are randomly selected from the registered products in the product pool according to the specified quantity and the weight set for each product. By associating an event of GS2-Schedule with the random display shelf, you can set the sales period.

TypeConditionRequireDefaultLimitationDescription
showcaseIdstring~ 1024 charsRandom Showcase Model Master GRN
namestring~ 128 charsRandom Showcase Model Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
maximumNumberOfChoiceint1 ~ 100Maximum number of products to be selected
displayItemsList<RandomDisplayItemModel>1 ~ 100 itemsList of Products on display
baseTimestamplongBase time for re-drawing the products on display (Unix time unit:milliseconds)
resetIntervalHoursint1 ~ 168Interval (hours) between re-drawing the products on display
salesPeriodEventIdstring~ 1024 charsGS2-Schedule events with sales periods for display shelves
createdAtlongNowDatetime of creation (Unix time unit:milliseconds)
updatedAtlongNowDatetime of last update (Unix time unit:milliseconds)
revisionlong0~ 9223372036854775805Revision

RandomShowcase

Random Showcase

A display shelf where randomly selected products are displayed at specified intervals.

The products to be selected are randomly selected from the registered products in the product pool according to the specified quantity and the weight set for each product. By associating an event of GS2-Schedule with the random display shelf, you can set the sales period.

TypeConditionRequireDefaultLimitationDescription
randomShowcaseIdstring~ 1024 charsRandom Showcase Model GRN
namestring~ 128 charsRandom Showcase Name
metadatastring~ 2048 charsmetadata
maximumNumberOfChoiceint1 ~ 100Maximum number of products to be selected
displayItemsList<RandomDisplayItemModel>1 ~ 100 itemsList of Products on display
baseTimestamplongBase time for re-drawing the products on display (Unix time unit:milliseconds)
resetIntervalHoursint1 ~ 168Interval (hours) between re-drawing the products on display
salesPeriodEventIdstring~ 1024 charsGS2-Schedule events with sales periods for display shelves

PurchaseCount

Number of product purchases

TypeConditionRequireDefaultLimitationDescription
namestring~ 128 charsRandom Displayed Item Name
countint1 ~ 2147483646Purchase count

RandomDisplayItem

Random displayable items on the Random Showcase

TypeConditionRequireDefaultLimitationDescription
showcaseNamestring~ 128 charsRandom Displayed Item Name
namestringUUID~ 128 charsRandom Displayed Item ID
metadatastring~ 2048 charsmetadata
verifyActionsList<VerifyAction>~ 10 itemsList of Verify Action
consumeActionsList<ConsumeAction>~ 10 itemsList of Consume Action
acquireActionsList<AcquireAction>1 ~ 100 itemsList of Acquire Action
currentPurchaseCountint1 ~ 2147483646Current purchase count
maximumPurchaseCountint1 ~ 2147483646Maximum purchase count

RandomDisplayItemModel

Random displayable items on the Random Showcase

You can set the probability of selecting items for the display shelf.

TypeConditionRequireDefaultLimitationDescription
namestringUUID~ 128 charsRandom Displayed Item ID
metadatastring~ 2048 charsmetadata
verifyActionsList<VerifyAction>~ 10 itemsList of Verify Action
consumeActionsList<ConsumeAction>~ 10 itemsList of Consumption Action
acquireActionsList<AcquireAction>1 ~ 100 itemsList of Acquire Action
stockint1 ~ 2147483646Stock
weightint1 ~ 2147483646Emission Weight

ConsumeAction

Consume Action

TypeConditionRequireDefaultLimitationDescription
actionenum {
"Gs2AdReward:ConsumePointByUserId",
"Gs2Dictionary:DeleteEntriesByUserId",
"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:IfExpressionByUserId",
"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",
"Gs2Matchmaking:VerifyIncludeParticipantByUserId",
"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

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

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

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

TransactionSetting

Transaction settings

TypeConditionRequireDefaultLimitationDescription
enableAutoRunboolfalseAutomatically run issued transactions on the server side, or
distributorNamespaceIdstring“grn:gs2:{region}:{ownerId}:distributor:default”~ 1024 charsGS2-Distributor namespace GRN used for transaction execution
queueNamespaceIdstring“grn:gs2:{region}:{ownerId}:queue:default”~ 1024 charsNamespace GRN in GS2-JobQueue used to run the transaction

ScriptSetting

Script settings

In GS2, you can associate custom scripts with microservice events and execute them. This model holds the settings for triggering script execution.

There are two main ways to execute a script: synchronous execution and asynchronous execution. Synchronous execution blocks processing until the script has finished executing. Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API.

On the other hand, asynchronous execution does not block processing until the script has finished executing. Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API. However, asynchronous execution does not block processing until the script has finished executing, so it is generally recommended to use asynchronous execution.

There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge. By using Amazon EventBridge, you can write processing in languages other than Lua.

TypeConditionRequireDefaultLimitationDescription
triggerScriptIdstring~ 1024 charsScript GRN
doneTriggerTargetTypeenum {
    “none”,
    “gs2_script”,
    “aws”
}
“none”~ 128 charsNotification of Completion
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsScript GRN
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsNamespace GRN

Enumeration type definition to specify as doneTriggerTargetType

Enumerator String DefinitionDescription
noneNone
gs2_scriptGS2-Script
awsAmazon EventBridge

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/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &showcase.DescribeNamespacesRequest {
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DescribeNamespacesRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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
transactionSettingTransactionSettingTransaction settings
buyScriptScriptSettingScript to run when attempting to execute a purchase
queueNamespaceIdstring~ 1024 charsNamespace GRN in GS2-JobQueue used to run the transaction
keyIdstring~ 1024 charsGS2-Key namespace used to issue transactions
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceNamespace created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &showcase.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        TransactionSetting: &showcase.TransactionSetting{
            EnableAutoRun: pointy.Bool(false),
            QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"),
            KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"),
        },
        BuyScript: nil,
        LogSetting: &showcase.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName(self::namespace1)
            ->withDescription(null)
            ->withTransactionSetting((new \Gs2\Showcase\Model\TransactionSetting())
                ->withEnableAutoRun(False)
                ->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
                ->withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:\namespace1:key:key-0001"))
            ->withBuyScript(null)
            ->withLogSetting((new \Gs2\Showcase\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.CreateNamespaceRequest;
import io.gs2.showcase.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withTransactionSetting(new io.gs2.showcase.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
                .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
            .withBuyScript(null)
            .withLogSetting(new io.gs2.showcase.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.CreateNamespaceRequest;
using Gs2.Gs2Showcase.Result.CreateNamespaceResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Showcase.Request.CreateNamespaceRequest()
        .WithName("namespace1")
        .WithDescription(null)
        .WithTransactionSetting(new Gs2.Gs2Showcase.Model.TransactionSetting()
            .WithEnableAutoRun(false)
            .WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
            .WithKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
        .WithBuyScript(null)
        .WithLogSetting(new Gs2.Gs2Showcase.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.createNamespace(
        new Gs2Showcase.CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withTransactionSetting(new Gs2Showcase.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
                .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
            .withBuyScript(null)
            .withLogSetting(new Gs2Showcase.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

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

api_result = client.create_namespace({
    name="namespace1",
    description=nil,
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
        keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001",
    },
    buyScript=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('showcase')

api_result_handler = client.create_namespace_async({
    name="namespace1",
    description=nil,
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
        keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001",
    },
    buyScript=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/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &showcase.GetNamespaceStatusRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetNamespaceStatusRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &showcase.GetNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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
transactionSettingTransactionSettingTransaction settings
buyScriptScriptSettingScript to run when attempting to execute a purchase
logSettingLogSettingLog output settings
queueNamespaceIdstring~ 1024 charsNamespace GRN in GS2-JobQueue used to run the transaction
keyIdstring~ 1024 charsGS2-Key namespace used to issue transactions

Result

TypeDescription
itemNamespaceUpdated namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &showcase.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        TransactionSetting: &showcase.TransactionSetting{
            EnableAutoRun: pointy.Bool(false),
            QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"),
            KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"),
        },
        BuyScript: nil,
        LogSetting: &showcase.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName(self::namespace1)
            ->withDescription("description1")
            ->withTransactionSetting((new \Gs2\Showcase\Model\TransactionSetting())
                ->withEnableAutoRun(False)
                ->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
                ->withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:\namespace1:key:key-0002"))
            ->withBuyScript(null)
            ->withLogSetting((new \Gs2\Showcase\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.UpdateNamespaceRequest;
import io.gs2.showcase.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withTransactionSetting(new io.gs2.showcase.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
                .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
            .withBuyScript(null)
            .withLogSetting(new io.gs2.showcase.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.UpdateNamespaceRequest;
using Gs2.Gs2Showcase.Result.UpdateNamespaceResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Showcase.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace1")
        .WithDescription("description1")
        .WithTransactionSetting(new Gs2.Gs2Showcase.Model.TransactionSetting()
            .WithEnableAutoRun(false)
            .WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
            .WithKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
        .WithBuyScript(null)
        .WithLogSetting(new Gs2.Gs2Showcase.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.updateNamespace(
        new Gs2Showcase.UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withTransactionSetting(new Gs2Showcase.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
                .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
            .withBuyScript(null)
            .withLogSetting(new Gs2Showcase.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

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

api_result = client.update_namespace({
    namespaceName="namespace1",
    description="description1",
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002",
        keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002",
    },
    buyScript=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('showcase')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace1",
    description="description1",
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002",
        keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002",
    },
    buyScript=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;

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/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &showcase.DeleteNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DeleteNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

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

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

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

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

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

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

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

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

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;

dumpUserDataByUserId

Get dump data of the data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &showcase.DumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->dumpUserDataByUserId(
        (new DumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DumpUserDataByUserIdRequest;
import io.gs2.showcase.result.DumpUserDataByUserIdResult;

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

try {
    DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
        new DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Showcase.Result.DumpUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Showcase.Request.DumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.dumpUserDataByUserId(
        new Gs2Showcase.DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.dump_user_data_by_user_id(
        showcase.DumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

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

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

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

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

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

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

result = api_result.result

checkDumpUserDataByUserId

Check if the dump of the data associated with the specified user ID is complete

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL of output data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &showcase.CheckDumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\CheckDumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkDumpUserDataByUserId(
        (new CheckDumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.showcase.result.CheckDumpUserDataByUserIdResult;

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

try {
    CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
        new CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Showcase.Result.CheckDumpUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Showcase.Request.CheckDumpUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.checkDumpUserDataByUserId(
        new Gs2Showcase.CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.check_dump_user_data_by_user_id(
        showcase.CheckDumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

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

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

result = api_result.result
url = result.url;
client = gs2('showcase')

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

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

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

result = api_result.result
url = result.url;

cleanUserDataByUserId

Get clean data of the data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &showcase.CleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\CleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->cleanUserDataByUserId(
        (new CleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.CleanUserDataByUserIdRequest;
import io.gs2.showcase.result.CleanUserDataByUserIdResult;

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

try {
    CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
        new CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Showcase.Result.CleanUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Showcase.Request.CleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.cleanUserDataByUserId(
        new Gs2Showcase.CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.clean_user_data_by_user_id(
        showcase.CleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

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

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

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

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

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

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

result = api_result.result

checkCleanUserDataByUserId

Check if the clean of the data associated with the specified user ID is complete

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &showcase.CheckCleanUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\CheckCleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkCleanUserDataByUserId(
        (new CheckCleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.showcase.result.CheckCleanUserDataByUserIdResult;

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

try {
    CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
        new CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Showcase.Result.CheckCleanUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Showcase.Request.CheckCleanUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.checkCleanUserDataByUserId(
        new Gs2Showcase.CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.check_clean_user_data_by_user_id(
        showcase.CheckCleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

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

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

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

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

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

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

result = api_result.result

prepareImportUserDataByUserId

Start importing data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
uploadTokenstringToken used to reflect results after upload
uploadUrlstringURL used to upload user data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &showcase.PrepareImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\PrepareImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareImportUserDataByUserId(
        (new PrepareImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $uploadToken = $result->getUploadToken();
    $uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.showcase.result.PrepareImportUserDataByUserIdResult;

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

try {
    PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
        new PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Showcase.Result.PrepareImportUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Showcase.Request.PrepareImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.prepareImportUserDataByUserId(
        new Gs2Showcase.PrepareImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.prepare_import_user_data_by_user_id(
        showcase.PrepareImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

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

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

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('showcase')

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

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

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

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

importUserDataByUserId

Start importing data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
uploadTokenstring~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &showcase.ImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\ImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->importUserDataByUserId(
        (new ImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.ImportUserDataByUserIdRequest;
import io.gs2.showcase.result.ImportUserDataByUserIdResult;

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

try {
    ImportUserDataByUserIdResult result = client.importUserDataByUserId(
        new ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Showcase.Result.ImportUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2Showcase.Request.ImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.importUserDataByUserId(
        new Gs2Showcase.ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.import_user_data_by_user_id(
        showcase.ImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result

checkImportUserDataByUserId

Check if the import of the data associated with the specified user ID is complete

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
uploadTokenstring~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL of log data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &showcase.CheckImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\CheckImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkImportUserDataByUserId(
        (new CheckImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
            ->withTimeOffsetToken(null)
    );
    $url = $result->getUrl();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.CheckImportUserDataByUserIdRequest;
import io.gs2.showcase.result.CheckImportUserDataByUserIdResult;

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

try {
    CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
        new CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Showcase.Result.CheckImportUserDataByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2Showcase.Request.CheckImportUserDataByUserIdRequest()
        .WithUserId("user-0001")
        .WithUploadToken("upload-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.checkImportUserDataByUserId(
        new Gs2Showcase.CheckImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.check_import_user_data_by_user_id(
        showcase.CheckImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_upload_token('upload-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.check_import_user_data_by_user_id({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
url = result.url;
client = gs2('showcase')

api_result_handler = client.check_import_user_data_by_user_id_async({
    userId="user-0001",
    uploadToken="upload-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
url = result.url;

describeSalesItemMasters

Obtain list of product 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<SalesItemMaster>List of Product 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/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DescribeSalesItemMasters(
    &showcase.DescribeSalesItemMastersRequest {
        NamespaceName: pointy.String("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DescribeSalesItemMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeSalesItemMastersResult result = client.describeSalesItemMasters(
        new DescribeSalesItemMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SalesItemMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DescribeSalesItemMastersRequest;
using Gs2.Gs2Showcase.Result.DescribeSalesItemMastersResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.DescribeSalesItemMastersResult> asyncResult = null;
yield return client.DescribeSalesItemMasters(
    new Gs2.Gs2Showcase.Request.DescribeSalesItemMastersRequest()
        .WithNamespaceName("namespace1")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.describe_sales_item_masters({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

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

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

api_result_handler = client.describe_sales_item_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;

createSalesItemMaster

Create a new product master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
namestring~ 128 charsProduct Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
verifyActionsList<VerifyAction>~ 10 itemsList of Verify Action
consumeActionsList<ConsumeAction>~ 10 itemsList of Consumption Action
acquireActionsList<AcquireAction>1 ~ 100 itemsList of Acquire Action

Result

TypeDescription
itemSalesItemMasterCreated product master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.CreateSalesItemMaster(
    &showcase.CreateSalesItemMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("sales-item-0001"),
        Description: nil,
        Metadata: nil,
        VerifyActions: nil,
        ConsumeActions: []showcase.ConsumeAction{
            showcase.ConsumeAction{
                Action: pointy.String("Gs2Money:WithdrawByUserId"),
                Request: pointy.String("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
            },
        },
        AcquireActions: []showcase.AcquireAction{
            showcase.AcquireAction{
                Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
                Request: pointy.String("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\CreateSalesItemMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createSalesItemMaster(
        (new CreateSalesItemMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("sales-item-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withVerifyActions(null)
            ->withConsumeActions([
                (new \Gs2\Showcase\Model\ConsumeAction())
                    ->withAction("Gs2Money:WithdrawByUserId")
                    ->withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
            ])
            ->withAcquireActions([
                (new \Gs2\Showcase\Model\AcquireAction())
                    ->withAction("Gs2Stamina:RecoverStaminaByUserId")
                    ->withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
            ])
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.CreateSalesItemMasterRequest;
import io.gs2.showcase.result.CreateSalesItemMasterResult;

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

try {
    CreateSalesItemMasterResult result = client.createSalesItemMaster(
        new CreateSalesItemMasterRequest()
            .withNamespaceName("namespace1")
            .withName("sales-item-0001")
            .withDescription(null)
            .withMetadata(null)
            .withVerifyActions(null)
            .withConsumeActions(Arrays.asList(
                new io.gs2.showcase.model.ConsumeAction()
                    .withAction("Gs2Money:WithdrawByUserId")
                    .withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
            ))
            .withAcquireActions(Arrays.asList(
                new io.gs2.showcase.model.AcquireAction()
                    .withAction("Gs2Stamina:RecoverStaminaByUserId")
                    .withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
            ))
    );
    SalesItemMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.CreateSalesItemMasterRequest;
using Gs2.Gs2Showcase.Result.CreateSalesItemMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.CreateSalesItemMasterResult> asyncResult = null;
yield return client.CreateSalesItemMaster(
    new Gs2.Gs2Showcase.Request.CreateSalesItemMasterRequest()
        .WithNamespaceName("namespace1")
        .WithName("sales-item-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithVerifyActions(null)
        .WithConsumeActions(new Gs2.Core.Model.ConsumeAction[] {
            new Gs2.Core.Model.ConsumeAction()
                .WithAction("Gs2Money:WithdrawByUserId")
                .WithRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
        })
        .WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
            new Gs2.Core.Model.AcquireAction()
                .WithAction("Gs2Stamina:RecoverStaminaByUserId")
                .WithRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

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

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

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

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

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;

getSalesItemMaster

Get Product Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
salesItemNamestring~ 128 charsProduct Name

Result

TypeDescription
itemSalesItemMasterProduct Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetSalesItemMaster(
    &showcase.GetSalesItemMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SalesItemName: pointy.String("sales-item-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetSalesItemMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSalesItemMaster(
        (new GetSalesItemMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSalesItemName("sales-item-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetSalesItemMasterRequest;
import io.gs2.showcase.result.GetSalesItemMasterResult;

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

try {
    GetSalesItemMasterResult result = client.getSalesItemMaster(
        new GetSalesItemMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemName("sales-item-0001")
    );
    SalesItemMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetSalesItemMasterRequest;
using Gs2.Gs2Showcase.Result.GetSalesItemMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.GetSalesItemMasterResult> asyncResult = null;
yield return client.GetSalesItemMaster(
    new Gs2.Gs2Showcase.Request.GetSalesItemMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSalesItemName("sales-item-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.get_sales_item_master({
    namespaceName="namespace1",
    salesItemName="sales-item-0001",
})

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

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

api_result_handler = client.get_sales_item_master_async({
    namespaceName="namespace1",
    salesItemName="sales-item-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;

updateSalesItemMaster

Update Product Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
salesItemNamestring~ 128 charsProduct Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
verifyActionsList<VerifyAction>~ 10 itemsList of Verify Action
consumeActionsList<ConsumeAction>~ 10 itemsList of Consumption Action
acquireActionsList<AcquireAction>1 ~ 100 itemsList of Acquire Action

Result

TypeDescription
itemSalesItemMasterUpdated Product Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.UpdateSalesItemMaster(
    &showcase.UpdateSalesItemMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SalesItemName: pointy.String("sales-item-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("SALES_ITEM_0001"),
        VerifyActions: nil,
        ConsumeActions: []showcase.ConsumeAction{
            showcase.ConsumeAction{
                Action: pointy.String("Gs2Money:WithdrawByUserId"),
                Request: pointy.String("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}"),
            },
        },
        AcquireActions: []showcase.AcquireAction{
            showcase.AcquireAction{
                Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
                Request: pointy.String("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}"),
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\UpdateSalesItemMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateSalesItemMaster(
        (new UpdateSalesItemMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSalesItemName("sales-item-0001")
            ->withDescription("description1")
            ->withMetadata("SALES_ITEM_0001")
            ->withVerifyActions(null)
            ->withConsumeActions([
                (new \Gs2\Showcase\Model\ConsumeAction())
                    ->withAction("Gs2Money:WithdrawByUserId")
                    ->withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}"),
            ])
            ->withAcquireActions([
                (new \Gs2\Showcase\Model\AcquireAction())
                    ->withAction("Gs2Stamina:RecoverStaminaByUserId")
                    ->withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}"),
            ])
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.UpdateSalesItemMasterRequest;
import io.gs2.showcase.result.UpdateSalesItemMasterResult;

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

try {
    UpdateSalesItemMasterResult result = client.updateSalesItemMaster(
        new UpdateSalesItemMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemName("sales-item-0001")
            .withDescription("description1")
            .withMetadata("SALES_ITEM_0001")
            .withVerifyActions(null)
            .withConsumeActions(Arrays.asList(
                new io.gs2.showcase.model.ConsumeAction()
                    .withAction("Gs2Money:WithdrawByUserId")
                    .withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}")
            ))
            .withAcquireActions(Arrays.asList(
                new io.gs2.showcase.model.AcquireAction()
                    .withAction("Gs2Stamina:RecoverStaminaByUserId")
                    .withRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}")
            ))
    );
    SalesItemMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.UpdateSalesItemMasterRequest;
using Gs2.Gs2Showcase.Result.UpdateSalesItemMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.UpdateSalesItemMasterResult> asyncResult = null;
yield return client.UpdateSalesItemMaster(
    new Gs2.Gs2Showcase.Request.UpdateSalesItemMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSalesItemName("sales-item-0001")
        .WithDescription("description1")
        .WithMetadata("SALES_ITEM_0001")
        .WithVerifyActions(null)
        .WithConsumeActions(new Gs2.Core.Model.ConsumeAction[] {
            new Gs2.Core.Model.ConsumeAction()
                .WithAction("Gs2Money:WithdrawByUserId")
                .WithRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}"),
        })
        .WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
            new Gs2.Core.Model.AcquireAction()
                .WithAction("Gs2Stamina:RecoverStaminaByUserId")
                .WithRequest("{\"moneyName\": \"money-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}"),
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

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

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

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

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

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;

deleteSalesItemMaster

Delete Product Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
salesItemNamestring~ 128 charsProduct Name

Result

TypeDescription
itemSalesItemMasterDeleted Product Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DeleteSalesItemMaster(
    &showcase.DeleteSalesItemMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SalesItemName: pointy.String("sales-item-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DeleteSalesItemMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteSalesItemMaster(
        (new DeleteSalesItemMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSalesItemName("sales-item-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DeleteSalesItemMasterRequest;
import io.gs2.showcase.result.DeleteSalesItemMasterResult;

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

try {
    DeleteSalesItemMasterResult result = client.deleteSalesItemMaster(
        new DeleteSalesItemMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemName("sales-item-0001")
    );
    SalesItemMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DeleteSalesItemMasterRequest;
using Gs2.Gs2Showcase.Result.DeleteSalesItemMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.DeleteSalesItemMasterResult> asyncResult = null;
yield return client.DeleteSalesItemMaster(
    new Gs2.Gs2Showcase.Request.DeleteSalesItemMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSalesItemName("sales-item-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.delete_sales_item_master({
    namespaceName="namespace1",
    salesItemName="sales-item-0001",
})

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

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

api_result_handler = client.delete_sales_item_master_async({
    namespaceName="namespace1",
    salesItemName="sales-item-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;

describeSalesItemGroupMasters

Obtain list of product group 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<SalesItemGroupMaster>List of Product Group Master
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/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DescribeSalesItemGroupMasters(
    &showcase.DescribeSalesItemGroupMastersRequest {
        NamespaceName: pointy.String("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DescribeSalesItemGroupMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeSalesItemGroupMastersResult result = client.describeSalesItemGroupMasters(
        new DescribeSalesItemGroupMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SalesItemGroupMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DescribeSalesItemGroupMastersRequest;
using Gs2.Gs2Showcase.Result.DescribeSalesItemGroupMastersResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.DescribeSalesItemGroupMastersResult> asyncResult = null;
yield return client.DescribeSalesItemGroupMasters(
    new Gs2.Gs2Showcase.Request.DescribeSalesItemGroupMastersRequest()
        .WithNamespaceName("namespace1")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.describe_sales_item_group_masters({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

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

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

api_result_handler = client.describe_sales_item_group_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;

createSalesItemGroupMaster

Create a new product group master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
namestring~ 128 charsProduct Group Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
salesItemNamesList<string>2 ~ 10 itemsList of products to be included in the product group

Result

TypeDescription
itemSalesItemGroupMasterCreated product group master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.CreateSalesItemGroupMaster(
    &showcase.CreateSalesItemGroupMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("sales-item-group-0001"),
        Description: nil,
        Metadata: nil,
        SalesItemNames: []*string{
            pointy.String("salesItem-0001"),
            pointy.String("salesItem-0002"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\CreateSalesItemGroupMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createSalesItemGroupMaster(
        (new CreateSalesItemGroupMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("sales-item-group-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withSalesItemNames([
                self::salesItem-0001,
                self::salesItem-0002,
            ])
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.CreateSalesItemGroupMasterRequest;
import io.gs2.showcase.result.CreateSalesItemGroupMasterResult;

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

try {
    CreateSalesItemGroupMasterResult result = client.createSalesItemGroupMaster(
        new CreateSalesItemGroupMasterRequest()
            .withNamespaceName("namespace1")
            .withName("sales-item-group-0001")
            .withDescription(null)
            .withMetadata(null)
            .withSalesItemNames(Arrays.asList(
                "salesItem-0001",
                "salesItem-0002"
            ))
    );
    SalesItemGroupMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.CreateSalesItemGroupMasterRequest;
using Gs2.Gs2Showcase.Result.CreateSalesItemGroupMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.CreateSalesItemGroupMasterResult> asyncResult = null;
yield return client.CreateSalesItemGroupMaster(
    new Gs2.Gs2Showcase.Request.CreateSalesItemGroupMasterRequest()
        .WithNamespaceName("namespace1")
        .WithName("sales-item-group-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithSalesItemNames(new string[] {
            "salesItem-0001",
            "salesItem-0002",
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.create_sales_item_group_master({
    namespaceName="namespace1",
    name="sales-item-group-0001",
    description=nil,
    metadata=nil,
    salesItemNames={
        "salesItem-0001",
        "salesItem-0002"
    },
})

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('showcase')

api_result_handler = client.create_sales_item_group_master_async({
    namespaceName="namespace1",
    name="sales-item-group-0001",
    description=nil,
    metadata=nil,
    salesItemNames={
        "salesItem-0001",
        "salesItem-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
item = result.item;

getSalesItemGroupMaster

Get product group master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
salesItemGroupNamestring~ 128 charsProduct Group Name

Result

TypeDescription
itemSalesItemGroupMasterProduct Group Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetSalesItemGroupMaster(
    &showcase.GetSalesItemGroupMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SalesItemGroupName: pointy.String("sales-item-group-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetSalesItemGroupMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getSalesItemGroupMaster(
        (new GetSalesItemGroupMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSalesItemGroupName("sales-item-group-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetSalesItemGroupMasterRequest;
import io.gs2.showcase.result.GetSalesItemGroupMasterResult;

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

try {
    GetSalesItemGroupMasterResult result = client.getSalesItemGroupMaster(
        new GetSalesItemGroupMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemGroupName("sales-item-group-0001")
    );
    SalesItemGroupMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetSalesItemGroupMasterRequest;
using Gs2.Gs2Showcase.Result.GetSalesItemGroupMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.GetSalesItemGroupMasterResult> asyncResult = null;
yield return client.GetSalesItemGroupMaster(
    new Gs2.Gs2Showcase.Request.GetSalesItemGroupMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSalesItemGroupName("sales-item-group-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.get_sales_item_group_master({
    namespaceName="namespace1",
    salesItemGroupName="sales-item-group-0001",
})

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

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

api_result_handler = client.get_sales_item_group_master_async({
    namespaceName="namespace1",
    salesItemGroupName="sales-item-group-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;

updateSalesItemGroupMaster

Update commodity group master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
salesItemGroupNamestring~ 128 charsProduct Group Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
salesItemNamesList<string>2 ~ 10 itemsList of products to be included in the product group

Result

TypeDescription
itemSalesItemGroupMasterUpdated commodity group master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.UpdateSalesItemGroupMaster(
    &showcase.UpdateSalesItemGroupMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SalesItemGroupName: pointy.String("sales-item-group-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("SALES_ITEM_GROUP_0001"),
        SalesItemNames: []*string{
            pointy.String("salesItem-0001"),
            pointy.String("salesItem-0002"),
            pointy.String("salesItem-0003"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\UpdateSalesItemGroupMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateSalesItemGroupMaster(
        (new UpdateSalesItemGroupMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSalesItemGroupName("sales-item-group-0001")
            ->withDescription("description1")
            ->withMetadata("SALES_ITEM_GROUP_0001")
            ->withSalesItemNames([
                self::salesItem-0001,
                self::salesItem-0002,
                self::salesItem-0003,
            ])
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.UpdateSalesItemGroupMasterRequest;
import io.gs2.showcase.result.UpdateSalesItemGroupMasterResult;

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

try {
    UpdateSalesItemGroupMasterResult result = client.updateSalesItemGroupMaster(
        new UpdateSalesItemGroupMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemGroupName("sales-item-group-0001")
            .withDescription("description1")
            .withMetadata("SALES_ITEM_GROUP_0001")
            .withSalesItemNames(Arrays.asList(
                "salesItem-0001",
                "salesItem-0002",
                "salesItem-0003"
            ))
    );
    SalesItemGroupMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.UpdateSalesItemGroupMasterRequest;
using Gs2.Gs2Showcase.Result.UpdateSalesItemGroupMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.UpdateSalesItemGroupMasterResult> asyncResult = null;
yield return client.UpdateSalesItemGroupMaster(
    new Gs2.Gs2Showcase.Request.UpdateSalesItemGroupMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSalesItemGroupName("sales-item-group-0001")
        .WithDescription("description1")
        .WithMetadata("SALES_ITEM_GROUP_0001")
        .WithSalesItemNames(new string[] {
            "salesItem-0001",
            "salesItem-0002",
            "salesItem-0003",
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.update_sales_item_group_master({
    namespaceName="namespace1",
    salesItemGroupName="sales-item-group-0001",
    description="description1",
    metadata="SALES_ITEM_GROUP_0001",
    salesItemNames={
        "salesItem-0001",
        "salesItem-0002",
        "salesItem-0003"
    },
})

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('showcase')

api_result_handler = client.update_sales_item_group_master_async({
    namespaceName="namespace1",
    salesItemGroupName="sales-item-group-0001",
    description="description1",
    metadata="SALES_ITEM_GROUP_0001",
    salesItemNames={
        "salesItem-0001",
        "salesItem-0002",
        "salesItem-0003"
    },
})

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;

deleteSalesItemGroupMaster

Delete Product Group Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
salesItemGroupNamestring~ 128 charsProduct Group Name

Result

TypeDescription
itemSalesItemGroupMasterDeleted Product Group Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DeleteSalesItemGroupMaster(
    &showcase.DeleteSalesItemGroupMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        SalesItemGroupName: pointy.String("sales-item-group-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DeleteSalesItemGroupMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteSalesItemGroupMaster(
        (new DeleteSalesItemGroupMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSalesItemGroupName("sales-item-group-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DeleteSalesItemGroupMasterRequest;
import io.gs2.showcase.result.DeleteSalesItemGroupMasterResult;

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

try {
    DeleteSalesItemGroupMasterResult result = client.deleteSalesItemGroupMaster(
        new DeleteSalesItemGroupMasterRequest()
            .withNamespaceName("namespace1")
            .withSalesItemGroupName("sales-item-group-0001")
    );
    SalesItemGroupMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DeleteSalesItemGroupMasterRequest;
using Gs2.Gs2Showcase.Result.DeleteSalesItemGroupMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.DeleteSalesItemGroupMasterResult> asyncResult = null;
yield return client.DeleteSalesItemGroupMaster(
    new Gs2.Gs2Showcase.Request.DeleteSalesItemGroupMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSalesItemGroupName("sales-item-group-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.delete_sales_item_group_master({
    namespaceName="namespace1",
    salesItemGroupName="sales-item-group-0001",
})

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

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

api_result_handler = client.delete_sales_item_group_master_async({
    namespaceName="namespace1",
    salesItemGroupName="sales-item-group-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;

describeShowcaseMasters

Get list of showcase 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<ShowcaseMaster>List of Showcase 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/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DescribeShowcaseMasters(
    &showcase.DescribeShowcaseMastersRequest {
        NamespaceName: pointy.String("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DescribeShowcaseMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeShowcaseMastersResult result = client.describeShowcaseMasters(
        new DescribeShowcaseMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<ShowcaseMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DescribeShowcaseMastersRequest;
using Gs2.Gs2Showcase.Result.DescribeShowcaseMastersResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.DescribeShowcaseMastersResult> asyncResult = null;
yield return client.DescribeShowcaseMasters(
    new Gs2.Gs2Showcase.Request.DescribeShowcaseMastersRequest()
        .WithNamespaceName("namespace1")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.describe_showcase_masters({
    namespaceName="namespace1",
    pageToken=nil,
    limit=nil,
})

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

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

api_result_handler = client.describe_showcase_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;

createShowcaseMaster

Create a new showcase master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
namestring~ 128 charsShowcase Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
displayItemsList<DisplayItemMaster>1 ~ 1000 itemsList of Products on display
salesPeriodEventIdstring~ 1024 charsGS2-Schedule events with sales periods for display shelves

Result

TypeDescription
itemShowcaseMasterCreated showcase master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.CreateShowcaseMaster(
    &showcase.CreateShowcaseMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("showcase-0001"),
        Description: nil,
        Metadata: nil,
        DisplayItems: []showcase.DisplayItemMaster{
            showcase.DisplayItemMaster{
                Type: pointy.String("salesItem"),
                SalesItemName: pointy.String("salesItem-0001"),
            },
            showcase.DisplayItemMaster{
                Type: pointy.String("salesItemGroup"),
                SalesItemGroupName: pointy.String("$salesItemGroup1.name"),
                SalesPeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001"),
            },
        },
        SalesPeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\CreateShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    CreateShowcaseMasterResult result = client.createShowcaseMaster(
        new CreateShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withName("showcase-0001")
            .withDescription(null)
            .withMetadata(null)
            .withDisplayItems(Arrays.asList(
                new io.gs2.showcase.model.DisplayItemMaster()
                    .withType("salesItem")
                    .withSalesItemName("salesItem-0001"),
                new io.gs2.showcase.model.DisplayItemMaster()
                    .withType("salesItemGroup")
                    .withSalesItemGroupName("$salesItemGroup1.name")
                    .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
            ))
            .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
    );
    ShowcaseMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.CreateShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.CreateShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.CreateShowcaseMasterResult> asyncResult = null;
yield return client.CreateShowcaseMaster(
    new Gs2.Gs2Showcase.Request.CreateShowcaseMasterRequest()
        .WithNamespaceName("namespace1")
        .WithName("showcase-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithDisplayItems(new Gs2.Gs2Showcase.Model.DisplayItemMaster[] {
            new Gs2.Gs2Showcase.Model.DisplayItemMaster()
                .WithType("salesItem")
                .WithSalesItemName("salesItem-0001"),
            new Gs2.Gs2Showcase.Model.DisplayItemMaster()
                .WithType("salesItemGroup")
                .WithSalesItemGroupName("$salesItemGroup1.name")
                .WithSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001"),
        })
        .WithSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.create_showcase_master({
    namespaceName="namespace1",
    name="showcase-0001",
    description=nil,
    metadata=nil,
    displayItems={
        {
            type="salesItem",
            salesItemName="salesItem-0001",
        },
        {
            type="salesItemGroup",
            salesItemGroupName="$salesItemGroup1.name",
            salesPeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001",
        }
    },
    salesPeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001",
})

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

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

api_result_handler = client.create_showcase_master_async({
    namespaceName="namespace1",
    name="showcase-0001",
    description=nil,
    metadata=nil,
    displayItems={
        {
            type="salesItem",
            salesItemName="salesItem-0001",
        },
        {
            type="salesItemGroup",
            salesItemGroupName="$salesItemGroup1.name",
            salesPeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001",
        }
    },
    salesPeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001",
})

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;

getShowcaseMaster

Retrieve showcase master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsShowcase Name

Result

TypeDescription
itemShowcaseMasterShowcase master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetShowcaseMaster(
    &showcase.GetShowcaseMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getShowcaseMaster(
        (new GetShowcaseMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetShowcaseMasterRequest;
import io.gs2.showcase.result.GetShowcaseMasterResult;

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

try {
    GetShowcaseMasterResult result = client.getShowcaseMaster(
        new GetShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
    );
    ShowcaseMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.GetShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.GetShowcaseMasterResult> asyncResult = null;
yield return client.GetShowcaseMaster(
    new Gs2.Gs2Showcase.Request.GetShowcaseMasterRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.get_showcase_master({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
})

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

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

api_result_handler = client.get_showcase_master_async({
    namespaceName="namespace1",
    showcaseName="showcase-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;

updateShowcaseMaster

Update showcase master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsShowcase Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
displayItemsList<DisplayItemMaster>1 ~ 1000 itemsList of Products on display
salesPeriodEventIdstring~ 1024 charsGS2-Schedule events with sales periods for display shelves

Result

TypeDescription
itemShowcaseMasterUpdated showcase master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    UpdateShowcaseMasterResult result = client.updateShowcaseMaster(
        new UpdateShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDescription("description1")
            .withMetadata("SHOWCASE_0001")
            .withDisplayItems(Arrays.asList(
                new io.gs2.showcase.model.DisplayItemMaster()
                    .withType("salesItem")
                    .withSalesItemName("salesItem-0003"),
                new io.gs2.showcase.model.DisplayItemMaster()
                    .withType("salesItemGroup")
                    .withSalesItemGroupName("$salesItemGroup1.name")
                    .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
            ))
            .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002")
    );
    ShowcaseMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.UpdateShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.UpdateShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.UpdateShowcaseMasterResult> asyncResult = null;
yield return client.UpdateShowcaseMaster(
    new Gs2.Gs2Showcase.Request.UpdateShowcaseMasterRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithDescription("description1")
        .WithMetadata("SHOWCASE_0001")
        .WithDisplayItems(new Gs2.Gs2Showcase.Model.DisplayItemMaster[] {
            new Gs2.Gs2Showcase.Model.DisplayItemMaster()
                .WithType("salesItem")
                .WithSalesItemName("salesItem-0003"),
            new Gs2.Gs2Showcase.Model.DisplayItemMaster()
                .WithType("salesItemGroup")
                .WithSalesItemGroupName("$salesItemGroup1.name")
                .WithSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001"),
        })
        .WithSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

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

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

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

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

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;

deleteShowcaseMaster

Delete showcase master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsShowcase Name

Result

TypeDescription
itemShowcaseMasterDeleted showcase master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DeleteShowcaseMaster(
    &showcase.DeleteShowcaseMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DeleteShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteShowcaseMaster(
        (new DeleteShowcaseMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DeleteShowcaseMasterRequest;
import io.gs2.showcase.result.DeleteShowcaseMasterResult;

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

try {
    DeleteShowcaseMasterResult result = client.deleteShowcaseMaster(
        new DeleteShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
    );
    ShowcaseMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DeleteShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.DeleteShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.DeleteShowcaseMasterResult> asyncResult = null;
yield return client.DeleteShowcaseMaster(
    new Gs2.Gs2Showcase.Request.DeleteShowcaseMasterRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.delete_showcase_master({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
})

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

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

api_result_handler = client.delete_showcase_master_async({
    namespaceName="namespace1",
    showcaseName="showcase-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 the currently available showcase master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Result

TypeDescription
itemCurrentShowcaseMasterCurrently available showcase master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &showcase.ExportMasterRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\ExportMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->exportMaster(
        (new ExportMasterRequest())
            ->withNamespaceName(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.ExportMasterRequest;
import io.gs2.showcase.result.ExportMasterResult;

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

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentShowcaseMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.ExportMasterRequest;
using Gs2.Gs2Showcase.Result.ExportMasterResult;

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

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

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

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

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

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

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

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

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

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;

getCurrentShowcaseMaster

Get the currently available showcase master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Result

TypeDescription
itemCurrentShowcaseMasterCurrently available showcase master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetCurrentShowcaseMaster(
    &showcase.GetCurrentShowcaseMasterRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetCurrentShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCurrentShowcaseMaster(
        (new GetCurrentShowcaseMasterRequest())
            ->withNamespaceName(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetCurrentShowcaseMasterRequest;
import io.gs2.showcase.result.GetCurrentShowcaseMasterResult;

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

try {
    GetCurrentShowcaseMasterResult result = client.getCurrentShowcaseMaster(
        new GetCurrentShowcaseMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentShowcaseMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetCurrentShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.GetCurrentShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.GetCurrentShowcaseMasterResult> asyncResult = null;
yield return client.GetCurrentShowcaseMaster(
    new Gs2.Gs2Showcase.Request.GetCurrentShowcaseMasterRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.get_current_showcase_master({
    namespaceName="namespace1",
})

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

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

api_result_handler = client.get_current_showcase_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;

updateCurrentShowcaseMaster

Update the currently available showcase master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
settingsstring~ 5242880 charsMaster data

Result

TypeDescription
itemCurrentShowcaseMasterUpdated and currently available showcase master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentShowcaseMaster(
    &showcase.UpdateCurrentShowcaseMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Settings: pointy.String("{\n      \"version\": \"2019-04-04\",\n      \"showcases\": [\n        {\n          \"name\": \"gem\",\n          \"metadata\": \"GEM\",\n          \"displayItems\": [\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"gem_3000\",\n                \"metadata\": \"GEM_3000\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:InAppPurchase\",\n                    \"request\": \"Gs2Money:InAppPurchase:request\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Money:DepositByUserId\",\n                    \"request\": \"Gs2Money:DepositByUserId:request\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"salesItemGroup\",\n              \"salesPeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001\",\n              \"salesItemGroup\": {\n                \"name\": \"step_gem\",\n                \"metadata\": \"STEP_GEM\",\n                \"salesItems\": [\n                  {\n                    \"name\": \"step1_gem_1000\",\n                    \"metadata\": \"STEP1_GEM_1000\",\n                    \"consumeActions\": [\n                      {\n                        \"action\": \"Gs2Money:InAppPurchase\",\n                        \"request\": \"Gs2Money:InAppPurchase:request\"\n                      },\n                      {\n                        \"action\": \"Gs2Limit:CountUpByUserId\",\n                        \"request\": \"Gs2Limit:CountUpByUserId:request\"\n                      }\n                    ],\n                    \"acquireActions\": [\n                      {\n                        \"action\": \"Gs2Money:DepositByUserId\",\n                        \"request\": \"Gs2Money:DepositByUserId:request\"\n                      }\n                    ]\n                  },\n                  {\n                    \"name\": \"step2_gem_2000\",\n                    \"metadata\": \"STEP1_GEM_2000\",\n                    \"consumeActions\": [\n                      {\n                        \"action\": \"Gs2Money:InAppPurchase\",\n                        \"request\": \"Gs2Money:InAppPurchase:request\"\n                      },\n                      {\n                        \"action\": \"Gs2Limit:CountUpByUserId\",\n                        \"request\": \"Gs2Limit:CountUpByUserId:request\"\n                      }\n                    ],\n                    \"acquireActions\": [\n                      {\n                        \"action\": \"Gs2Money:DepositByUserId\",\n                        \"request\": \"Gs2Money:DepositByUserId:request\"\n                      }\n                    ]\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"displayItems\": [\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"single\",\n                \"metadata\": \"SINGLE\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:WithdrawByUserId\",\n                    \"request\": \"{\\\"moneyName\\\": \\\"money-0001\\\", \\\"userId\\\": \\\"{userId}\\\", \\\"slot\\\": \\\"{slot}\\\", \\\"count\\\": 100, \\\"paidOnly\\\": false}\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"{\\\"categoryName\\\": \\\"category-0001\\\", \\\"inventoryModelName\\\": \\\"character\\\", \\\"itemModelName\\\": \\\"ssr-0001\\\", \\\"userId\\\": \\\"{userId}\\\", \\\"acquireCount\\\": 1}\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"10times\",\n                \"metadata\": \"10TIMES\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:WithdrawByUserId\",\n                    \"request\": \"Gs2Money:WithdrawByUserId:request\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  }\n                ]\n              }\n            }\n          ]\n        }\n      ]\n    }"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\UpdateCurrentShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

AsyncResult<Gs2.Gs2Showcase.Result.UpdateCurrentShowcaseMasterResult> asyncResult = null;
yield return client.UpdateCurrentShowcaseMaster(
    new Gs2.Gs2Showcase.Request.UpdateCurrentShowcaseMasterRequest()
        .WithNamespaceName("namespace1")
        .WithSettings("{\n      \"version\": \"2019-04-04\",\n      \"showcases\": [\n        {\n          \"name\": \"gem\",\n          \"metadata\": \"GEM\",\n          \"displayItems\": [\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"gem_3000\",\n                \"metadata\": \"GEM_3000\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:InAppPurchase\",\n                    \"request\": \"Gs2Money:InAppPurchase:request\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Money:DepositByUserId\",\n                    \"request\": \"Gs2Money:DepositByUserId:request\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"salesItemGroup\",\n              \"salesPeriodEventId\": \"grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001\",\n              \"salesItemGroup\": {\n                \"name\": \"step_gem\",\n                \"metadata\": \"STEP_GEM\",\n                \"salesItems\": [\n                  {\n                    \"name\": \"step1_gem_1000\",\n                    \"metadata\": \"STEP1_GEM_1000\",\n                    \"consumeActions\": [\n                      {\n                        \"action\": \"Gs2Money:InAppPurchase\",\n                        \"request\": \"Gs2Money:InAppPurchase:request\"\n                      },\n                      {\n                        \"action\": \"Gs2Limit:CountUpByUserId\",\n                        \"request\": \"Gs2Limit:CountUpByUserId:request\"\n                      }\n                    ],\n                    \"acquireActions\": [\n                      {\n                        \"action\": \"Gs2Money:DepositByUserId\",\n                        \"request\": \"Gs2Money:DepositByUserId:request\"\n                      }\n                    ]\n                  },\n                  {\n                    \"name\": \"step2_gem_2000\",\n                    \"metadata\": \"STEP1_GEM_2000\",\n                    \"consumeActions\": [\n                      {\n                        \"action\": \"Gs2Money:InAppPurchase\",\n                        \"request\": \"Gs2Money:InAppPurchase:request\"\n                      },\n                      {\n                        \"action\": \"Gs2Limit:CountUpByUserId\",\n                        \"request\": \"Gs2Limit:CountUpByUserId:request\"\n                      }\n                    ],\n                    \"acquireActions\": [\n                      {\n                        \"action\": \"Gs2Money:DepositByUserId\",\n                        \"request\": \"Gs2Money:DepositByUserId:request\"\n                      }\n                    ]\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"displayItems\": [\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"single\",\n                \"metadata\": \"SINGLE\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:WithdrawByUserId\",\n                    \"request\": \"{\\\"moneyName\\\": \\\"money-0001\\\", \\\"userId\\\": \\\"{userId}\\\", \\\"slot\\\": \\\"{slot}\\\", \\\"count\\\": 100, \\\"paidOnly\\\": false}\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"{\\\"categoryName\\\": \\\"category-0001\\\", \\\"inventoryModelName\\\": \\\"character\\\", \\\"itemModelName\\\": \\\"ssr-0001\\\", \\\"userId\\\": \\\"{userId}\\\", \\\"acquireCount\\\": 1}\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"salesItem\",\n              \"salesItem\": {\n                \"name\": \"10times\",\n                \"metadata\": \"10TIMES\",\n                \"consumeActions\": [\n                  {\n                    \"action\": \"Gs2Money:WithdrawByUserId\",\n                    \"request\": \"Gs2Money:WithdrawByUserId:request\"\n                  }\n                ],\n                \"acquireActions\": [\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  },\n                  {\n                    \"action\": \"Gs2Inventory:AcquireItemSetByUserId\",\n                    \"request\": \"Gs2Inventory:AcquireItemSetByUserId:request\"\n                  }\n                ]\n              }\n            }\n          ]\n        }\n      ]\n    }"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

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

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

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

api_result_handler = client.update_current_showcase_master_async({
    namespaceName="namespace1",
    settings="{\n      "version": "2019-04-04",\n      "showcases": [\n        {\n          "name": "gem",\n          "metadata": "GEM",\n          "displayItems": [\n            {\n              "type": "salesItem",\n              "salesItem": {\n                "name": "gem_3000",\n                "metadata": "GEM_3000",\n                "consumeActions": [\n                  {\n                    "action": "Gs2Money:InAppPurchase",\n                    "request": "Gs2Money:InAppPurchase:request"\n                  }\n                ],\n                "acquireActions": [\n                  {\n                    "action": "Gs2Money:DepositByUserId",\n                    "request": "Gs2Money:DepositByUserId:request"\n                  }\n                ]\n              }\n            },\n            {\n              "type": "salesItemGroup",\n              "salesPeriodEventId": "grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001",\n              "salesItemGroup": {\n                "name": "step_gem",\n                "metadata": "STEP_GEM",\n                "salesItems": [\n                  {\n                    "name": "step1_gem_1000",\n                    "metadata": "STEP1_GEM_1000",\n                    "consumeActions": [\n                      {\n                        "action": "Gs2Money:InAppPurchase",\n                        "request": "Gs2Money:InAppPurchase:request"\n                      },\n                      {\n                        "action": "Gs2Limit:CountUpByUserId",\n                        "request": "Gs2Limit:CountUpByUserId:request"\n                      }\n                    ],\n                    "acquireActions": [\n                      {\n                        "action": "Gs2Money:DepositByUserId",\n                        "request": "Gs2Money:DepositByUserId:request"\n                      }\n                    ]\n                  },\n                  {\n                    "name": "step2_gem_2000",\n                    "metadata": "STEP1_GEM_2000",\n                    "consumeActions": [\n                      {\n                        "action": "Gs2Money:InAppPurchase",\n                        "request": "Gs2Money:InAppPurchase:request"\n                      },\n                      {\n                        "action": "Gs2Limit:CountUpByUserId",\n                        "request": "Gs2Limit:CountUpByUserId:request"\n                      }\n                    ],\n                    "acquireActions": [\n                      {\n                        "action": "Gs2Money:DepositByUserId",\n                        "request": "Gs2Money:DepositByUserId:request"\n                      }\n                    ]\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          "name": "gacha",\n          "metadata": "GACHA",\n          "displayItems": [\n            {\n              "type": "salesItem",\n              "salesItem": {\n                "name": "single",\n                "metadata": "SINGLE",\n                "consumeActions": [\n                  {\n                    "action": "Gs2Money:WithdrawByUserId",\n                    "request": "{\\"moneyName\\": \\"money-0001\\", \\"userId\\": \\"{userId}\\", \\"slot\\": \\"{slot}\\", \\"count\\": 100, \\"paidOnly\\": false}"\n                  }\n                ],\n                "acquireActions": [\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "{\\"categoryName\\": \\"category-0001\\", \\"inventoryModelName\\": \\"character\\", \\"itemModelName\\": \\"ssr-0001\\", \\"userId\\": \\"{userId}\\", \\"acquireCount\\": 1}"\n                  }\n                ]\n              }\n            },\n            {\n              "type": "salesItem",\n              "salesItem": {\n                "name": "10times",\n                "metadata": "10TIMES",\n                "consumeActions": [\n                  {\n                    "action": "Gs2Money:WithdrawByUserId",\n                    "request": "Gs2Money:WithdrawByUserId:request"\n                  }\n                ],\n                "acquireActions": [\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  },\n                  {\n                    "action": "Gs2Inventory:AcquireItemSetByUserId",\n                    "request": "Gs2Inventory:AcquireItemSetByUserId:request"\n                  }\n                ]\n              }\n            }\n          ]\n        }\n      ]\n    }",
})

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;

updateCurrentShowcaseMasterFromGitHub

Update the currently available showcase master

Request

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

Result

TypeDescription
itemCurrentShowcaseMasterUpdated and currently available showcase master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentShowcaseMasterFromGitHub(
    &showcase.UpdateCurrentShowcaseMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace1"),
        CheckoutSetting: &showcase.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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\UpdateCurrentShowcaseMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    UpdateCurrentShowcaseMasterFromGitHubResult result = client.updateCurrentShowcaseMasterFromGitHub(
        new UpdateCurrentShowcaseMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("$gitHubApiKey1.apiKeyId")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentShowcaseMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.UpdateCurrentShowcaseMasterFromGitHubRequest;
using Gs2.Gs2Showcase.Result.UpdateCurrentShowcaseMasterFromGitHubResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.UpdateCurrentShowcaseMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentShowcaseMasterFromGitHub(
    new Gs2.Gs2Showcase.Request.UpdateCurrentShowcaseMasterFromGitHubRequest()
        .WithNamespaceName("namespace1")
        .WithCheckoutSetting(new Gs2.Gs2Showcase.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 Gs2Showcase from '@/gs2/showcase';

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

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

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

try:
    result = client.update_current_showcase_master_from_git_hub(
        showcase.UpdateCurrentShowcaseMasterFromGitHubRequest()
            .with_namespace_name(self.hash1)
            .with_checkout_setting(showcase.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('showcase')

api_result = client.update_current_showcase_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('showcase')

api_result_handler = client.update_current_showcase_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;

describeShowcases

Get list of showcase

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
accessTokenstring~ 128 charsUser Id

Result

TypeDescription
itemsList<Showcase>List of Showcases

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DescribeShowcases(
    &showcase.DescribeShowcasesRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DescribeShowcasesRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeShowcases(
        (new DescribeShowcasesRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DescribeShowcasesRequest;
import io.gs2.showcase.result.DescribeShowcasesResult;

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

try {
    DescribeShowcasesResult result = client.describeShowcases(
        new DescribeShowcasesRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("accessToken-0001")
    );
    List<Showcase> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DescribeShowcasesRequest;
using Gs2.Gs2Showcase.Result.DescribeShowcasesResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.DescribeShowcasesResult> asyncResult = null;
yield return client.DescribeShowcases(
    new Gs2.Gs2Showcase.Request.DescribeShowcasesRequest()
        .WithNamespaceName("namespace1")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

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

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

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

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

describeShowcasesByUserId

Obtain list of showcase by specifying a user ID

Request

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

Result

TypeDescription
itemsList<Showcase>List of Showcases

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DescribeShowcasesByUserId(
    &showcase.DescribeShowcasesByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DescribeShowcasesByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeShowcasesByUserIdResult result = client.describeShowcasesByUserId(
        new DescribeShowcasesByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    List<Showcase> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DescribeShowcasesByUserIdRequest;
using Gs2.Gs2Showcase.Result.DescribeShowcasesByUserIdResult;

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

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

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

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

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

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

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

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

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

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

getShowcase

Get showcase

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsShowcase Name
accessTokenstring~ 128 charsUser Id

Result

TypeDescription
itemShowcaseShowcase

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetShowcase(
    &showcase.GetShowcaseRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetShowcaseRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getShowcase(
        (new GetShowcaseRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withAccessToken(self::$accessToken0001)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetShowcaseRequest;
import io.gs2.showcase.result.GetShowcaseResult;

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

try {
    GetShowcaseResult result = client.getShowcase(
        new GetShowcaseRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withAccessToken("accessToken-0001")
    );
    Showcase item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetShowcaseRequest;
using Gs2.Gs2Showcase.Result.GetShowcaseResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.GetShowcaseResult> asyncResult = null;
yield return client.GetShowcase(
    new Gs2.Gs2Showcase.Request.GetShowcaseRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.get_showcase({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    accessToken="accessToken-0001",
})

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

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

api_result_handler = client.get_showcase_async({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    accessToken="accessToken-0001",
})

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

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

result = api_result.result
item = result.item;

getShowcaseByUserId

Obtain showcase by specifying user ID

Request

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

Result

TypeDescription
itemShowcaseShowcase

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetShowcaseByUserId(
    &showcase.GetShowcaseByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        UserId: pointy.String("user-0001"),
        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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetShowcaseByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    GetShowcaseByUserIdResult result = client.getShowcaseByUserId(
        new GetShowcaseByUserIdRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Showcase item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetShowcaseByUserIdRequest;
using Gs2.Gs2Showcase.Result.GetShowcaseByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.GetShowcaseByUserIdResult> asyncResult = null;
yield return client.GetShowcaseByUserId(
    new Gs2.Gs2Showcase.Request.GetShowcaseByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.get_showcase_by_user_id({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    userId="user-0001",
    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('showcase')

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

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

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

result = api_result.result
item = result.item;

buy

Buy product

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsShowcase Name
displayItemIdstringUUID~ 128 charsDisplayed Item ID
accessTokenstring~ 128 charsUser Id
quantityint11 ~ 1000Purchase Quantity
configList<Config>[]~ 32 itemsSet values to be applied to transaction variables

Result

TypeDescription
itemSalesItemProduct
transactionIdstringIssed transaction ID
stampSheetstringStamp sheets used to execute the purchase process
stampSheetEncryptionKeyIdstringCryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheetbool?Is transaction auto-execution enabled?

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.Buy(
    &showcase.BuyRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        DisplayItemId: pointy.String("display-item-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Quantity: nil,
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\BuyRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->buy(
        (new BuyRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withDisplayItemId("display-item-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withQuantity(null)
            ->withConfig(null)
    );
    $item = $result->getItem();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.BuyRequest;
import io.gs2.showcase.result.BuyResult;

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

try {
    BuyResult result = client.buy(
        new BuyRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemId("display-item-0001")
            .withAccessToken("accessToken-0001")
            .withQuantity(null)
            .withConfig(null)
    );
    SalesItem item = result.getItem();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.BuyRequest;
using Gs2.Gs2Showcase.Result.BuyResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.BuyResult> asyncResult = null;
yield return client.Buy(
    new Gs2.Gs2Showcase.Request.BuyRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithDisplayItemId("display-item-0001")
        .WithAccessToken("accessToken-0001")
        .WithQuantity(null)
        .WithConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

try:
    result = client.buy(
        showcase.BuyRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_display_item_id('display-item-0001')
            .with_access_token(self.access_token_0001)
            .with_quantity(None)
            .with_config(None)
    )
    item = result.item
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.buy({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemId="display-item-0001",
    accessToken="accessToken-0001",
    quantity=nil,
    config=nil,
})

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

result = api_result.result
item = result.item;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
client = gs2('showcase')

api_result_handler = client.buy_async({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemId="display-item-0001",
    accessToken="accessToken-0001",
    quantity=nil,
    config=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;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;

buyByUserId

Buy product by specifying user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsShowcase Name
displayItemIdstringUUID~ 128 charsDisplayed Item ID
userIdstring~ 128 charsUser Id
quantityint11 ~ 1000Purchase Quantity
configList<Config>[]~ 32 itemsSet values to be applied to transaction variables
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemSalesItemProduct
transactionIdstringIssed transaction ID
stampSheetstringStamp sheets used to execute the purchase process
stampSheetEncryptionKeyIdstringCryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheetbool?Is transaction auto-execution enabled?

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.BuyByUserId(
    &showcase.BuyByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        DisplayItemId: pointy.String("display-item-0001"),
        UserId: pointy.String("user-0001"),
        Quantity: nil,
        Config: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\BuyByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->buyByUserId(
        (new BuyByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withDisplayItemId("display-item-0001")
            ->withUserId("user-0001")
            ->withQuantity(null)
            ->withConfig(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.BuyByUserIdRequest;
import io.gs2.showcase.result.BuyByUserIdResult;

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

try {
    BuyByUserIdResult result = client.buyByUserId(
        new BuyByUserIdRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemId("display-item-0001")
            .withUserId("user-0001")
            .withQuantity(null)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    SalesItem item = result.getItem();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.BuyByUserIdRequest;
using Gs2.Gs2Showcase.Result.BuyByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.BuyByUserIdResult> asyncResult = null;
yield return client.BuyByUserId(
    new Gs2.Gs2Showcase.Request.BuyByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithDisplayItemId("display-item-0001")
        .WithUserId("user-0001")
        .WithQuantity(null)
        .WithConfig(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

try:
    result = client.buy_by_user_id(
        showcase.BuyByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_display_item_id('display-item-0001')
            .with_user_id('user-0001')
            .with_quantity(None)
            .with_config(None)
            .with_time_offset_token(None)
    )
    item = result.item
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.buy_by_user_id({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemId="display-item-0001",
    userId="user-0001",
    quantity=nil,
    config=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
client = gs2('showcase')

api_result_handler = client.buy_by_user_id_async({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemId="display-item-0001",
    userId="user-0001",
    quantity=nil,
    config=nil,
    timeOffsetToken=nil,
})

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

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

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

describeRandomShowcaseMasters

Get list of Random Showcase Model 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<RandomShowcaseMaster>List of Random Showcase Model 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/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DescribeRandomShowcaseMasters(
    &showcase.DescribeRandomShowcaseMastersRequest {
        NamespaceName: pointy.String("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DescribeRandomShowcaseMastersRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeRandomShowcaseMastersResult result = client.describeRandomShowcaseMasters(
        new DescribeRandomShowcaseMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<RandomShowcaseMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DescribeRandomShowcaseMastersRequest;
using Gs2.Gs2Showcase.Result.DescribeRandomShowcaseMastersResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.DescribeRandomShowcaseMastersResult> asyncResult = null;
yield return client.DescribeRandomShowcaseMasters(
    new Gs2.Gs2Showcase.Request.DescribeRandomShowcaseMastersRequest()
        .WithNamespaceName("namespace1")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.describe_random_showcase_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('showcase')

api_result_handler = client.describe_random_showcase_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;

createRandomShowcaseMaster

Create a new Random Showcase Model Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
namestring~ 128 charsRandom Showcase Model Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
maximumNumberOfChoiceint1 ~ 100Maximum number of products to be selected
displayItemsList<RandomDisplayItemModel>1 ~ 100 itemsList of Products on display
baseTimestamplongBase time for re-drawing the products on display (Unix time unit:milliseconds)
resetIntervalHoursint1 ~ 168Interval (hours) between re-drawing the products on display
salesPeriodEventIdstring~ 1024 charsGS2-Schedule events with sales periods for display shelves

Result

TypeDescription
itemRandomShowcaseMasterCreated Random Showcase Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.CreateRandomShowcaseMaster(
    &showcase.CreateRandomShowcaseMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("showcase-0001"),
        Description: nil,
        Metadata: nil,
        MaximumNumberOfChoice: pointy.Int32(2),
        DisplayItems: []showcase.RandomDisplayItemModel{
            showcase.RandomDisplayItemModel{
                Name: pointy.String("display-item-0001"),
                ConsumeActions: []showcase.ConsumeAction{
                    showcase.ConsumeAction{
                        Action: pointy.String("Gs2Inventory:ConsumeItemSetByUserId"),
                        Request: pointy.String("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    },
                },
                AcquireActions: []showcase.AcquireAction{
                    showcase.AcquireAction{
                        Action: pointy.String("Gs2Inventory:AcquireItemSetByUserId"),
                        Request: pointy.String("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    },
                },
                Stock: pointy.Int32(1),
                Weight: pointy.Int32(1),
            },
            showcase.RandomDisplayItemModel{
                Name: pointy.String("display-item-0002"),
                ConsumeActions: []showcase.ConsumeAction{
                    showcase.ConsumeAction{
                        Action: pointy.String("Gs2Inventory:ConsumeItemSetByUserId"),
                        Request: pointy.String("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    },
                },
                AcquireActions: []showcase.AcquireAction{
                    showcase.AcquireAction{
                        Action: pointy.String("Gs2Inventory:AcquireItemSetByUserId"),
                        Request: pointy.String("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    },
                },
                Stock: pointy.Int32(2),
                Weight: pointy.Int32(2),
            },
            showcase.RandomDisplayItemModel{
                Name: pointy.String("display-item-0003"),
                ConsumeActions: []showcase.ConsumeAction{
                    showcase.ConsumeAction{
                        Action: pointy.String("Gs2Inventory:ConsumeItemSetByUserId"),
                        Request: pointy.String("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    },
                },
                AcquireActions: []showcase.AcquireAction{
                    showcase.AcquireAction{
                        Action: pointy.String("Gs2Inventory:AcquireItemSetByUserId"),
                        Request: pointy.String("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    },
                },
                Stock: pointy.Int32(3),
                Weight: pointy.Int32(3),
            },
        },
        BaseTimestamp: pointy.Int64(1000),
        ResetIntervalHours: pointy.Int32(6),
        SalesPeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\CreateRandomShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createRandomShowcaseMaster(
        (new CreateRandomShowcaseMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("showcase-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withMaximumNumberOfChoice(2)
            ->withDisplayItems([
                (new \Gs2\Showcase\Model\RandomDisplayItemModel())
                    ->withName("display-item-0001")
                    ->withConsumeActions([
                        (new \Gs2\Showcase\Model\ConsumeAction())
                            ->withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            ->withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    ])
                    ->withAcquireActions([
                        (new \Gs2\Showcase\Model\AcquireAction())
                            ->withAction("Gs2Inventory:AcquireItemSetByUserId")
                            ->withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    ])
                    ->withStock(1)
                    ->withWeight(1),
                (new \Gs2\Showcase\Model\RandomDisplayItemModel())
                    ->withName("display-item-0002")
                    ->withConsumeActions([
                        (new \Gs2\Showcase\Model\ConsumeAction())
                            ->withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            ->withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    ])
                    ->withAcquireActions([
                        (new \Gs2\Showcase\Model\AcquireAction())
                            ->withAction("Gs2Inventory:AcquireItemSetByUserId")
                            ->withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    ])
                    ->withStock(2)
                    ->withWeight(2),
                (new \Gs2\Showcase\Model\RandomDisplayItemModel())
                    ->withName("display-item-0003")
                    ->withConsumeActions([
                        (new \Gs2\Showcase\Model\ConsumeAction())
                            ->withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            ->withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    ])
                    ->withAcquireActions([
                        (new \Gs2\Showcase\Model\AcquireAction())
                            ->withAction("Gs2Inventory:AcquireItemSetByUserId")
                            ->withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    ])
                    ->withStock(3)
                    ->withWeight(3),
            ])
            ->withBaseTimestamp(1000)
            ->withResetIntervalHours(6)
            ->withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.CreateRandomShowcaseMasterRequest;
import io.gs2.showcase.result.CreateRandomShowcaseMasterResult;

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

try {
    CreateRandomShowcaseMasterResult result = client.createRandomShowcaseMaster(
        new CreateRandomShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withName("showcase-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMaximumNumberOfChoice(2)
            .withDisplayItems(Arrays.asList(
                new io.gs2.showcase.model.RandomDisplayItemModel()
                    .withName("display-item-0001")
                    .withConsumeActions(Arrays.asList(
                        new io.gs2.showcase.model.ConsumeAction()
                            .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}")
                    ))
                    .withAcquireActions(Arrays.asList(
                        new io.gs2.showcase.model.AcquireAction()
                            .withAction("Gs2Inventory:AcquireItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}")
                    ))
                    .withStock(1)
                    .withWeight(1),
                new io.gs2.showcase.model.RandomDisplayItemModel()
                    .withName("display-item-0002")
                    .withConsumeActions(Arrays.asList(
                        new io.gs2.showcase.model.ConsumeAction()
                            .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}")
                    ))
                    .withAcquireActions(Arrays.asList(
                        new io.gs2.showcase.model.AcquireAction()
                            .withAction("Gs2Inventory:AcquireItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}")
                    ))
                    .withStock(2)
                    .withWeight(2),
                new io.gs2.showcase.model.RandomDisplayItemModel()
                    .withName("display-item-0003")
                    .withConsumeActions(Arrays.asList(
                        new io.gs2.showcase.model.ConsumeAction()
                            .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}")
                    ))
                    .withAcquireActions(Arrays.asList(
                        new io.gs2.showcase.model.AcquireAction()
                            .withAction("Gs2Inventory:AcquireItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}")
                    ))
                    .withStock(3)
                    .withWeight(3)
            ))
            .withBaseTimestamp(1000L)
            .withResetIntervalHours(6)
            .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
    );
    RandomShowcaseMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.CreateRandomShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.CreateRandomShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.CreateRandomShowcaseMasterResult> asyncResult = null;
yield return client.CreateRandomShowcaseMaster(
    new Gs2.Gs2Showcase.Request.CreateRandomShowcaseMasterRequest()
        .WithNamespaceName("namespace1")
        .WithName("showcase-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithMaximumNumberOfChoice(2)
        .WithDisplayItems(new Gs2.Gs2Showcase.Model.RandomDisplayItemModel[] {
            new Gs2.Gs2Showcase.Model.RandomDisplayItemModel()
                .WithName("display-item-0001")
                .WithConsumeActions(new Gs2.Core.Model.ConsumeAction[] {
                    new Gs2.Core.Model.ConsumeAction()
                        .WithAction("Gs2Inventory:ConsumeItemSetByUserId")
                        .WithRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                })
                .WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
                    new Gs2.Core.Model.AcquireAction()
                        .WithAction("Gs2Inventory:AcquireItemSetByUserId")
                        .WithRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                })
                .WithStock(1)
                .WithWeight(1),
            new Gs2.Gs2Showcase.Model.RandomDisplayItemModel()
                .WithName("display-item-0002")
                .WithConsumeActions(new Gs2.Core.Model.ConsumeAction[] {
                    new Gs2.Core.Model.ConsumeAction()
                        .WithAction("Gs2Inventory:ConsumeItemSetByUserId")
                        .WithRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                })
                .WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
                    new Gs2.Core.Model.AcquireAction()
                        .WithAction("Gs2Inventory:AcquireItemSetByUserId")
                        .WithRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                })
                .WithStock(2)
                .WithWeight(2),
            new Gs2.Gs2Showcase.Model.RandomDisplayItemModel()
                .WithName("display-item-0003")
                .WithConsumeActions(new Gs2.Core.Model.ConsumeAction[] {
                    new Gs2.Core.Model.ConsumeAction()
                        .WithAction("Gs2Inventory:ConsumeItemSetByUserId")
                        .WithRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                })
                .WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
                    new Gs2.Core.Model.AcquireAction()
                        .WithAction("Gs2Inventory:AcquireItemSetByUserId")
                        .WithRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                })
                .WithStock(3)
                .WithWeight(3),
        })
        .WithBaseTimestamp(1000L)
        .WithResetIntervalHours(6)
        .WithSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.createRandomShowcaseMaster(
        new Gs2Showcase.CreateRandomShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withName("showcase-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMaximumNumberOfChoice(2)
            .withDisplayItems([
                new Gs2Showcase.model.RandomDisplayItemModel()
                    .withName("display-item-0001")
                    .withConsumeActions([
                        new Gs2Showcase.model.ConsumeAction()
                            .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    ])
                    .withAcquireActions([
                        new Gs2Showcase.model.AcquireAction()
                            .withAction("Gs2Inventory:AcquireItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    ])
                    .withStock(1)
                    .withWeight(1),
                new Gs2Showcase.model.RandomDisplayItemModel()
                    .withName("display-item-0002")
                    .withConsumeActions([
                        new Gs2Showcase.model.ConsumeAction()
                            .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    ])
                    .withAcquireActions([
                        new Gs2Showcase.model.AcquireAction()
                            .withAction("Gs2Inventory:AcquireItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    ])
                    .withStock(2)
                    .withWeight(2),
                new Gs2Showcase.model.RandomDisplayItemModel()
                    .withName("display-item-0003")
                    .withConsumeActions([
                        new Gs2Showcase.model.ConsumeAction()
                            .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    ])
                    .withAcquireActions([
                        new Gs2Showcase.model.AcquireAction()
                            .withAction("Gs2Inventory:AcquireItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    ])
                    .withStock(3)
                    .withWeight(3),
            ])
            .withBaseTimestamp(1000)
            .withResetIntervalHours(6)
            .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.create_random_showcase_master(
        showcase.CreateRandomShowcaseMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('showcase-0001')
            .with_description(None)
            .with_metadata(None)
            .with_maximum_number_of_choice(2)
            .with_display_items([
                showcase.RandomDisplayItemModel()
                    .with_name('display-item-0001')
                    .with_consume_actions([
                        showcase.ConsumeAction()
                            .with_action('Gs2Inventory:ConsumeItemSetByUserId')
                            .with_request('{"namespaceName": "namespace-0001", "inventoryName": "item", "itemName": "item-0001", "userId": "#{userId}", "consumeCount": 10}'),
                    ])
                    .with_acquire_actions([
                        showcase.AcquireAction()
                            .with_action('Gs2Inventory:AcquireItemSetByUserId')
                            .with_request('{"namespaceName": "namespace-0001", "inventoryName": "item", "itemName": "item-0002", "userId": "#{userId}", "acquireCount": 1}'),
                    ])
                    .with_stock(1)
                    .with_weight(1),
                showcase.RandomDisplayItemModel()
                    .with_name('display-item-0002')
                    .with_consume_actions([
                        showcase.ConsumeAction()
                            .with_action('Gs2Inventory:ConsumeItemSetByUserId')
                            .with_request('{"namespaceName": "namespace-0001", "inventoryName": "item", "itemName": "item-0001", "userId": "#{userId}", "consumeCount": 10}'),
                    ])
                    .with_acquire_actions([
                        showcase.AcquireAction()
                            .with_action('Gs2Inventory:AcquireItemSetByUserId')
                            .with_request('{"namespaceName": "namespace-0001", "inventoryName": "item", "itemName": "item-0002", "userId": "#{userId}", "acquireCount": 1}'),
                    ])
                    .with_stock(2)
                    .with_weight(2),
                showcase.RandomDisplayItemModel()
                    .with_name('display-item-0003')
                    .with_consume_actions([
                        showcase.ConsumeAction()
                            .with_action('Gs2Inventory:ConsumeItemSetByUserId')
                            .with_request('{"namespaceName": "namespace-0001", "inventoryName": "item", "itemName": "item-0001", "userId": "#{userId}", "consumeCount": 10}'),
                    ])
                    .with_acquire_actions([
                        showcase.AcquireAction()
                            .with_action('Gs2Inventory:AcquireItemSetByUserId')
                            .with_request('{"namespaceName": "namespace-0001", "inventoryName": "item", "itemName": "item-0002", "userId": "#{userId}", "acquireCount": 1}'),
                    ])
                    .with_stock(3)
                    .with_weight(3),
            ])
            .with_base_timestamp(1000)
            .with_reset_interval_hours(6)
            .with_sales_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.create_random_showcase_master({
    namespaceName="namespace1",
    name="showcase-0001",
    description=nil,
    metadata=nil,
    maximumNumberOfChoice=2,
    displayItems={
        {
            name="display-item-0001",
            consumeActions={
                {
                    action="Gs2Inventory:ConsumeItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}",
                }
            },
            acquireActions={
                {
                    action="Gs2Inventory:AcquireItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}",
                }
            },
            stock=1,
            weight=1,
        },
        {
            name="display-item-0002",
            consumeActions={
                {
                    action="Gs2Inventory:ConsumeItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}",
                }
            },
            acquireActions={
                {
                    action="Gs2Inventory:AcquireItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}",
                }
            },
            stock=2,
            weight=2,
        },
        {
            name="display-item-0003",
            consumeActions={
                {
                    action="Gs2Inventory:ConsumeItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}",
                }
            },
            acquireActions={
                {
                    action="Gs2Inventory:AcquireItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}",
                }
            },
            stock=3,
            weight=3,
        }
    },
    baseTimestamp=1000,
    resetIntervalHours=6,
    salesPeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-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('showcase')

api_result_handler = client.create_random_showcase_master_async({
    namespaceName="namespace1",
    name="showcase-0001",
    description=nil,
    metadata=nil,
    maximumNumberOfChoice=2,
    displayItems={
        {
            name="display-item-0001",
            consumeActions={
                {
                    action="Gs2Inventory:ConsumeItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}",
                }
            },
            acquireActions={
                {
                    action="Gs2Inventory:AcquireItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}",
                }
            },
            stock=1,
            weight=1,
        },
        {
            name="display-item-0002",
            consumeActions={
                {
                    action="Gs2Inventory:ConsumeItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}",
                }
            },
            acquireActions={
                {
                    action="Gs2Inventory:AcquireItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}",
                }
            },
            stock=2,
            weight=2,
        },
        {
            name="display-item-0003",
            consumeActions={
                {
                    action="Gs2Inventory:ConsumeItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}",
                }
            },
            acquireActions={
                {
                    action="Gs2Inventory:AcquireItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}",
                }
            },
            stock=3,
            weight=3,
        }
    },
    baseTimestamp=1000,
    resetIntervalHours=6,
    salesPeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-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;

getRandomShowcaseMaster

Retrieve Random Showcase Model Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsRandom Showcase Model Name

Result

TypeDescription
itemRandomShowcaseMasterRandom Showcase Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetRandomShowcaseMaster(
    &showcase.GetRandomShowcaseMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetRandomShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getRandomShowcaseMaster(
        (new GetRandomShowcaseMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetRandomShowcaseMasterRequest;
import io.gs2.showcase.result.GetRandomShowcaseMasterResult;

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

try {
    GetRandomShowcaseMasterResult result = client.getRandomShowcaseMaster(
        new GetRandomShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
    );
    RandomShowcaseMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetRandomShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.GetRandomShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.GetRandomShowcaseMasterResult> asyncResult = null;
yield return client.GetRandomShowcaseMaster(
    new Gs2.Gs2Showcase.Request.GetRandomShowcaseMasterRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.get_random_showcase_master({
    namespaceName="namespace1",
    showcaseName="showcase-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('showcase')

api_result_handler = client.get_random_showcase_master_async({
    namespaceName="namespace1",
    showcaseName="showcase-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;

updateRandomShowcaseMaster

Update Random Showcase Model Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsRandom Showcase Model Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
maximumNumberOfChoiceint1 ~ 100Maximum number of products to be selected
displayItemsList<RandomDisplayItemModel>1 ~ 100 itemsList of Products on display
baseTimestamplongBase time for re-drawing the products on display (Unix time unit:milliseconds)
resetIntervalHoursint1 ~ 168Interval (hours) between re-drawing the products on display
salesPeriodEventIdstring~ 1024 charsGS2-Schedule events with sales periods for display shelves

Result

TypeDescription
itemRandomShowcaseMasterUpdated Random Showcase Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.UpdateRandomShowcaseMaster(
    &showcase.UpdateRandomShowcaseMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("SHOWCASE_0001"),
        MaximumNumberOfChoice: pointy.Int32(1),
        DisplayItems: []showcase.RandomDisplayItemModel{
            showcase.RandomDisplayItemModel{
                Name: pointy.String("display-item-1001"),
                ConsumeActions: []showcase.ConsumeAction{
                    showcase.ConsumeAction{
                        Action: pointy.String("Gs2Inventory:ConsumeItemSetByUserId"),
                        Request: pointy.String("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    },
                },
                AcquireActions: []showcase.AcquireAction{
                    showcase.AcquireAction{
                        Action: pointy.String("Gs2Inventory:AcquireItemSetByUserId"),
                        Request: pointy.String("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    },
                },
                Stock: pointy.Int32(5),
                Weight: pointy.Int32(10),
            },
            showcase.RandomDisplayItemModel{
                Name: pointy.String("display-item-1002"),
                ConsumeActions: []showcase.ConsumeAction{
                    showcase.ConsumeAction{
                        Action: pointy.String("Gs2Inventory:ConsumeItemSetByUserId"),
                        Request: pointy.String("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    },
                },
                AcquireActions: []showcase.AcquireAction{
                    showcase.AcquireAction{
                        Action: pointy.String("Gs2Inventory:AcquireItemSetByUserId"),
                        Request: pointy.String("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    },
                },
                Stock: pointy.Int32(10),
                Weight: pointy.Int32(20),
            },
            showcase.RandomDisplayItemModel{
                Name: pointy.String("display-item-1003"),
                ConsumeActions: []showcase.ConsumeAction{
                    showcase.ConsumeAction{
                        Action: pointy.String("Gs2Inventory:ConsumeItemSetByUserId"),
                        Request: pointy.String("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    },
                },
                AcquireActions: []showcase.AcquireAction{
                    showcase.AcquireAction{
                        Action: pointy.String("Gs2Inventory:AcquireItemSetByUserId"),
                        Request: pointy.String("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    },
                },
                Stock: pointy.Int32(15),
                Weight: pointy.Int32(30),
            },
        },
        BaseTimestamp: pointy.Int64(2000),
        ResetIntervalHours: pointy.Int32(12),
        SalesPeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\UpdateRandomShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateRandomShowcaseMaster(
        (new UpdateRandomShowcaseMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withDescription("description1")
            ->withMetadata("SHOWCASE_0001")
            ->withMaximumNumberOfChoice(1)
            ->withDisplayItems([
                (new \Gs2\Showcase\Model\RandomDisplayItemModel())
                    ->withName("display-item-1001")
                    ->withConsumeActions([
                        (new \Gs2\Showcase\Model\ConsumeAction())
                            ->withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            ->withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    ])
                    ->withAcquireActions([
                        (new \Gs2\Showcase\Model\AcquireAction())
                            ->withAction("Gs2Inventory:AcquireItemSetByUserId")
                            ->withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    ])
                    ->withStock(5)
                    ->withWeight(10),
                (new \Gs2\Showcase\Model\RandomDisplayItemModel())
                    ->withName("display-item-1002")
                    ->withConsumeActions([
                        (new \Gs2\Showcase\Model\ConsumeAction())
                            ->withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            ->withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    ])
                    ->withAcquireActions([
                        (new \Gs2\Showcase\Model\AcquireAction())
                            ->withAction("Gs2Inventory:AcquireItemSetByUserId")
                            ->withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    ])
                    ->withStock(10)
                    ->withWeight(20),
                (new \Gs2\Showcase\Model\RandomDisplayItemModel())
                    ->withName("display-item-1003")
                    ->withConsumeActions([
                        (new \Gs2\Showcase\Model\ConsumeAction())
                            ->withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            ->withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    ])
                    ->withAcquireActions([
                        (new \Gs2\Showcase\Model\AcquireAction())
                            ->withAction("Gs2Inventory:AcquireItemSetByUserId")
                            ->withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    ])
                    ->withStock(15)
                    ->withWeight(30),
            ])
            ->withBaseTimestamp(2000)
            ->withResetIntervalHours(12)
            ->withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.UpdateRandomShowcaseMasterRequest;
import io.gs2.showcase.result.UpdateRandomShowcaseMasterResult;

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

try {
    UpdateRandomShowcaseMasterResult result = client.updateRandomShowcaseMaster(
        new UpdateRandomShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDescription("description1")
            .withMetadata("SHOWCASE_0001")
            .withMaximumNumberOfChoice(1)
            .withDisplayItems(Arrays.asList(
                new io.gs2.showcase.model.RandomDisplayItemModel()
                    .withName("display-item-1001")
                    .withConsumeActions(Arrays.asList(
                        new io.gs2.showcase.model.ConsumeAction()
                            .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}")
                    ))
                    .withAcquireActions(Arrays.asList(
                        new io.gs2.showcase.model.AcquireAction()
                            .withAction("Gs2Inventory:AcquireItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}")
                    ))
                    .withStock(5)
                    .withWeight(10),
                new io.gs2.showcase.model.RandomDisplayItemModel()
                    .withName("display-item-1002")
                    .withConsumeActions(Arrays.asList(
                        new io.gs2.showcase.model.ConsumeAction()
                            .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}")
                    ))
                    .withAcquireActions(Arrays.asList(
                        new io.gs2.showcase.model.AcquireAction()
                            .withAction("Gs2Inventory:AcquireItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}")
                    ))
                    .withStock(10)
                    .withWeight(20),
                new io.gs2.showcase.model.RandomDisplayItemModel()
                    .withName("display-item-1003")
                    .withConsumeActions(Arrays.asList(
                        new io.gs2.showcase.model.ConsumeAction()
                            .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}")
                    ))
                    .withAcquireActions(Arrays.asList(
                        new io.gs2.showcase.model.AcquireAction()
                            .withAction("Gs2Inventory:AcquireItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}")
                    ))
                    .withStock(15)
                    .withWeight(30)
            ))
            .withBaseTimestamp(2000L)
            .withResetIntervalHours(12)
            .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002")
    );
    RandomShowcaseMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.UpdateRandomShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.UpdateRandomShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.UpdateRandomShowcaseMasterResult> asyncResult = null;
yield return client.UpdateRandomShowcaseMaster(
    new Gs2.Gs2Showcase.Request.UpdateRandomShowcaseMasterRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithDescription("description1")
        .WithMetadata("SHOWCASE_0001")
        .WithMaximumNumberOfChoice(1)
        .WithDisplayItems(new Gs2.Gs2Showcase.Model.RandomDisplayItemModel[] {
            new Gs2.Gs2Showcase.Model.RandomDisplayItemModel()
                .WithName("display-item-1001")
                .WithConsumeActions(new Gs2.Core.Model.ConsumeAction[] {
                    new Gs2.Core.Model.ConsumeAction()
                        .WithAction("Gs2Inventory:ConsumeItemSetByUserId")
                        .WithRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                })
                .WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
                    new Gs2.Core.Model.AcquireAction()
                        .WithAction("Gs2Inventory:AcquireItemSetByUserId")
                        .WithRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                })
                .WithStock(5)
                .WithWeight(10),
            new Gs2.Gs2Showcase.Model.RandomDisplayItemModel()
                .WithName("display-item-1002")
                .WithConsumeActions(new Gs2.Core.Model.ConsumeAction[] {
                    new Gs2.Core.Model.ConsumeAction()
                        .WithAction("Gs2Inventory:ConsumeItemSetByUserId")
                        .WithRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                })
                .WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
                    new Gs2.Core.Model.AcquireAction()
                        .WithAction("Gs2Inventory:AcquireItemSetByUserId")
                        .WithRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                })
                .WithStock(10)
                .WithWeight(20),
            new Gs2.Gs2Showcase.Model.RandomDisplayItemModel()
                .WithName("display-item-1003")
                .WithConsumeActions(new Gs2.Core.Model.ConsumeAction[] {
                    new Gs2.Core.Model.ConsumeAction()
                        .WithAction("Gs2Inventory:ConsumeItemSetByUserId")
                        .WithRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                })
                .WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
                    new Gs2.Core.Model.AcquireAction()
                        .WithAction("Gs2Inventory:AcquireItemSetByUserId")
                        .WithRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                })
                .WithStock(15)
                .WithWeight(30),
        })
        .WithBaseTimestamp(2000L)
        .WithResetIntervalHours(12)
        .WithSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.updateRandomShowcaseMaster(
        new Gs2Showcase.UpdateRandomShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDescription("description1")
            .withMetadata("SHOWCASE_0001")
            .withMaximumNumberOfChoice(1)
            .withDisplayItems([
                new Gs2Showcase.model.RandomDisplayItemModel()
                    .withName("display-item-1001")
                    .withConsumeActions([
                        new Gs2Showcase.model.ConsumeAction()
                            .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    ])
                    .withAcquireActions([
                        new Gs2Showcase.model.AcquireAction()
                            .withAction("Gs2Inventory:AcquireItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    ])
                    .withStock(5)
                    .withWeight(10),
                new Gs2Showcase.model.RandomDisplayItemModel()
                    .withName("display-item-1002")
                    .withConsumeActions([
                        new Gs2Showcase.model.ConsumeAction()
                            .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    ])
                    .withAcquireActions([
                        new Gs2Showcase.model.AcquireAction()
                            .withAction("Gs2Inventory:AcquireItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    ])
                    .withStock(10)
                    .withWeight(20),
                new Gs2Showcase.model.RandomDisplayItemModel()
                    .withName("display-item-1003")
                    .withConsumeActions([
                        new Gs2Showcase.model.ConsumeAction()
                            .withAction("Gs2Inventory:ConsumeItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}"),
                    ])
                    .withAcquireActions([
                        new Gs2Showcase.model.AcquireAction()
                            .withAction("Gs2Inventory:AcquireItemSetByUserId")
                            .withRequest("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}"),
                    ])
                    .withStock(15)
                    .withWeight(30),
            ])
            .withBaseTimestamp(2000)
            .withResetIntervalHours(12)
            .withSalesPeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.update_random_showcase_master(
        showcase.UpdateRandomShowcaseMasterRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_description('description1')
            .with_metadata('SHOWCASE_0001')
            .with_maximum_number_of_choice(1)
            .with_display_items([
                showcase.RandomDisplayItemModel()
                    .with_name('display-item-1001')
                    .with_consume_actions([
                        showcase.ConsumeAction()
                            .with_action('Gs2Inventory:ConsumeItemSetByUserId')
                            .with_request('{"namespaceName": "namespace-0001", "inventoryName": "item", "itemName": "item-0001", "userId": "#{userId}", "consumeCount": 10}'),
                    ])
                    .with_acquire_actions([
                        showcase.AcquireAction()
                            .with_action('Gs2Inventory:AcquireItemSetByUserId')
                            .with_request('{"namespaceName": "namespace-0001", "inventoryName": "item", "itemName": "item-0002", "userId": "#{userId}", "acquireCount": 1}'),
                    ])
                    .with_stock(5)
                    .with_weight(10),
                showcase.RandomDisplayItemModel()
                    .with_name('display-item-1002')
                    .with_consume_actions([
                        showcase.ConsumeAction()
                            .with_action('Gs2Inventory:ConsumeItemSetByUserId')
                            .with_request('{"namespaceName": "namespace-0001", "inventoryName": "item", "itemName": "item-0001", "userId": "#{userId}", "consumeCount": 10}'),
                    ])
                    .with_acquire_actions([
                        showcase.AcquireAction()
                            .with_action('Gs2Inventory:AcquireItemSetByUserId')
                            .with_request('{"namespaceName": "namespace-0001", "inventoryName": "item", "itemName": "item-0002", "userId": "#{userId}", "acquireCount": 1}'),
                    ])
                    .with_stock(10)
                    .with_weight(20),
                showcase.RandomDisplayItemModel()
                    .with_name('display-item-1003')
                    .with_consume_actions([
                        showcase.ConsumeAction()
                            .with_action('Gs2Inventory:ConsumeItemSetByUserId')
                            .with_request('{"namespaceName": "namespace-0001", "inventoryName": "item", "itemName": "item-0001", "userId": "#{userId}", "consumeCount": 10}'),
                    ])
                    .with_acquire_actions([
                        showcase.AcquireAction()
                            .with_action('Gs2Inventory:AcquireItemSetByUserId')
                            .with_request('{"namespaceName": "namespace-0001", "inventoryName": "item", "itemName": "item-0002", "userId": "#{userId}", "acquireCount": 1}'),
                    ])
                    .with_stock(15)
                    .with_weight(30),
            ])
            .with_base_timestamp(2000)
            .with_reset_interval_hours(12)
            .with_sales_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.update_random_showcase_master({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    description="description1",
    metadata="SHOWCASE_0001",
    maximumNumberOfChoice=1,
    displayItems={
        {
            name="display-item-1001",
            consumeActions={
                {
                    action="Gs2Inventory:ConsumeItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}",
                }
            },
            acquireActions={
                {
                    action="Gs2Inventory:AcquireItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}",
                }
            },
            stock=5,
            weight=10,
        },
        {
            name="display-item-1002",
            consumeActions={
                {
                    action="Gs2Inventory:ConsumeItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}",
                }
            },
            acquireActions={
                {
                    action="Gs2Inventory:AcquireItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}",
                }
            },
            stock=10,
            weight=20,
        },
        {
            name="display-item-1003",
            consumeActions={
                {
                    action="Gs2Inventory:ConsumeItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}",
                }
            },
            acquireActions={
                {
                    action="Gs2Inventory:AcquireItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}",
                }
            },
            stock=15,
            weight=30,
        }
    },
    baseTimestamp=2000,
    resetIntervalHours=12,
    salesPeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-0002",
})

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('showcase')

api_result_handler = client.update_random_showcase_master_async({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    description="description1",
    metadata="SHOWCASE_0001",
    maximumNumberOfChoice=1,
    displayItems={
        {
            name="display-item-1001",
            consumeActions={
                {
                    action="Gs2Inventory:ConsumeItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}",
                }
            },
            acquireActions={
                {
                    action="Gs2Inventory:AcquireItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}",
                }
            },
            stock=5,
            weight=10,
        },
        {
            name="display-item-1002",
            consumeActions={
                {
                    action="Gs2Inventory:ConsumeItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}",
                }
            },
            acquireActions={
                {
                    action="Gs2Inventory:AcquireItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}",
                }
            },
            stock=10,
            weight=20,
        },
        {
            name="display-item-1003",
            consumeActions={
                {
                    action="Gs2Inventory:ConsumeItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0001\", \"userId\": \"#{userId}\", \"consumeCount\": 10}",
                }
            },
            acquireActions={
                {
                    action="Gs2Inventory:AcquireItemSetByUserId",
                    request="{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"item\", \"itemName\": \"item-0002\", \"userId\": \"#{userId}\", \"acquireCount\": 1}",
                }
            },
            stock=15,
            weight=30,
        }
    },
    baseTimestamp=2000,
    resetIntervalHours=12,
    salesPeriodEventId="grn:gs2:ap-northeast-1:YourOwnerId:schedule:schedule-0001:event:event-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
item = result.item;

deleteRandomShowcaseMaster

Delete Random Showcase Model Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsRandom Showcase Model Name

Result

TypeDescription
itemRandomShowcaseMasterDeleted Random Showcase Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DeleteRandomShowcaseMaster(
    &showcase.DeleteRandomShowcaseMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DeleteRandomShowcaseMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteRandomShowcaseMaster(
        (new DeleteRandomShowcaseMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DeleteRandomShowcaseMasterRequest;
import io.gs2.showcase.result.DeleteRandomShowcaseMasterResult;

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

try {
    DeleteRandomShowcaseMasterResult result = client.deleteRandomShowcaseMaster(
        new DeleteRandomShowcaseMasterRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
    );
    RandomShowcaseMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DeleteRandomShowcaseMasterRequest;
using Gs2.Gs2Showcase.Result.DeleteRandomShowcaseMasterResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.DeleteRandomShowcaseMasterResult> asyncResult = null;
yield return client.DeleteRandomShowcaseMaster(
    new Gs2.Gs2Showcase.Request.DeleteRandomShowcaseMasterRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

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

api_result = client.delete_random_showcase_master({
    namespaceName="namespace1",
    showcaseName="showcase-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('showcase')

api_result_handler = client.delete_random_showcase_master_async({
    namespaceName="namespace1",
    showcaseName="showcase-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;

incrementPurchaseCount

Increment the number of times a product has been purchased

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsRandom Showcase Model Name
displayItemNamestring~ 128 charsRandom Displayed Item Name
accessTokenstring~ 128 charsUser Id
countint~ 100Number of purchase times to add

Result

TypeDescription
itemRandomDisplayItemRandomly displayed items after purchase counts are added

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.IncrementPurchaseCount(
    &showcase.IncrementPurchaseCountRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        DisplayItemName: pointy.String("item-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Count: pointy.Int32(1),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\IncrementPurchaseCountRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->incrementPurchaseCount(
        (new IncrementPurchaseCountRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withDisplayItemName("item-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withCount(1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.IncrementPurchaseCountRequest;
import io.gs2.showcase.result.IncrementPurchaseCountResult;

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

try {
    IncrementPurchaseCountResult result = client.incrementPurchaseCount(
        new IncrementPurchaseCountRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemName("item-0001")
            .withAccessToken("accessToken-0001")
            .withCount(1)
    );
    RandomDisplayItem item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.IncrementPurchaseCountRequest;
using Gs2.Gs2Showcase.Result.IncrementPurchaseCountResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.IncrementPurchaseCountResult> asyncResult = null;
yield return client.IncrementPurchaseCount(
    new Gs2.Gs2Showcase.Request.IncrementPurchaseCountRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithDisplayItemName("item-0001")
        .WithAccessToken("accessToken-0001")
        .WithCount(1),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

try:
    result = client.increment_purchase_count(
        showcase.IncrementPurchaseCountRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_display_item_name('item-0001')
            .with_access_token(self.access_token_0001)
            .with_count(1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.increment_purchase_count({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemName="item-0001",
    accessToken="accessToken-0001",
    count=1,
})

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('showcase')

api_result_handler = client.increment_purchase_count_async({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemName="item-0001",
    accessToken="accessToken-0001",
    count=1,
})

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;

incrementPurchaseCountByUserId

Increment the number of times a product has been purchased by specifying the user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsRandom Showcase Model Name
displayItemNamestring~ 128 charsRandom Displayed Item Name
userIdstring~ 128 charsUser Id
countint~ 100Number of purchase times to add
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemRandomDisplayItemRandomly displayed items after purchase counts are added

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.IncrementPurchaseCountByUserId(
    &showcase.IncrementPurchaseCountByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        DisplayItemName: pointy.String("item-0001"),
        UserId: pointy.String("user-0001"),
        Count: pointy.Int32(1),
        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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\IncrementPurchaseCountByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->incrementPurchaseCountByUserId(
        (new IncrementPurchaseCountByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withDisplayItemName("item-0001")
            ->withUserId("user-0001")
            ->withCount(1)
            ->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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.IncrementPurchaseCountByUserIdRequest;
import io.gs2.showcase.result.IncrementPurchaseCountByUserIdResult;

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

try {
    IncrementPurchaseCountByUserIdResult result = client.incrementPurchaseCountByUserId(
        new IncrementPurchaseCountByUserIdRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemName("item-0001")
            .withUserId("user-0001")
            .withCount(1)
            .withTimeOffsetToken(null)
    );
    RandomDisplayItem item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.IncrementPurchaseCountByUserIdRequest;
using Gs2.Gs2Showcase.Result.IncrementPurchaseCountByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.IncrementPurchaseCountByUserIdResult> asyncResult = null;
yield return client.IncrementPurchaseCountByUserId(
    new Gs2.Gs2Showcase.Request.IncrementPurchaseCountByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithDisplayItemName("item-0001")
        .WithUserId("user-0001")
        .WithCount(1)
        .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 Gs2Showcase from '@/gs2/showcase';

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

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

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

try:
    result = client.increment_purchase_count_by_user_id(
        showcase.IncrementPurchaseCountByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_display_item_name('item-0001')
            .with_user_id('user-0001')
            .with_count(1)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.increment_purchase_count_by_user_id({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemName="item-0001",
    userId="user-0001",
    count=1,
    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('showcase')

api_result_handler = client.increment_purchase_count_by_user_id_async({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemName="item-0001",
    userId="user-0001",
    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
item = result.item;

decrementPurchaseCountByUserId

Decrement the number of times a product has been purchased by specifying the user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsRandom Showcase Model Name
displayItemNamestring~ 128 charsRandom Displayed Item Name
userIdstring~ 128 charsUser Id
countint~ 100Number of purchase times to subtract
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemRandomDisplayItemRandomly displayed items after purchase counts are added

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DecrementPurchaseCountByUserId(
    &showcase.DecrementPurchaseCountByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        DisplayItemName: pointy.String("item-0001"),
        UserId: pointy.String("user-0001"),
        Count: pointy.Int32(1),
        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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DecrementPurchaseCountByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->decrementPurchaseCountByUserId(
        (new DecrementPurchaseCountByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withDisplayItemName("item-0001")
            ->withUserId("user-0001")
            ->withCount(1)
            ->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.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DecrementPurchaseCountByUserIdRequest;
import io.gs2.showcase.result.DecrementPurchaseCountByUserIdResult;

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

try {
    DecrementPurchaseCountByUserIdResult result = client.decrementPurchaseCountByUserId(
        new DecrementPurchaseCountByUserIdRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemName("item-0001")
            .withUserId("user-0001")
            .withCount(1)
            .withTimeOffsetToken(null)
    );
    RandomDisplayItem item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DecrementPurchaseCountByUserIdRequest;
using Gs2.Gs2Showcase.Result.DecrementPurchaseCountByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.DecrementPurchaseCountByUserIdResult> asyncResult = null;
yield return client.DecrementPurchaseCountByUserId(
    new Gs2.Gs2Showcase.Request.DecrementPurchaseCountByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithDisplayItemName("item-0001")
        .WithUserId("user-0001")
        .WithCount(1)
        .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 Gs2Showcase from '@/gs2/showcase';

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

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

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

try:
    result = client.decrement_purchase_count_by_user_id(
        showcase.DecrementPurchaseCountByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_display_item_name('item-0001')
            .with_user_id('user-0001')
            .with_count(1)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.decrement_purchase_count_by_user_id({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemName="item-0001",
    userId="user-0001",
    count=1,
    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('showcase')

api_result_handler = client.decrement_purchase_count_by_user_id_async({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemName="item-0001",
    userId="user-0001",
    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
item = result.item;

incrementPurchaseCountByStampTask

Execute the addition of the number of purchases as a consume action

Request

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

Result

TypeDescription
itemRandomDisplayItemRandomly displayed items after purchase counts are added
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/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.IncrementPurchaseCountByStampTask(
    &showcase.IncrementPurchaseCountByStampTaskRequest {
        StampTask: pointy.String("stampTask"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\IncrementPurchaseCountByStampTaskRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->incrementPurchaseCountByStampTask(
        (new IncrementPurchaseCountByStampTaskRequest())
            ->withStampTask(self::stampTask)
            ->withKeyId(self::key-0001)
    );
    $item = $result->getItem();
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.IncrementPurchaseCountByStampTaskRequest;
import io.gs2.showcase.result.IncrementPurchaseCountByStampTaskResult;

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

try {
    IncrementPurchaseCountByStampTaskResult result = client.incrementPurchaseCountByStampTask(
        new IncrementPurchaseCountByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    RandomDisplayItem item = result.getItem();
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.IncrementPurchaseCountByStampTaskRequest;
using Gs2.Gs2Showcase.Result.IncrementPurchaseCountByStampTaskResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.IncrementPurchaseCountByStampTaskResult> asyncResult = null;
yield return client.IncrementPurchaseCountByStampTask(
    new Gs2.Gs2Showcase.Request.IncrementPurchaseCountByStampTaskRequest()
        .WithStampTask("stampTask")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.incrementPurchaseCountByStampTask(
        new Gs2Showcase.IncrementPurchaseCountByStampTaskRequest()
            .withStampTask("stampTask")
            .withKeyId("key-0001")
    );
    const item = result.getItem();
    const newContextStack = result.getNewContextStack();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.increment_purchase_count_by_stamp_task(
        showcase.IncrementPurchaseCountByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.increment_purchase_count_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
item = result.item;
newContextStack = result.newContextStack;
client = gs2('showcase')

api_result_handler = client.increment_purchase_count_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
item = result.item;
newContextStack = result.newContextStack;

decrementPurchaseCountByStampSheet

Execute the subtraction of the number of purchases as an acquire action

Request

TypeConditionRequireDefaultLimitationDescription
stampSheetstring~ 5242880 charsTransaction
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemRandomDisplayItemRandomly displayed items after purchase counts are added

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DecrementPurchaseCountByStampSheet(
    &showcase.DecrementPurchaseCountByStampSheetRequest {
        StampSheet: pointy.String("stampSheet"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DecrementPurchaseCountByStampSheetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->decrementPurchaseCountByStampSheet(
        (new DecrementPurchaseCountByStampSheetRequest())
            ->withStampSheet(self::stampSheet)
            ->withKeyId(self::key-0001)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DecrementPurchaseCountByStampSheetRequest;
import io.gs2.showcase.result.DecrementPurchaseCountByStampSheetResult;

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

try {
    DecrementPurchaseCountByStampSheetResult result = client.decrementPurchaseCountByStampSheet(
        new DecrementPurchaseCountByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    RandomDisplayItem item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DecrementPurchaseCountByStampSheetRequest;
using Gs2.Gs2Showcase.Result.DecrementPurchaseCountByStampSheetResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.DecrementPurchaseCountByStampSheetResult> asyncResult = null;
yield return client.DecrementPurchaseCountByStampSheet(
    new Gs2.Gs2Showcase.Request.DecrementPurchaseCountByStampSheetRequest()
        .WithStampSheet("stampSheet")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.decrementPurchaseCountByStampSheet(
        new Gs2Showcase.DecrementPurchaseCountByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.decrement_purchase_count_by_stamp_sheet(
        showcase.DecrementPurchaseCountByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.decrement_purchase_count_by_stamp_sheet({
    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
item = result.item;
client = gs2('showcase')

api_result_handler = client.decrement_purchase_count_by_stamp_sheet_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
item = result.item;

forceReDrawByUserId

Re-draw the contents of the random display shelf by specifying the user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsRandom Showcase Model Name
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<RandomDisplayItem>Displayed items

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.ForceReDrawByUserId(
    &showcase.ForceReDrawByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\ForceReDrawByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    ForceReDrawByUserIdResult result = client.forceReDrawByUserId(
        new ForceReDrawByUserIdRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    List<RandomDisplayItem> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.ForceReDrawByUserIdRequest;
using Gs2.Gs2Showcase.Result.ForceReDrawByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.ForceReDrawByUserIdResult> asyncResult = null;
yield return client.ForceReDrawByUserId(
    new Gs2.Gs2Showcase.Request.ForceReDrawByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

try:
    result = client.force_re_draw_by_user_id(
        showcase.ForceReDrawByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

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

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

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

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

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

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

result = api_result.result
items = result.items;

forceReDrawByUserIdByStampSheet

Execute re-drawing of the contents of the random display shelf as an acquire action

Request

TypeConditionRequireDefaultLimitationDescription
stampSheetstring~ 5242880 charsTransaction
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemsList<RandomDisplayItem>Displayed items

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.ForceReDrawByUserIdByStampSheet(
    &showcase.ForceReDrawByUserIdByStampSheetRequest {
        StampSheet: pointy.String("stampSheet"),
        KeyId: pointy.String("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\ForceReDrawByUserIdByStampSheetRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->forceReDrawByUserIdByStampSheet(
        (new ForceReDrawByUserIdByStampSheetRequest())
            ->withStampSheet(self::stampSheet)
            ->withKeyId(self::key-0001)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.ForceReDrawByUserIdByStampSheetRequest;
import io.gs2.showcase.result.ForceReDrawByUserIdByStampSheetResult;

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

try {
    ForceReDrawByUserIdByStampSheetResult result = client.forceReDrawByUserIdByStampSheet(
        new ForceReDrawByUserIdByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    List<RandomDisplayItem> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.ForceReDrawByUserIdByStampSheetRequest;
using Gs2.Gs2Showcase.Result.ForceReDrawByUserIdByStampSheetResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.ForceReDrawByUserIdByStampSheetResult> asyncResult = null;
yield return client.ForceReDrawByUserIdByStampSheet(
    new Gs2.Gs2Showcase.Request.ForceReDrawByUserIdByStampSheetRequest()
        .WithStampSheet("stampSheet")
        .WithKeyId("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.forceReDrawByUserIdByStampSheet(
        new Gs2Showcase.ForceReDrawByUserIdByStampSheetRequest()
            .withStampSheet("stampSheet")
            .withKeyId("key-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.force_re_draw_by_user_id_by_stamp_sheet(
        showcase.ForceReDrawByUserIdByStampSheetRequest()
            .with_stamp_sheet(self.stamp_sheet)
            .with_key_id(self.key1.key_id)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.force_re_draw_by_user_id_by_stamp_sheet({
    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
items = result.items;
client = gs2('showcase')

api_result_handler = client.force_re_draw_by_user_id_by_stamp_sheet_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
items = result.items;

describeRandomDisplayItems

Obtain a list of products on a random display shelf

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsRandom Showcase Name
accessTokenstring~ 128 charsUser Id

Result

TypeDescription
itemsList<RandomDisplayItem>Displayed items

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DescribeRandomDisplayItems(
    &showcase.DescribeRandomDisplayItemsRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DescribeRandomDisplayItemsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeRandomDisplayItems(
        (new DescribeRandomDisplayItemsRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withAccessToken(self::$accessToken0001)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.DescribeRandomDisplayItemsRequest;
import io.gs2.showcase.result.DescribeRandomDisplayItemsResult;

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

try {
    DescribeRandomDisplayItemsResult result = client.describeRandomDisplayItems(
        new DescribeRandomDisplayItemsRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withAccessToken("accessToken-0001")
    );
    List<RandomDisplayItem> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DescribeRandomDisplayItemsRequest;
using Gs2.Gs2Showcase.Result.DescribeRandomDisplayItemsResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.DescribeRandomDisplayItemsResult> asyncResult = null;
yield return client.DescribeRandomDisplayItems(
    new Gs2.Gs2Showcase.Request.DescribeRandomDisplayItemsRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.describeRandomDisplayItems(
        new Gs2Showcase.DescribeRandomDisplayItemsRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withAccessToken("accessToken-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.describe_random_display_items(
        showcase.DescribeRandomDisplayItemsRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_access_token(self.access_token_0001)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.describe_random_display_items({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    accessToken="accessToken-0001",
})

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

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

api_result_handler = client.describe_random_display_items_async({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    accessToken="accessToken-0001",
})

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

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

result = api_result.result
items = result.items;

describeRandomDisplayItemsByUserId

Obtain Random Showcase Model by specifying user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsRandom Showcase Name
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<RandomDisplayItem>Displayed items

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.DescribeRandomDisplayItemsByUserId(
    &showcase.DescribeRandomDisplayItemsByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\DescribeRandomDisplayItemsByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

try {
    DescribeRandomDisplayItemsByUserIdResult result = client.describeRandomDisplayItemsByUserId(
        new DescribeRandomDisplayItemsByUserIdRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    List<RandomDisplayItem> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.DescribeRandomDisplayItemsByUserIdRequest;
using Gs2.Gs2Showcase.Result.DescribeRandomDisplayItemsByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.DescribeRandomDisplayItemsByUserIdResult> asyncResult = null;
yield return client.DescribeRandomDisplayItemsByUserId(
    new Gs2.Gs2Showcase.Request.DescribeRandomDisplayItemsByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

try:
    result = client.describe_random_display_items_by_user_id(
        showcase.DescribeRandomDisplayItemsByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

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

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

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

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

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

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

result = api_result.result
items = result.items;

getRandomDisplayItem

Obtain a products on a random display shelf

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsRandom Showcase Name
displayItemNamestringUUID~ 128 charsRandom Displayed Item ID
accessTokenstring~ 128 charsUser Id

Result

TypeDescription
itemRandomDisplayItemDisplayed item

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetRandomDisplayItem(
    &showcase.GetRandomDisplayItemRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        DisplayItemName: pointy.String("display-item-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetRandomDisplayItemRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getRandomDisplayItem(
        (new GetRandomDisplayItemRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withDisplayItemName("display-item-0001")
            ->withAccessToken(self::$accessToken0001)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetRandomDisplayItemRequest;
import io.gs2.showcase.result.GetRandomDisplayItemResult;

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

try {
    GetRandomDisplayItemResult result = client.getRandomDisplayItem(
        new GetRandomDisplayItemRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemName("display-item-0001")
            .withAccessToken("accessToken-0001")
    );
    RandomDisplayItem item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetRandomDisplayItemRequest;
using Gs2.Gs2Showcase.Result.GetRandomDisplayItemResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.GetRandomDisplayItemResult> asyncResult = null;
yield return client.GetRandomDisplayItem(
    new Gs2.Gs2Showcase.Request.GetRandomDisplayItemRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithDisplayItemName("display-item-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

try:
    result = client.get_random_display_item(
        showcase.GetRandomDisplayItemRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_display_item_name('display-item-0001')
            .with_access_token(self.access_token_0001)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.get_random_display_item({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemName="display-item-0001",
    accessToken="accessToken-0001",
})

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

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

api_result_handler = client.get_random_display_item_async({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemName="display-item-0001",
    accessToken="accessToken-0001",
})

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

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

result = api_result.result
item = result.item;

getRandomDisplayItemByUserId

Obtain Random Showcase Model by specifying user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsRandom Showcase Name
displayItemNamestringUUID~ 128 charsRandom Displayed Item ID
userIdstring~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemRandomDisplayItemDisplayed item

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.GetRandomDisplayItemByUserId(
    &showcase.GetRandomDisplayItemByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        DisplayItemName: pointy.String("display-item-0001"),
        UserId: pointy.String("user-0001"),
        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\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\GetRandomDisplayItemByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getRandomDisplayItemByUserId(
        (new GetRandomDisplayItemByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withDisplayItemName("display-item-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.GetRandomDisplayItemByUserIdRequest;
import io.gs2.showcase.result.GetRandomDisplayItemByUserIdResult;

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

try {
    GetRandomDisplayItemByUserIdResult result = client.getRandomDisplayItemByUserId(
        new GetRandomDisplayItemByUserIdRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemName("display-item-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    RandomDisplayItem item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.GetRandomDisplayItemByUserIdRequest;
using Gs2.Gs2Showcase.Result.GetRandomDisplayItemByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.GetRandomDisplayItemByUserIdResult> asyncResult = null;
yield return client.GetRandomDisplayItemByUserId(
    new Gs2.Gs2Showcase.Request.GetRandomDisplayItemByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithDisplayItemName("display-item-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

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

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

try:
    result = client.get_random_display_item_by_user_id(
        showcase.GetRandomDisplayItemByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_display_item_name('display-item-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.get_random_display_item_by_user_id({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemName="display-item-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

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

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

api_result_handler = client.get_random_display_item_by_user_id_async({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemName="display-item-0001",
    userId="user-0001",
    timeOffsetToken=nil,
})

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

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

result = api_result.result
item = result.item;

randomShowcaseBuy

Purchase products on a random display shelf

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsRandom Showcase Name
displayItemNamestringUUID~ 128 charsRandom Displayed Item ID
accessTokenstring~ 128 charsUser Id
quantityint11 ~ 1000Purchase Quantity
configList<Config>[]~ 32 itemsSet values to be applied to transaction variables

Result

TypeDescription
itemRandomDisplayItemDisplayed item
transactionIdstringIssed transaction ID
stampSheetstringStamp sheets used to execute the purchase process
stampSheetEncryptionKeyIdstringCryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheetbool?Is transaction auto-execution enabled?

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.RandomShowcaseBuy(
    &showcase.RandomShowcaseBuyRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        DisplayItemName: pointy.String("display-item-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Quantity: pointy.Int32(1),
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\RandomShowcaseBuyRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->randomShowcaseBuy(
        (new RandomShowcaseBuyRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withDisplayItemName("display-item-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withQuantity(1)
            ->withConfig(null)
    );
    $item = $result->getItem();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.RandomShowcaseBuyRequest;
import io.gs2.showcase.result.RandomShowcaseBuyResult;

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

try {
    RandomShowcaseBuyResult result = client.randomShowcaseBuy(
        new RandomShowcaseBuyRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemName("display-item-0001")
            .withAccessToken("accessToken-0001")
            .withQuantity(1)
            .withConfig(null)
    );
    RandomDisplayItem item = result.getItem();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.RandomShowcaseBuyRequest;
using Gs2.Gs2Showcase.Result.RandomShowcaseBuyResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.RandomShowcaseBuyResult> asyncResult = null;
yield return client.RandomShowcaseBuy(
    new Gs2.Gs2Showcase.Request.RandomShowcaseBuyRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithDisplayItemName("display-item-0001")
        .WithAccessToken("accessToken-0001")
        .WithQuantity(1)
        .WithConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.randomShowcaseBuy(
        new Gs2Showcase.RandomShowcaseBuyRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemName("display-item-0001")
            .withAccessToken("accessToken-0001")
            .withQuantity(1)
            .withConfig(null)
    );
    const item = result.getItem();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.random_showcase_buy(
        showcase.RandomShowcaseBuyRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_display_item_name('display-item-0001')
            .with_access_token(self.access_token_0001)
            .with_quantity(1)
            .with_config(None)
    )
    item = result.item
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.random_showcase_buy({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemName="display-item-0001",
    accessToken="accessToken-0001",
    quantity=1,
    config=nil,
})

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

result = api_result.result
item = result.item;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
client = gs2('showcase')

api_result_handler = client.random_showcase_buy_async({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemName="display-item-0001",
    accessToken="accessToken-0001",
    quantity=1,
    config=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;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;

randomShowcaseBuyByUserId

Purchase products on a random display shelf by specifying user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
showcaseNamestring~ 128 charsRandom Showcase Name
displayItemNamestringUUID~ 128 charsRandom Displayed Item ID
userIdstring~ 128 charsUser Id
quantityint11 ~ 1000Purchase Quantity
configList<Config>[]~ 32 itemsSet values to be applied to transaction variables
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemRandomDisplayItemDisplayed item
transactionIdstringIssed transaction ID
stampSheetstringStamp sheets used to execute the purchase process
stampSheetEncryptionKeyIdstringCryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheetbool?Is transaction auto-execution enabled?

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/showcase"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := showcase.Gs2ShowcaseRestClient{
    Session: &session,
}
result, err := client.RandomShowcaseBuyByUserId(
    &showcase.RandomShowcaseBuyByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        ShowcaseName: pointy.String("showcase-0001"),
        DisplayItemName: pointy.String("display-item-0001"),
        UserId: pointy.String("user-0001"),
        Quantity: pointy.Int32(1),
        Config: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Showcase\Gs2ShowcaseRestClient;
use Gs2\Showcase\Request\RandomShowcaseBuyByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->randomShowcaseBuyByUserId(
        (new RandomShowcaseBuyByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withShowcaseName("showcase-0001")
            ->withDisplayItemName("display-item-0001")
            ->withUserId("user-0001")
            ->withQuantity(1)
            ->withConfig(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.showcase.rest.Gs2ShowcaseRestClient;
import io.gs2.showcase.request.RandomShowcaseBuyByUserIdRequest;
import io.gs2.showcase.result.RandomShowcaseBuyByUserIdResult;

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

try {
    RandomShowcaseBuyByUserIdResult result = client.randomShowcaseBuyByUserId(
        new RandomShowcaseBuyByUserIdRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemName("display-item-0001")
            .withUserId("user-0001")
            .withQuantity(1)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    RandomDisplayItem item = result.getItem();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Showcase.Gs2ShowcaseRestClient;
using Gs2.Gs2Showcase.Request.RandomShowcaseBuyByUserIdRequest;
using Gs2.Gs2Showcase.Result.RandomShowcaseBuyByUserIdResult;

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

AsyncResult<Gs2.Gs2Showcase.Result.RandomShowcaseBuyByUserIdResult> asyncResult = null;
yield return client.RandomShowcaseBuyByUserId(
    new Gs2.Gs2Showcase.Request.RandomShowcaseBuyByUserIdRequest()
        .WithNamespaceName("namespace1")
        .WithShowcaseName("showcase-0001")
        .WithDisplayItemName("display-item-0001")
        .WithUserId("user-0001")
        .WithQuantity(1)
        .WithConfig(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
import Gs2Core from '@/gs2/core';
import * as Gs2Showcase from '@/gs2/showcase';

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

try {
    const result = await client.randomShowcaseBuyByUserId(
        new Gs2Showcase.RandomShowcaseBuyByUserIdRequest()
            .withNamespaceName("namespace1")
            .withShowcaseName("showcase-0001")
            .withDisplayItemName("display-item-0001")
            .withUserId("user-0001")
            .withQuantity(1)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import showcase

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

try:
    result = client.random_showcase_buy_by_user_id(
        showcase.RandomShowcaseBuyByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_showcase_name('showcase-0001')
            .with_display_item_name('display-item-0001')
            .with_user_id('user-0001')
            .with_quantity(1)
            .with_config(None)
            .with_time_offset_token(None)
    )
    item = result.item
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
except core.Gs2Exception as e:
    exit(1)
client = gs2('showcase')

api_result = client.random_showcase_buy_by_user_id({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemName="display-item-0001",
    userId="user-0001",
    quantity=1,
    config=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
client = gs2('showcase')

api_result_handler = client.random_showcase_buy_by_user_id_async({
    namespaceName="namespace1",
    showcaseName="showcase-0001",
    displayItemName="display-item-0001",
    userId="user-0001",
    quantity=1,
    config=nil,
    timeOffsetToken=nil,
})

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

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

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