API Reference of GS2-LoginReward 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 | |||
receiveScript | ScriptSetting | Script to run when receiving rewards | ||||
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 |
BonusModelMaster
Bonus Model Set the distribution schedule of login bonuses. There are two types of distribution schedules: “Schedule Mode” and “Streaming Mode”.
In Schedule Mode, the GS2-Schedule event is required, and the bonus is distributed based on the number of days elapsed since the start of the event. If you miss a shot in the middle, you will not receive the bonus for that shot.
In Streaming Mode, the rewards set for the bonus are distributed one by one from the beginning every day. In Streaming Mode, you can set it to repeat. In that case, if you reach the end of the stream, you will start distributing from the beginning again.
Both Schedule Mode and Streaming Mode have a rescue function for missed shots. By paying a certain cost, you can receive the bonus you missed. However, if the GS2-Schedule event is associated, you can only receive the bonus after the number of days elapsed since the start of the event. The missed capture function is not available in streaming mode and when repetition is enabled.
The maximum number of days of bonuses that can be set in both Scheduled and Streaming modes is 100 days.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
bonusModelId | string | ✓ | ~ 1024 chars | Login Reward Model Master Data GRN | ||
name | string | ✓ | ~ 128 chars | Login Bonus Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
mode | enum { “schedule”, “streaming” } | ✓ | ~ 128 chars | mode | ||
periodEventId | string | ~ 1024 chars | GS2-Schedule Event GRN that represents the period during which to enable login bonuses | |||
resetHour | int | {periodEventId} == "" | ✓ | ~ 23 | Reset time of the receive flag (UTC) | |
repeat | enum { “enabled”, “disabled” } | {mode} == “streaming” | ✓ | ~ 128 chars | Whether to repeat when the end of the stream is reached | |
rewards | List<Reward> | ~ 100 items | List of rewards | |||
missedReceiveRelief | enum { “enabled”, “disabled” } | ✓ | “disabled” | ~ 128 chars | Missed Rescue Function | |
missedReceiveReliefVerifyActions | List<VerifyAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | List of verify actions for missed receive relief | ||
missedReceiveReliefConsumeActions | List<ConsumeAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | List of consumption actions for missed receive relief | ||
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 |
Enumeration type definition to specify as mode
Enumerator String Definition | Description |
---|---|
schedule | Schedule Mode |
streaming | Streaming Mode |
Enumeration type definition to specify as repeat
Enumerator String Definition | Description |
---|---|
enabled | Enabled |
disabled | Disabled |
Enumeration type definition to specify as missedReceiveRelief
Enumerator String Definition | Description |
---|---|
enabled | Enabled |
disabled | Disabled |
CurrentBonusMaster
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-LoginReward for the JSON file format.Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024 chars | Currently available login reward master data GRN | ||
settings | string | ✓ | ~ 5242880 chars | Master data |
BonusModel
Bonus Model Set the distribution schedule of login bonuses. There are two types of distribution schedules: “Schedule Mode” and “Streaming Mode”.
In Schedule Mode, the GS2-Schedule event is required, and the bonus is distributed based on the number of days elapsed since the start of the event. If you miss a shot in the middle, you will not receive the bonus for that shot.
In Streaming Mode, the rewards set for the bonus are distributed one by one from the beginning every day. In Streaming Mode, you can set it to repeat. In that case, if you reach the end of the stream, you will start distributing from the beginning again.
Both Schedule Mode and Streaming Mode have a rescue function for missed shots. By paying a certain cost, you can receive the bonus you missed. However, if the GS2-Schedule event is associated, you can only receive the bonus after the number of days elapsed since the start of the event. The missed capture function is not available in streaming mode and when repetition is enabled.
The maximum number of days of bonuses that can be set in both Scheduled and Streaming modes is 100 days.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
bonusModelId | string | ✓ | ~ 1024 chars | Login Bonus Model GRN | ||
name | string | ✓ | ~ 128 chars | Bonus Model Name | ||
metadata | string | ~ 2048 chars | metadata | |||
mode | enum { “schedule”, “streaming” } | ✓ | ~ 128 chars | mode | ||
periodEventId | string | ~ 1024 chars | GS2-Schedule Event GRN that represents the period during which to enable login bonuses | |||
resetHour | int | {periodEventId} == "" | ✓ | ~ 23 | Reset time of the receive flag (UTC) | |
repeat | enum { “enabled”, “disabled” } | {mode} == “streaming” | ✓ | ~ 128 chars | Reset time of the receive flag (UTC) | |
rewards | List<Reward> | ~ 100 items | List of rewards | |||
missedReceiveRelief | enum { “enabled”, “disabled” } | ✓ | “disabled” | ~ 128 chars | Missed Rescue Function | |
missedReceiveReliefVerifyActions | List<VerifyAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | List of verify actions for missed receive relief | ||
missedReceiveReliefConsumeActions | List<ConsumeAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | List of consume actions for missed receive relief |
Enumeration type definition to specify as mode
Enumerator String Definition | Description |
---|---|
schedule | Schedule Mode |
streaming | Streaming Mode |
Enumeration type definition to specify as repeat
Enumerator String Definition | Description |
---|---|
enabled | Enabled |
disabled | Disabled |
Enumeration type definition to specify as missedReceiveRelief
Enumerator String Definition | Description |
---|---|
enabled | Enabled |
disabled | Disabled |
Reward
Reward
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
acquireActions | List<AcquireAction> | ✓ | 1 ~ 10 items | List of Acquire Action |
ReceiveStatus
Receive status
This model holds the receive status of login bonuses.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
receiveStatusId | string | ✓ | ~ 1024 chars | Receive status GRN | ||
bonusModelName | string | ✓ | ~ 128 chars | Bonus Model Name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
receivedSteps | List<bool> | ~ 100 items | List of received flags | |||
lastReceivedAt | long | ✓ | 0 | Last received time (Unix time unit:milliseconds) | ||
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 |
ConsumeAction
Consume Action
AcquireAction
Acquire Action
VerifyAction
Verify 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 |
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 | Automatically run issued transactions on the server side, or | ||
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DescribeNamespacesRequest;
import io.gs2.loginReward.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DescribeNamespacesRequest;
using Gs2.Gs2LoginReward.Result.DescribeNamespacesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2LoginReward.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 login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.describe_namespaces(
login_reward.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('loginReward')
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('loginReward')
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 | |||
receiveScript | ScriptSetting | Script to run when receiving rewards | ||||
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.CreateNamespace(
&login_reward.CreateNamespaceRequest {
Name: pointy.String("namespace1"),
Description: nil,
TransactionSetting: &loginReward.TransactionSetting{
EnableAutoRun: pointy.Bool(false),
QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"),
KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"),
},
ReceiveScript: nil,
LogSetting: &loginReward.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\CreateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createNamespace(
(new CreateNamespaceRequest())
->withName(self::namespace1)
->withDescription(null)
->withTransactionSetting((new \Gs2\LoginReward\Model\TransactionSetting())
->withEnableAutoRun(False)
->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
->withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:\namespace1:key:key-0001"))
->withReceiveScript(null)
->withLogSetting((new \Gs2\LoginReward\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.CreateNamespaceRequest;
import io.gs2.loginReward.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withTransactionSetting(new io.gs2.loginReward.model.TransactionSetting()
.withEnableAutoRun(false)
.withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
.withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
.withReceiveScript(null)
.withLogSetting(new io.gs2.loginReward.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.CreateNamespaceRequest;
using Gs2.Gs2LoginReward.Result.CreateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2LoginReward.Request.CreateNamespaceRequest()
.WithName("namespace1")
.WithDescription(null)
.WithTransactionSetting(new Gs2.Gs2LoginReward.Model.TransactionSetting()
.WithEnableAutoRun(false)
.WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
.WithKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
.WithReceiveScript(null)
.WithLogSetting(new Gs2.Gs2LoginReward.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.createNamespace(
new Gs2LoginReward.CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withTransactionSetting(new Gs2LoginReward.model.TransactionSetting()
.withEnableAutoRun(false)
.withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
.withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
.withReceiveScript(null)
.withLogSetting(new Gs2LoginReward.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.create_namespace(
login_reward.CreateNamespaceRequest()
.with_name(self.hash1)
.with_description(None)
.with_transaction_setting(
login_reward.TransactionSetting()
.with_enable_auto_run(False)
.with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001')
.with_key_id('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001'))
.with_receive_script(None)
.with_log_setting(
login_reward.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.create_namespace({
name="namespace1",
description=nil,
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001",
},
receiveScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('loginReward')
api_result_handler = client.create_namespace_async({
name="namespace1",
description=nil,
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001",
},
receiveScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getNamespaceStatus
Request
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.GetNamespaceStatus(
&login_reward.GetNamespaceStatusRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\GetNamespaceStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getNamespaceStatus(
(new GetNamespaceStatusRequest())
->withNamespaceName(self::namespace1)
);
$status = $result->getStatus();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.GetNamespaceStatusRequest;
import io.gs2.loginReward.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
GetNamespaceStatusResult result = client.getNamespaceStatus(
new GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
String status = result.getStatus();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.GetNamespaceStatusRequest;
using Gs2.Gs2LoginReward.Result.GetNamespaceStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2LoginReward.Request.GetNamespaceStatusRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2LoginReward.GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.get_namespace_status(
login_reward.GetNamespaceStatusRequest()
.with_namespace_name(self.hash1)
)
status = result.status
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.get_namespace_status({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
client = gs2('loginReward')
api_result_handler = client.get_namespace_status_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
getNamespace
Get namespace
Request
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.GetNamespace(
&login_reward.GetNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\GetNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getNamespace(
(new GetNamespaceRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.GetNamespaceRequest;
import io.gs2.loginReward.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
GetNamespaceResult result = client.getNamespace(
new GetNamespaceRequest()
.withNamespaceName("namespace1")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.GetNamespaceRequest;
using Gs2.Gs2LoginReward.Result.GetNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2LoginReward.Request.GetNamespaceRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.getNamespace(
new Gs2LoginReward.GetNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.get_namespace(
login_reward.GetNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.get_namespace({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('loginReward')
api_result_handler = client.get_namespace_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateNamespace
Update namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
transactionSetting | TransactionSetting | ✓ | Transaction settings | |||
receiveScript | ScriptSetting | Script to run when receiving rewards | ||||
logSetting | LogSetting | Log output settings |
Result
Type | Description | |
---|---|---|
item | Namespace | Updated namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.UpdateNamespace(
&login_reward.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
Description: pointy.String("description1"),
TransactionSetting: &loginReward.TransactionSetting{
EnableAutoRun: pointy.Bool(false),
QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"),
KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"),
},
ReceiveScript: nil,
LogSetting: &loginReward.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\UpdateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateNamespace(
(new UpdateNamespaceRequest())
->withNamespaceName(self::namespace1)
->withDescription("description1")
->withTransactionSetting((new \Gs2\LoginReward\Model\TransactionSetting())
->withEnableAutoRun(False)
->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
->withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:\namespace1:key:key-0002"))
->withReceiveScript(null)
->withLogSetting((new \Gs2\LoginReward\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.UpdateNamespaceRequest;
import io.gs2.loginReward.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withTransactionSetting(new io.gs2.loginReward.model.TransactionSetting()
.withEnableAutoRun(false)
.withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
.withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
.withReceiveScript(null)
.withLogSetting(new io.gs2.loginReward.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.UpdateNamespaceRequest;
using Gs2.Gs2LoginReward.Result.UpdateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2LoginReward.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace1")
.WithDescription("description1")
.WithTransactionSetting(new Gs2.Gs2LoginReward.Model.TransactionSetting()
.WithEnableAutoRun(false)
.WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
.WithKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
.WithReceiveScript(null)
.WithLogSetting(new Gs2.Gs2LoginReward.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2LoginReward.UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withTransactionSetting(new Gs2LoginReward.model.TransactionSetting()
.withEnableAutoRun(false)
.withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
.withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
.withReceiveScript(null)
.withLogSetting(new Gs2LoginReward.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.update_namespace(
login_reward.UpdateNamespaceRequest()
.with_namespace_name(self.hash1)
.with_description('description1')
.with_transaction_setting(
login_reward.TransactionSetting()
.with_enable_auto_run(False)
.with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002')
.with_key_id('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002'))
.with_receive_script(None)
.with_log_setting(
login_reward.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.update_namespace({
namespaceName="namespace1",
description="description1",
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002",
},
receiveScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('loginReward')
api_result_handler = client.update_namespace_async({
namespaceName="namespace1",
description="description1",
transactionSetting={
enableAutoRun=false,
queueNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002",
keyId="grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002",
},
receiveScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteNamespace
Delete namespace
Request
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DeleteNamespace(
&login_reward.DeleteNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\DeleteNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteNamespace(
(new DeleteNamespaceRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DeleteNamespaceRequest;
import io.gs2.loginReward.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DeleteNamespaceResult result = client.deleteNamespace(
new DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DeleteNamespaceRequest;
using Gs2.Gs2LoginReward.Result.DeleteNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2LoginReward.Request.DeleteNamespaceRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2LoginReward.DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.delete_namespace(
login_reward.DeleteNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.delete_namespace({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('loginReward')
api_result_handler = client.delete_namespace_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
dumpUserDataByUserId
Get dump data of the data associated with the specified user ID
Request
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DumpUserDataByUserId(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DumpUserDataByUserIdRequest;
import io.gs2.loginReward.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2LoginReward.Result.DumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.dumpUserDataByUserId(
new Gs2LoginReward.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.dump_user_data_by_user_id(
login_reward.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
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('loginReward')
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.loginReward.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2LoginReward.Result.CheckDumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.checkDumpUserDataByUserId(
new Gs2LoginReward.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.check_dump_user_data_by_user_id(
login_reward.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
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('loginReward')
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.CleanUserDataByUserId(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.CleanUserDataByUserIdRequest;
import io.gs2.loginReward.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2LoginReward.Result.CleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.cleanUserDataByUserId(
new Gs2LoginReward.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.clean_user_data_by_user_id(
login_reward.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
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('loginReward')
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.loginReward.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2LoginReward.Result.CheckCleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.checkCleanUserDataByUserId(
new Gs2LoginReward.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.check_clean_user_data_by_user_id(
login_reward.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
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('loginReward')
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.loginReward.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2LoginReward.Result.PrepareImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.prepareImportUserDataByUserId(
new Gs2LoginReward.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 login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.prepare_import_user_data_by_user_id(
login_reward.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('loginReward')
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('loginReward')
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.ImportUserDataByUserId(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.ImportUserDataByUserIdRequest;
import io.gs2.loginReward.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2LoginReward.Result.ImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.importUserDataByUserId(
new Gs2LoginReward.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.import_user_data_by_user_id(
login_reward.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('loginReward')
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('loginReward')
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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
&login_reward.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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.CheckImportUserDataByUserIdRequest;
import io.gs2.loginReward.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2LoginReward.Result.CheckImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2LoginReward.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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.checkImportUserDataByUserId(
new Gs2LoginReward.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 login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.check_import_user_data_by_user_id(
login_reward.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('loginReward')
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('loginReward')
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;
describeBonusModelMasters
Obtain list of Login Bonus Model 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<BonusModelMaster> | List of Login Bonus Model 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/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DescribeBonusModelMasters(
&login_reward.DescribeBonusModelMastersRequest {
NamespaceName: pointy.String("namespace1"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\DescribeBonusModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeBonusModelMasters(
(new DescribeBonusModelMastersRequest())
->withNamespaceName(self::namespace1)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DescribeBonusModelMastersRequest;
import io.gs2.loginReward.result.DescribeBonusModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DescribeBonusModelMastersResult result = client.describeBonusModelMasters(
new DescribeBonusModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<BonusModelMaster> 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DescribeBonusModelMastersRequest;
using Gs2.Gs2LoginReward.Result.DescribeBonusModelMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DescribeBonusModelMastersResult> asyncResult = null;
yield return client.DescribeBonusModelMasters(
new Gs2.Gs2LoginReward.Request.DescribeBonusModelMastersRequest()
.WithNamespaceName("namespace1")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.describeBonusModelMasters(
new Gs2LoginReward.DescribeBonusModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.describe_bonus_model_masters(
login_reward.DescribeBonusModelMastersRequest()
.with_namespace_name(self.hash1)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.describe_bonus_model_masters({
namespaceName="namespace1",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('loginReward')
api_result_handler = client.describe_bonus_model_masters_async({
namespaceName="namespace1",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createBonusModelMaster
Create a new Login Bonus Model Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
name | string | ✓ | ~ 128 chars | Login Bonus Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
mode | enum { “schedule”, “streaming” } | ✓ | ~ 128 chars | mode | ||
periodEventId | string | ~ 1024 chars | GS2-Schedule Event GRN that represents the period during which to enable login bonuses | |||
resetHour | int | {periodEventId} == "" | ✓ | ~ 23 | Reset time of the receive flag (UTC) | |
repeat | enum { “enabled”, “disabled” } | {mode} == “streaming” | ✓ | ~ 128 chars | Whether to repeat when the end of the stream is reached | |
rewards | List<Reward> | ~ 100 items | List of rewards | |||
missedReceiveRelief | enum { “enabled”, “disabled” } | ✓ | “disabled” | ~ 128 chars | Missed Rescue Function | |
missedReceiveReliefVerifyActions | List<VerifyAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | List of verify actions for missed receive relief | ||
missedReceiveReliefConsumeActions | List<ConsumeAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | List of consumption actions for missed receive relief |
Enumeration type definition to specify as mode
Enumerator String Definition | Description |
---|---|
schedule | Schedule Mode |
streaming | Streaming Mode |
Enumeration type definition to specify as repeat
Enumerator String Definition | Description |
---|---|
enabled | Enabled |
disabled | Disabled |
Enumeration type definition to specify as missedReceiveRelief
Enumerator String Definition | Description |
---|---|
enabled | Enabled |
disabled | Disabled |
Result
Type | Description | |
---|---|---|
item | BonusModelMaster | Created Login Bonus Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.CreateBonusModelMaster(
&login_reward.CreateBonusModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
Name: pointy.String("bonusModel-0001"),
Description: nil,
Metadata: nil,
Mode: pointy.String("schedule"),
PeriodEventId: pointy.String("grn:gs2:schedule:grn-0001"),
ResetHour: nil,
Repeat: nil,
Rewards: []loginReward.Reward{
loginReward.Reward{
AcquireActions: []loginReward.AcquireAction{
loginReward.AcquireAction{
Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
Request: pointy.String("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
},
},
},
loginReward.Reward{
AcquireActions: []loginReward.AcquireAction{
loginReward.AcquireAction{
Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
Request: pointy.String("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
},
},
},
loginReward.Reward{
AcquireActions: []loginReward.AcquireAction{
loginReward.AcquireAction{
Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
Request: pointy.String("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
},
},
},
},
MissedReceiveRelief: pointy.String("disabled"),
MissedReceiveReliefVerifyActions: nil,
MissedReceiveReliefConsumeActions: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\CreateBonusModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createBonusModelMaster(
(new CreateBonusModelMasterRequest())
->withNamespaceName(self::namespace1)
->withName("bonusModel-0001")
->withDescription(null)
->withMetadata(null)
->withMode("schedule")
->withPeriodEventId("grn:gs2:schedule:grn-0001")
->withResetHour(null)
->withRepeat(null)
->withRewards([
(new \Gs2\LoginReward\Model\Reward())
->withAcquireActions([
(new \Gs2\LoginReward\Model\AcquireAction())
->withAction("Gs2Stamina:RecoverStaminaByUserId")
->withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
(new \Gs2\LoginReward\Model\Reward())
->withAcquireActions([
(new \Gs2\LoginReward\Model\AcquireAction())
->withAction("Gs2Stamina:RecoverStaminaByUserId")
->withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
(new \Gs2\LoginReward\Model\Reward())
->withAcquireActions([
(new \Gs2\LoginReward\Model\AcquireAction())
->withAction("Gs2Stamina:RecoverStaminaByUserId")
->withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
])
->withMissedReceiveRelief("disabled")
->withMissedReceiveReliefVerifyActions(null)
->withMissedReceiveReliefConsumeActions(null)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.CreateBonusModelMasterRequest;
import io.gs2.loginReward.result.CreateBonusModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
CreateBonusModelMasterResult result = client.createBonusModelMaster(
new CreateBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withName("bonusModel-0001")
.withDescription(null)
.withMetadata(null)
.withMode("schedule")
.withPeriodEventId("grn:gs2:schedule:grn-0001")
.withResetHour(null)
.withRepeat(null)
.withRewards(Arrays.asList(
new io.gs2.loginReward.model.Reward()
.withAcquireActions(Arrays.asList(
new io.gs2.loginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
)),
new io.gs2.loginReward.model.Reward()
.withAcquireActions(Arrays.asList(
new io.gs2.loginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
)),
new io.gs2.loginReward.model.Reward()
.withAcquireActions(Arrays.asList(
new io.gs2.loginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
))
))
.withMissedReceiveRelief("disabled")
.withMissedReceiveReliefVerifyActions(null)
.withMissedReceiveReliefConsumeActions(null)
);
BonusModelMaster 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.CreateBonusModelMasterRequest;
using Gs2.Gs2LoginReward.Result.CreateBonusModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.CreateBonusModelMasterResult> asyncResult = null;
yield return client.CreateBonusModelMaster(
new Gs2.Gs2LoginReward.Request.CreateBonusModelMasterRequest()
.WithNamespaceName("namespace1")
.WithName("bonusModel-0001")
.WithDescription(null)
.WithMetadata(null)
.WithMode("schedule")
.WithPeriodEventId("grn:gs2:schedule:grn-0001")
.WithResetHour(null)
.WithRepeat(null)
.WithRewards(new Gs2.Gs2LoginReward.Model.Reward[] {
new Gs2.Gs2LoginReward.Model.Reward()
.WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
new Gs2.Core.Model.AcquireAction()
.WithAction("Gs2Stamina:RecoverStaminaByUserId")
.WithRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
}),
new Gs2.Gs2LoginReward.Model.Reward()
.WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
new Gs2.Core.Model.AcquireAction()
.WithAction("Gs2Stamina:RecoverStaminaByUserId")
.WithRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
}),
new Gs2.Gs2LoginReward.Model.Reward()
.WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
new Gs2.Core.Model.AcquireAction()
.WithAction("Gs2Stamina:RecoverStaminaByUserId")
.WithRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
}),
})
.WithMissedReceiveRelief("disabled")
.WithMissedReceiveReliefVerifyActions(null)
.WithMissedReceiveReliefConsumeActions(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.createBonusModelMaster(
new Gs2LoginReward.CreateBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withName("bonusModel-0001")
.withDescription(null)
.withMetadata(null)
.withMode("schedule")
.withPeriodEventId("grn:gs2:schedule:grn-0001")
.withResetHour(null)
.withRepeat(null)
.withRewards([
new Gs2LoginReward.model.Reward()
.withAcquireActions([
new Gs2LoginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
new Gs2LoginReward.model.Reward()
.withAcquireActions([
new Gs2LoginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
new Gs2LoginReward.model.Reward()
.withAcquireActions([
new Gs2LoginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
])
.withMissedReceiveRelief("disabled")
.withMissedReceiveReliefVerifyActions(null)
.withMissedReceiveReliefConsumeActions(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.create_bonus_model_master(
login_reward.CreateBonusModelMasterRequest()
.with_namespace_name(self.hash1)
.with_name('bonusModel-0001')
.with_description(None)
.with_metadata(None)
.with_mode('schedule')
.with_period_event_id('grn:gs2:schedule:grn-0001')
.with_reset_hour(None)
.with_repeat(None)
.with_rewards([
login_reward.Reward()
.with_acquire_actions([
login_reward.AcquireAction()
.with_action('Gs2Stamina:RecoverStaminaByUserId')
.with_request('{"namespaceName": "stamina-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}'),
]),
login_reward.Reward()
.with_acquire_actions([
login_reward.AcquireAction()
.with_action('Gs2Stamina:RecoverStaminaByUserId')
.with_request('{"namespaceName": "stamina-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}'),
]),
login_reward.Reward()
.with_acquire_actions([
login_reward.AcquireAction()
.with_action('Gs2Stamina:RecoverStaminaByUserId')
.with_request('{"namespaceName": "stamina-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}'),
]),
])
.with_missed_receive_relief('disabled')
.with_missed_receive_relief_verify_actions(None)
.with_missed_receive_relief_consume_actions(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.create_bonus_model_master({
namespaceName="namespace1",
name="bonusModel-0001",
description=nil,
metadata=nil,
mode="schedule",
periodEventId="grn:gs2:schedule:grn-0001",
resetHour=nil,
repeat=nil,
rewards={
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
}
},
missedReceiveRelief="disabled",
missedReceiveReliefVerifyActions=nil,
missedReceiveReliefConsumeActions=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('loginReward')
api_result_handler = client.create_bonus_model_master_async({
namespaceName="namespace1",
name="bonusModel-0001",
description=nil,
metadata=nil,
mode="schedule",
periodEventId="grn:gs2:schedule:grn-0001",
resetHour=nil,
repeat=nil,
rewards={
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
}
},
missedReceiveRelief="disabled",
missedReceiveReliefVerifyActions=nil,
missedReceiveReliefConsumeActions=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getBonusModelMaster
Get Login Bonus Model Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
bonusModelName | string | ✓ | ~ 128 chars | Login Bonus Model Name |
Result
Type | Description | |
---|---|---|
item | BonusModelMaster | Login Bonus Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.GetBonusModelMaster(
&login_reward.GetBonusModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonusModel-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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\GetBonusModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getBonusModelMaster(
(new GetBonusModelMasterRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonusModel-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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.GetBonusModelMasterRequest;
import io.gs2.loginReward.result.GetBonusModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
GetBonusModelMasterResult result = client.getBonusModelMaster(
new GetBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonusModel-0001")
);
BonusModelMaster 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.GetBonusModelMasterRequest;
using Gs2.Gs2LoginReward.Result.GetBonusModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.GetBonusModelMasterResult> asyncResult = null;
yield return client.GetBonusModelMaster(
new Gs2.Gs2LoginReward.Request.GetBonusModelMasterRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonusModel-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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.getBonusModelMaster(
new Gs2LoginReward.GetBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonusModel-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.get_bonus_model_master(
login_reward.GetBonusModelMasterRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonusModel-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.get_bonus_model_master({
namespaceName="namespace1",
bonusModelName="bonusModel-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('loginReward')
api_result_handler = client.get_bonus_model_master_async({
namespaceName="namespace1",
bonusModelName="bonusModel-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;
updateBonusModelMaster
Update Login Bonus Model Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
bonusModelName | string | ✓ | ~ 128 chars | Login Bonus Model Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
mode | enum { “schedule”, “streaming” } | ✓ | ~ 128 chars | mode | ||
periodEventId | string | ~ 1024 chars | GS2-Schedule Event GRN that represents the period during which to enable login bonuses | |||
resetHour | int | {periodEventId} == "" | ✓ | ~ 23 | Reset time of the receive flag (UTC) | |
repeat | enum { “enabled”, “disabled” } | {mode} == “streaming” | ✓ | ~ 128 chars | Whether to repeat when the end of the stream is reached | |
rewards | List<Reward> | ~ 100 items | List of rewards | |||
missedReceiveRelief | enum { “enabled”, “disabled” } | ✓ | “disabled” | ~ 128 chars | Missed Rescue Function | |
missedReceiveReliefVerifyActions | List<VerifyAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | List of verify actions for missed receive relief | ||
missedReceiveReliefConsumeActions | List<ConsumeAction> | {missedReceiveRelief} == “enabled” | ~ 10 items | List of consumption actions for missed receive relief |
Enumeration type definition to specify as mode
Enumerator String Definition | Description |
---|---|
schedule | Schedule Mode |
streaming | Streaming Mode |
Enumeration type definition to specify as repeat
Enumerator String Definition | Description |
---|---|
enabled | Enabled |
disabled | Disabled |
Enumeration type definition to specify as missedReceiveRelief
Enumerator String Definition | Description |
---|---|
enabled | Enabled |
disabled | Disabled |
Result
Type | Description | |
---|---|---|
item | BonusModelMaster | Updated Login Bonus Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.UpdateBonusModelMaster(
&login_reward.UpdateBonusModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonusModel-0001"),
Description: pointy.String("description1"),
Metadata: nil,
Mode: pointy.String("streaming"),
PeriodEventId: pointy.String("grn:gs2:schedule:grn-0001"),
ResetHour: nil,
Repeat: pointy.String("disabled"),
Rewards: []loginReward.Reward{
loginReward.Reward{
AcquireActions: []loginReward.AcquireAction{
loginReward.AcquireAction{
Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
Request: pointy.String("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
},
},
},
loginReward.Reward{
AcquireActions: []loginReward.AcquireAction{
loginReward.AcquireAction{
Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
Request: pointy.String("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
},
},
},
loginReward.Reward{
AcquireActions: []loginReward.AcquireAction{
loginReward.AcquireAction{
Action: pointy.String("Gs2Stamina:RecoverStaminaByUserId"),
Request: pointy.String("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
},
},
},
},
MissedReceiveRelief: pointy.String("enabled"),
MissedReceiveReliefVerifyActions: nil,
MissedReceiveReliefConsumeActions: []loginReward.ConsumeAction{
loginReward.ConsumeAction{
Action: pointy.String("Gs2Money:WithdrawByUserId"),
Request: pointy.String("{\"namespaceName\": \"stamina-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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\UpdateBonusModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateBonusModelMaster(
(new UpdateBonusModelMasterRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonusModel-0001")
->withDescription("description1")
->withMetadata(null)
->withMode("streaming")
->withPeriodEventId("grn:gs2:schedule:grn-0001")
->withResetHour(null)
->withRepeat("disabled")
->withRewards([
(new \Gs2\LoginReward\Model\Reward())
->withAcquireActions([
(new \Gs2\LoginReward\Model\AcquireAction())
->withAction("Gs2Stamina:RecoverStaminaByUserId")
->withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
(new \Gs2\LoginReward\Model\Reward())
->withAcquireActions([
(new \Gs2\LoginReward\Model\AcquireAction())
->withAction("Gs2Stamina:RecoverStaminaByUserId")
->withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
(new \Gs2\LoginReward\Model\Reward())
->withAcquireActions([
(new \Gs2\LoginReward\Model\AcquireAction())
->withAction("Gs2Stamina:RecoverStaminaByUserId")
->withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
])
->withMissedReceiveRelief("enabled")
->withMissedReceiveReliefVerifyActions(null)
->withMissedReceiveReliefConsumeActions([
(new \Gs2\LoginReward\Model\ConsumeAction())
->withAction("Gs2Money:WithdrawByUserId")
->withRequest("{\"namespaceName\": \"stamina-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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.UpdateBonusModelMasterRequest;
import io.gs2.loginReward.result.UpdateBonusModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
UpdateBonusModelMasterResult result = client.updateBonusModelMaster(
new UpdateBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonusModel-0001")
.withDescription("description1")
.withMetadata(null)
.withMode("streaming")
.withPeriodEventId("grn:gs2:schedule:grn-0001")
.withResetHour(null)
.withRepeat("disabled")
.withRewards(Arrays.asList(
new io.gs2.loginReward.model.Reward()
.withAcquireActions(Arrays.asList(
new io.gs2.loginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
)),
new io.gs2.loginReward.model.Reward()
.withAcquireActions(Arrays.asList(
new io.gs2.loginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
)),
new io.gs2.loginReward.model.Reward()
.withAcquireActions(Arrays.asList(
new io.gs2.loginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}")
))
))
.withMissedReceiveRelief("enabled")
.withMissedReceiveReliefVerifyActions(null)
.withMissedReceiveReliefConsumeActions(Arrays.asList(
new io.gs2.loginReward.model.ConsumeAction()
.withAction("Gs2Money:WithdrawByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}")
))
);
BonusModelMaster 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.UpdateBonusModelMasterRequest;
using Gs2.Gs2LoginReward.Result.UpdateBonusModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.UpdateBonusModelMasterResult> asyncResult = null;
yield return client.UpdateBonusModelMaster(
new Gs2.Gs2LoginReward.Request.UpdateBonusModelMasterRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonusModel-0001")
.WithDescription("description1")
.WithMetadata(null)
.WithMode("streaming")
.WithPeriodEventId("grn:gs2:schedule:grn-0001")
.WithResetHour(null)
.WithRepeat("disabled")
.WithRewards(new Gs2.Gs2LoginReward.Model.Reward[] {
new Gs2.Gs2LoginReward.Model.Reward()
.WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
new Gs2.Core.Model.AcquireAction()
.WithAction("Gs2Stamina:RecoverStaminaByUserId")
.WithRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
}),
new Gs2.Gs2LoginReward.Model.Reward()
.WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
new Gs2.Core.Model.AcquireAction()
.WithAction("Gs2Stamina:RecoverStaminaByUserId")
.WithRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
}),
new Gs2.Gs2LoginReward.Model.Reward()
.WithAcquireActions(new Gs2.Core.Model.AcquireAction[] {
new Gs2.Core.Model.AcquireAction()
.WithAction("Gs2Stamina:RecoverStaminaByUserId")
.WithRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
}),
})
.WithMissedReceiveRelief("enabled")
.WithMissedReceiveReliefVerifyActions(null)
.WithMissedReceiveReliefConsumeActions(new Gs2.Core.Model.ConsumeAction[] {
new Gs2.Core.Model.ConsumeAction()
.WithAction("Gs2Money:WithdrawByUserId")
.WithRequest("{\"namespaceName\": \"stamina-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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.updateBonusModelMaster(
new Gs2LoginReward.UpdateBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonusModel-0001")
.withDescription("description1")
.withMetadata(null)
.withMode("streaming")
.withPeriodEventId("grn:gs2:schedule:grn-0001")
.withResetHour(null)
.withRepeat("disabled")
.withRewards([
new Gs2LoginReward.model.Reward()
.withAcquireActions([
new Gs2LoginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
new Gs2LoginReward.model.Reward()
.withAcquireActions([
new Gs2LoginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
new Gs2LoginReward.model.Reward()
.withAcquireActions([
new Gs2LoginReward.model.AcquireAction()
.withAction("Gs2Stamina:RecoverStaminaByUserId")
.withRequest("{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}"),
]),
])
.withMissedReceiveRelief("enabled")
.withMissedReceiveReliefVerifyActions(null)
.withMissedReceiveReliefConsumeActions([
new Gs2LoginReward.model.ConsumeAction()
.withAction("Gs2Money:WithdrawByUserId")
.withRequest("{\"namespaceName\": \"stamina-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 login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.update_bonus_model_master(
login_reward.UpdateBonusModelMasterRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonusModel-0001')
.with_description('description1')
.with_metadata(None)
.with_mode('streaming')
.with_period_event_id('grn:gs2:schedule:grn-0001')
.with_reset_hour(None)
.with_repeat('disabled')
.with_rewards([
login_reward.Reward()
.with_acquire_actions([
login_reward.AcquireAction()
.with_action('Gs2Stamina:RecoverStaminaByUserId')
.with_request('{"namespaceName": "stamina-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}'),
]),
login_reward.Reward()
.with_acquire_actions([
login_reward.AcquireAction()
.with_action('Gs2Stamina:RecoverStaminaByUserId')
.with_request('{"namespaceName": "stamina-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}'),
]),
login_reward.Reward()
.with_acquire_actions([
login_reward.AcquireAction()
.with_action('Gs2Stamina:RecoverStaminaByUserId')
.with_request('{"namespaceName": "stamina-0001", "userId": "user-0001", "slot": 0, "count": 100, "paidOnly": false}'),
]),
])
.with_missed_receive_relief('enabled')
.with_missed_receive_relief_verify_actions(None)
.with_missed_receive_relief_consume_actions([
login_reward.ConsumeAction()
.with_action('Gs2Money:WithdrawByUserId')
.with_request('{"namespaceName": "stamina-0001", "userId": "user-0001", "slot": 0, "count": 200, "paidOnly": false}'),
])
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.update_bonus_model_master({
namespaceName="namespace1",
bonusModelName="bonusModel-0001",
description="description1",
metadata=nil,
mode="streaming",
periodEventId="grn:gs2:schedule:grn-0001",
resetHour=nil,
repeat="disabled",
rewards={
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
}
},
missedReceiveRelief="enabled",
missedReceiveReliefVerifyActions=nil,
missedReceiveReliefConsumeActions={
{
action="Gs2Money:WithdrawByUserId",
request="{\"namespaceName\": \"stamina-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('loginReward')
api_result_handler = client.update_bonus_model_master_async({
namespaceName="namespace1",
bonusModelName="bonusModel-0001",
description="description1",
metadata=nil,
mode="streaming",
periodEventId="grn:gs2:schedule:grn-0001",
resetHour=nil,
repeat="disabled",
rewards={
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
},
{
acquireActions={
{
action="Gs2Stamina:RecoverStaminaByUserId",
request="{\"namespaceName\": \"stamina-0001\", \"userId\": \"user-0001\", \"slot\": 0, \"count\": 100, \"paidOnly\": false}",
}
},
}
},
missedReceiveRelief="enabled",
missedReceiveReliefVerifyActions=nil,
missedReceiveReliefConsumeActions={
{
action="Gs2Money:WithdrawByUserId",
request="{\"namespaceName\": \"stamina-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;
deleteBonusModelMaster
Delete Login Bonus Model Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
bonusModelName | string | ✓ | ~ 128 chars | Login Bonus Model Name |
Result
Type | Description | |
---|---|---|
item | BonusModelMaster | Deleted Login Bonus Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/login_reward"
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 := login_reward.Gs2LoginRewardRestClient{
Session: &session,
}
result, err := client.DeleteBonusModelMaster(
&login_reward.DeleteBonusModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonusModel-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\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\DeleteBonusModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteBonusModelMaster(
(new DeleteBonusModelMasterRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonusModel-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.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DeleteBonusModelMasterRequest;
import io.gs2.loginReward.result.DeleteBonusModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DeleteBonusModelMasterResult result = client.deleteBonusModelMaster(
new DeleteBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonusModel-0001")
);
BonusModelMaster 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.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DeleteBonusModelMasterRequest;
using Gs2.Gs2LoginReward.Result.DeleteBonusModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2LoginRewardRestClient(session);
AsyncResult<Gs2.Gs2LoginReward.Result.DeleteBonusModelMasterResult> asyncResult = null;
yield return client.DeleteBonusModelMaster(
new Gs2.Gs2LoginReward.Request.DeleteBonusModelMasterRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonusModel-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 Gs2LoginReward from '@/gs2/loginReward';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2LoginReward.Gs2LoginRewardRestClient(session);
try {
const result = await client.deleteBonusModelMaster(
new Gs2LoginReward.DeleteBonusModelMasterRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonusModel-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import login_reward
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = login_reward.Gs2LoginRewardRestClient(session)
try:
result = client.