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.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024 chars | Namespace GRN | ||
name | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
transactionSetting | TransactionSetting | ✓ | Transaction settings | |||
buyScript | ScriptSetting | Script to run when attempting to execute a purchase | ||||
logSetting | LogSetting | Log output settings | ||||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
SalesItemMaster
Product Master Data
Set the price required to purchase the product and the reward you will receive for purchasing the product.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
salesItemId | string | ✓ | ~ 1024 chars | Product Master GRN | ||
name | string | ✓ | ~ 128 chars | Product Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
verifyActions | List<VerifyAction> | ~ 10 items | List of Verify Action | |||
consumeActions | List<ConsumeAction> | ~ 10 items | List of Consumption Action | |||
acquireActions | List<AcquireAction> | ✓ | 1 ~ 100 items | List of Acquire Action | ||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
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.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
salesItemGroupId | string | ✓ | ~ 1024 chars | Product Group Master GRN | ||
name | string | ✓ | ~ 128 chars | Product Group Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
salesItemNames | List<string> | ✓ | 2 ~ 10 items | List of products to be included in the product group | ||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
ShowcaseMaster
Showcase Master
The sales period can be set for the display shelf.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
showcaseId | string | ✓ | ~ 1024 chars | Showcase master GRN | ||
name | string | ✓ | ~ 128 chars | Showcase Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
salesPeriodEventId | string | ~ 1024 chars | GS2-Schedule events with sales periods for display shelves | |||
displayItems | List<DisplayItemMaster> | ✓ | 1 ~ 1000 items | List of Products on display | ||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
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.
Note
Please refer to Master Data Reference of GS2-Showcase for the JSON file format.Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024 chars | Currently available showcase master GRN | ||
settings | string | ✓ | ~ 5242880 chars | Master data |
SalesItem
Product
Set the price required to purchase the product and the reward earned for the purchase of the product.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Product Name | ||
metadata | string | ~ 2048 chars | metadata | |||
verifyActions | List<VerifyAction> | [] | ~ 10 items | List of Verify Action | ||
consumeActions | List<ConsumeAction> | [] | ~ 10 items | List of Consumption Action | ||
acquireActions | List<AcquireAction> | ✓ | [] | 1 ~ 100 items | List 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.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Product Group Name | ||
metadata | string | ~ 2048 chars | metadata | |||
salesItems | List<SalesItem> | ✓ | [] | 2 ~ 10 items | Products to be included in the product group |
Showcase
Showcase
The sales period can be set for the display shelf.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
showcaseId | string | ✓ | ~ 1024 chars | Showcase GRN | ||
name | string | ✓ | ~ 128 chars | Showcase Name | ||
metadata | string | ~ 2048 chars | metadata | |||
salesPeriodEventId | string | ~ 1024 chars | GS2-Schedule events with sales periods for display shelves | |||
displayItems | List<DisplayItem> | ✓ | 1 ~ 1000 items | List of Products on display |
DisplayItem
Displayed Item
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
displayItemId | string | ✓ | UUID | ~ 128 chars | Displayed Item ID | |
type | enum { “salesItem”, “salesItemGroup” } | ✓ | ~ 128 chars | Type | ||
salesItem | SalesItem | {type} == “salesItem” | ✓ | Products to be displayed | ||
salesItemGroup | SalesItemGroup | {type} == “salesItemGroup” | ✓ | Product group to be displayed | ||
salesPeriodEventId | string | ~ 1024 chars | GS2-Schedule events with product sales periods |
Enumeration type definition to specify as type
Enumerator String Definition | Description |
---|---|
salesItem | Product |
salesItemGroup | Product Group |
DisplayItemMaster
Displayed Item Master Data
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
displayItemId | string | ✓ | UUID | ~ 128 chars | Displayed Item ID | |
type | enum { “salesItem”, “salesItemGroup” } | ✓ | ~ 128 chars | Type | ||
salesItemName | string | {type} == “salesItem” | ✓ | ~ 128 chars | Name of the product to be displayed | |
salesItemGroupName | string | {type} == “salesItemGroup” | ✓ | ~ 128 chars | Name of the product group to be displayed | |
salesPeriodEventId | string | ~ 1024 chars | Product group to be displayed | |||
revision | long | 0 | ~ 9223372036854775805 | Revision |
Enumeration type definition to specify as type
Enumerator String Definition | Description |
---|---|
salesItem | Product |
salesItemGroup | Product 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.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
showcaseId | string | ✓ | ~ 1024 chars | Random Showcase Model Master GRN | ||
name | string | ✓ | ~ 128 chars | Random Showcase Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
maximumNumberOfChoice | int | ✓ | 1 ~ 100 | Maximum number of products to be selected | ||
displayItems | List<RandomDisplayItemModel> | ✓ | 1 ~ 100 items | List of Products on display | ||
baseTimestamp | long | ✓ | Base time for re-drawing the products on display (Unix time unit:milliseconds) | |||
resetIntervalHours | int | ✓ | 1 ~ 168 | Interval (hours) between re-drawing the products on display | ||
salesPeriodEventId | string | ~ 1024 chars | GS2-Schedule events with sales periods for display shelves | |||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
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.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
randomShowcaseId | string | ✓ | ~ 1024 chars | Random Showcase Model GRN | ||
name | string | ✓ | ~ 128 chars | Random Showcase Name | ||
metadata | string | ~ 2048 chars | metadata | |||
maximumNumberOfChoice | int | ✓ | 1 ~ 100 | Maximum number of products to be selected | ||
displayItems | List<RandomDisplayItemModel> | ✓ | 1 ~ 100 items | List of Products on display | ||
baseTimestamp | long | ✓ | Base time for re-drawing the products on display (Unix time unit:milliseconds) | |||
resetIntervalHours | int | ✓ | 1 ~ 168 | Interval (hours) between re-drawing the products on display | ||
salesPeriodEventId | string | ~ 1024 chars | GS2-Schedule events with sales periods for display shelves |
PurchaseCount
Number of product purchases
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Random Displayed Item Name | ||
count | int | ✓ | 1 ~ 2147483646 | Purchase count |
RandomDisplayItem
Random displayable items on the Random Showcase
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
showcaseName | string | ✓ | ~ 128 chars | Random Displayed Item Name | ||
name | string | ✓ | UUID | ~ 128 chars | Random Displayed Item ID | |
metadata | string | ~ 2048 chars | metadata | |||
verifyActions | List<VerifyAction> | [] | ~ 10 items | List of Verify Action | ||
consumeActions | List<ConsumeAction> | [] | ~ 10 items | List of Consume Action | ||
acquireActions | List<AcquireAction> | ✓ | [] | 1 ~ 100 items | List of Acquire Action | |
currentPurchaseCount | int | ✓ | 1 ~ 2147483646 | Current purchase count | ||
maximumPurchaseCount | int | ✓ | 1 ~ 2147483646 | Maximum purchase count |
RandomDisplayItemModel
Random displayable items on the Random Showcase
You can set the probability of selecting items for the display shelf.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | UUID | ~ 128 chars | Random Displayed Item ID | |
metadata | string | ~ 2048 chars | metadata | |||
verifyActions | List<VerifyAction> | [] | ~ 10 items | List of Verify Action | ||
consumeActions | List<ConsumeAction> | [] | ~ 10 items | List of Consumption Action | ||
acquireActions | List<AcquireAction> | ✓ | [] | 1 ~ 100 items | List of Acquire Action | |
stock | int | ✓ | 1 ~ 2147483646 | Stock | ||
weight | int | ✓ | 1 ~ 2147483646 | Emission Weight |
ConsumeAction
Consume Action
VerifyAction
Verify Action
AcquireAction
Acquire Action
Config
Configration
Set values to be applied to transaction variables
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
key | string | ✓ | ~ 64 chars | Name | ||
value | string | ~ 51200 chars | Value |
VerifyActionResult
Verify action execution result
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128 chars | Types of actions to be performed in the verify task | ||
verifyRequest | string | ✓ | ~ 1048576 chars | JSON of request | ||
statusCode | int | ~ 999 | Status code | |||
verifyResult | string | ~ 1048576 chars | Result payload |
Enumeration type definition to specify as action
Enumerator String Definition | Description |
---|
ConsumeActionResult
Consume action execution result
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128 chars | Types of actions to be performed in the consume action | ||
consumeRequest | string | ✓ | ~ 1048576 chars | JSON of request | ||
statusCode | int | ~ 999 | Status code | |||
consumeResult | string | ~ 1048576 chars | Result payload |
Enumeration type definition to specify as action
Enumerator String Definition | Description |
---|
AcquireActionResult
Acquire action execution result
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128 chars | Types of actions to be performed in the acquire action | ||
acquireRequest | string | ✓ | ~ 1048576 chars | JSON of request | ||
statusCode | int | ~ 999 | Status code | |||
acquireResult | string | ~ 1048576 chars | Result payload |
Enumeration type definition to specify as action
Enumerator String Definition | Description |
---|
TransactionResult
Transaction execution results
Transaction execution results executed using server-side transaction auto-execution functionality
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
transactionId | string | ✓ | 36 ~ 36 chars | Transaction ID | ||
verifyResults | List<VerifyActionResult> | ~ 10 items | List of verify action execution results | |||
consumeResults | List<ConsumeActionResult> | ~ 10 items | List of consume action execution results | |||
acquireResults | List<AcquireActionResult> | ~ 100 items | List of acquire action execution results |
GitHubCheckoutSetting
Setup to check out master data from GitHub
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
apiKeyId | string | ✓ | ~ 1024 chars | GitHub API key GRN | ||
repositoryName | string | ✓ | ~ 1024 chars | Repository Name | ||
sourcePath | string | ✓ | ~ 1024 chars | Source code file path | ||
referenceType | enum { “commit_hash”, “branch”, “tag” } | ✓ | ~ 128 chars | Source of code | ||
commitHash | string | {referenceType} == “commit_hash” | ✓ | ~ 1024 chars | Commit hash | |
branchName | string | {referenceType} == “branch” | ✓ | ~ 1024 chars | Branch Name | |
tagName | string | {referenceType} == “tag” | ✓ | ~ 1024 chars | Tag Name |
Enumeration type definition to specify as referenceType
Enumerator String Definition | Description |
---|---|
commit_hash | Commit hash |
branch | Branch |
tag | Tag |
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.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
loggingNamespaceId | string | ✓ | ~ 1024 chars | Namespace GRN |
TransactionSetting
Transaction settings
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
enableAutoRun | bool | ✓ | false | Whether to automatically execute issued transactions on the server side | ||
enableAtomicCommit | bool | {enableAutoRun} == true | ✓ | false | Whether to commit the execution of transactions atomically | |
transactionUseDistributor | bool | {enableAtomicCommit} == true | ✓ | false | Whether to execute transactions asynchronously | |
acquireActionUseJobQueue | bool | {enableAtomicCommit} == true | ✓ | false | Whether to use GS2-JobQueue to execute the acquire action | |
distributorNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024 chars | GS2-Distributor namespace used for transaction execution | |
queueNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024 chars | Namespace 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.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
triggerScriptId | string | ~ 1024 chars | Script GRN | |||
doneTriggerTargetType | enum { “none”, “gs2_script”, “aws” } | ✓ | “none” | ~ 128 chars | Notification of Completion | |
doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | Script GRN | ||
doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | Namespace GRN |
Enumeration type definition to specify as doneTriggerTargetType
Enumerator String Definition | Description |
---|---|
none | None |
gs2_script | GS2-Script |
aws | Amazon EventBridge |
Methods
describeNamespaces
Get list of namespaces
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<Namespace> | List of Namespace |
nextPageToken | string | Page 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
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
transactionSetting | TransactionSetting | ✓ | Transaction settings | |||
buyScript | ScriptSetting | Script to run when attempting to execute a purchase | ||||
queueNamespaceId | string | ~ 1024 chars | Namespace GRN in GS2-JobQueue used to run the transaction | |||
keyId | string | ~ 1024 chars | GS2-Key namespace used to issue transactions | |||
logSetting | LogSetting | Log output settings |
Result
Type | Description | |
---|---|---|
item | Namespace | Namespace 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("namespace-0001"),
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:namespace-0001:key:key-0001"),
},
BuyScript: nil,
LogSetting: &showcase.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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\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("namespace-0001")
->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:namespace-0001:key:key-0001"))
->withBuyScript(null)
->withLogSetting((new \Gs2\Showcase\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.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("namespace-0001")
.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:namespace-0001:key:key-0001"))
.withBuyScript(null)
.withLogSetting(new io.gs2.showcase.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
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("namespace-0001")
.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:namespace-0001:key:key-0001"))
.WithBuyScript(null)
.WithLogSetting(new Gs2.Gs2Showcase.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.createNamespace(
new Gs2Showcase.CreateNamespaceRequest()
.withName("namespace-0001")
.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:namespace-0001:key:key-0001"))
.withBuyScript(null)
.withLogSetting(new Gs2Showcase.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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_namespace(
showcase.CreateNamespaceRequest()
.with_name('namespace-0001')
.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:namespace-0001:key:key-0001'))
.with_buy_script(None)
.with_log_setting(
showcase.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('showcase')
api_result = client.create_namespace({
name="namespace-0001",
description=nil,
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001",
},
buyScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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_namespace_async({
name="namespace-0001",
description=nil,
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001",
},
buyScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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;
getNamespaceStatus
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
status | string |
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("namespace-0001"),
}
)
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("namespace-0001")
);
$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("namespace-0001")
);
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("namespace-0001"),
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("namespace-0001")
);
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('namespace-0001')
)
status = result.status
except core.Gs2Exception as e:
exit(1)
client = gs2('showcase')
api_result = client.get_namespace_status({
namespaceName="namespace-0001",
})
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="namespace-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
status = result.status;
getNamespace
Get namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | Namespace | 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.GetNamespace(
&showcase.GetNamespaceRequest {
NamespaceName: pointy.String("namespace-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\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("namespace-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.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("namespace-0001")
);
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("namespace-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.getNamespace(
new Gs2Showcase.GetNamespaceRequest()
.withNamespaceName("namespace-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_namespace(
showcase.GetNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('showcase')
api_result = client.get_namespace({
namespaceName="namespace-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_namespace_async({
namespaceName="namespace-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;
updateNamespace
Update namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
transactionSetting | TransactionSetting | ✓ | Transaction settings | |||
buyScript | ScriptSetting | Script to run when attempting to execute a purchase | ||||
logSetting | LogSetting | Log output settings | ||||
queueNamespaceId | string | ~ 1024 chars | Namespace GRN in GS2-JobQueue used to run the transaction | |||
keyId | string | ~ 1024 chars | GS2-Key namespace used to issue transactions |
Result
Type | Description | |
---|---|---|
item | Namespace | Updated 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("namespace-0001"),
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:namespace-0001:key:key-0002"),
},
BuyScript: nil,
LogSetting: &showcase.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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\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("namespace-0001")
->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:namespace-0001:key:key-0002"))
->withBuyScript(null)
->withLogSetting((new \Gs2\Showcase\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.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("namespace-0001")
.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:namespace-0001:key:key-0002"))
.withBuyScript(null)
.withLogSetting(new io.gs2.showcase.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
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("namespace-0001")
.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:namespace-0001:key:key-0002"))
.WithBuyScript(null)
.WithLogSetting(new Gs2.Gs2Showcase.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.updateNamespace(
new Gs2Showcase.UpdateNamespaceRequest()
.withNamespaceName("namespace-0001")
.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:namespace-0001:key:key-0002"))
.withBuyScript(null)
.withLogSetting(new Gs2Showcase.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.update_namespace(
showcase.UpdateNamespaceRequest()
.with_namespace_name('namespace-0001')
.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:namespace-0001:key:key-0002'))
.with_buy_script(None)
.with_log_setting(
showcase.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('showcase')
api_result = client.update_namespace({
namespaceName="namespace-0001",
description="description1",
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0002",
},
buyScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.update_namespace_async({
namespaceName="namespace-0001",
description="description1",
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0002",
},
buyScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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;
deleteNamespace
Delete namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | Namespace | Deleted 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("namespace-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\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("namespace-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.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("namespace-0001")
);
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("namespace-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.deleteNamespace(
new Gs2Showcase.DeleteNamespaceRequest()
.withNamespaceName("namespace-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_namespace(
showcase.DeleteNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('showcase')
api_result = client.delete_namespace({
namespaceName="namespace-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_namespace_async({
namespaceName="namespace-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;
dumpUserDataByUserId
Get dump data of the data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
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
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
url | string | URL 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
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
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
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
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
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
uploadToken | string | Token used to reflect results after upload |
uploadUrl | string | URL 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
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
uploadToken | string | ✓ | ~ 1024 chars | Token received in preparation for upload | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
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
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
uploadToken | string | ✓ | ~ 1024 chars | Token received in preparation for upload | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
url | string | URL 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
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<SalesItemMaster> | List of Product Masters |
nextPageToken | string | Page 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("namespace-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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("namespace-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
.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("namespace-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
.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('namespace-0001')
.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="namespace-0001",
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="namespace-0001",
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
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
name | string | ✓ | ~ 128 chars | Product Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
verifyActions | List<VerifyAction> | ~ 10 items | List of Verify Action | |||
consumeActions | List<ConsumeAction> | ~ 10 items | List of Consumption Action | |||
acquireActions | List<AcquireAction> | ✓ | 1 ~ 100 items | List of Acquire Action |
Result
Type | Description | |
---|---|---|
item | SalesItemMaster | Created 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("namespace-0001"),
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("namespace-0001")
->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("namespace-0001")
.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("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.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="namespace-0001",
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="namespace-0001",
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
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
salesItemName | string | ✓ | ~ 128 chars | Product Name |
Result
Type | Description | |
---|---|---|
item | SalesItemMaster | 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.GetSalesItemMaster(
&showcase.GetSalesItemMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
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("namespace-0001")
->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("namespace-0001")
.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("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.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="namespace-0001",
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="namespace-0001",
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
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
salesItemName | string | ✓ | ~ 128 chars | Product Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
verifyActions | List<VerifyAction> | ~ 10 items | List of Verify Action | |||
consumeActions | List<ConsumeAction> | ~ 10 items | List of Consumption Action | |||
acquireActions | List<AcquireAction> | ✓ | 1 ~ 100 items | List of Acquire Action |
Result
Type | Description | |
---|---|---|
item | SalesItemMaster | Updated 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("namespace-0001"),
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("namespace-0001")
->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("namespace-0001")
.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("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.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="namespace-0001",
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="namespace-0001",
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
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
salesItemName | string | ✓ | ~ 128 chars | Product Name |
Result
Type | Description | |
---|---|---|
item | SalesItemMaster | Deleted 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("namespace-0001"),
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("namespace-0001")
->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("namespace-0001")
.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("namespace-0001")
.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("namespace-0001")
.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('namespace-0001')
.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="namespace-0001",
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="namespace-0001",
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
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<SalesItemGroupMaster> | List of Product Group Master |
nextPageToken | string | Page 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("namespace-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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("namespace-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace-0001")
.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("namespace-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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("namespace-0001")
.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('namespace-0001')
.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="namespace-0001",
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="namespace-0001",
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
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
name | string | ✓ | ~ 128 chars | Product Group Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
salesItemNames | List<string> | ✓ | 2 ~ 10 items | List of products to be included in the product group |
Result
Type | Description | |
---|---|---|
item | SalesItemGroupMaster | Created 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("namespace-0001"),
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("namespace-0001")
->withName("sales-item-group-0001")
->withDescription(null)
->withMetadata(null)
->withSalesItemNames([
"salesItem-0001",
"salesItem-0002",
])
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import