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 |
VerifyActionResult
Verify action execution result
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128 chars | Types of actions to be performed in the verify task | ||
verifyRequest | string | ✓ | ~ 1048576 chars | JSON of request | ||
statusCode | int | ~ 999 | Status code | |||
verifyResult | string | ~ 1048576 chars | Result payload |
Enumeration type definition to specify as action
Enumerator String Definition | Description |
---|
ConsumeActionResult
Consume action execution result
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128 chars | Types of actions to be performed in the consume action | ||
consumeRequest | string | ✓ | ~ 1048576 chars | JSON of request | ||
statusCode | int | ~ 999 | Status code | |||
consumeResult | string | ~ 1048576 chars | Result payload |
Enumeration type definition to specify as action
Enumerator String Definition | Description |
---|
AcquireActionResult
Acquire action execution result
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128 chars | Types of actions to be performed in the acquire action | ||
acquireRequest | string | ✓ | ~ 1048576 chars | JSON of request | ||
statusCode | int | ~ 999 | Status code | |||
acquireResult | string | ~ 1048576 chars | Result payload |
Enumeration type definition to specify as action
Enumerator String Definition | Description |
---|
TransactionResult
Transaction execution results
Transaction execution results executed using server-side transaction auto-execution functionality
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
transactionId | string | ✓ | 36 ~ 36 chars | Transaction ID | ||
verifyResults | List<VerifyActionResult> | ~ 10 items | List of verify action execution results | |||
consumeResults | List<ConsumeActionResult> | ~ 10 items | List of consume action execution results | |||
acquireResults | List<AcquireActionResult> | ~ 100 items | List of acquire action execution results |
GitHubCheckoutSetting
Setup to check out master data from GitHub
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
apiKeyId | string | ✓ | ~ 1024 chars | GitHub API key GRN | ||
repositoryName | string | ✓ | ~ 1024 chars | Repository Name | ||
sourcePath | string | ✓ | ~ 1024 chars | Source code file path | ||
referenceType | enum { “commit_hash”, “branch”, “tag” } | ✓ | ~ 128 chars | Source of code | ||
commitHash | string | {referenceType} == “commit_hash” | ✓ | ~ 1024 chars | Commit hash | |
branchName | string | {referenceType} == “branch” | ✓ | ~ 1024 chars | Branch Name | |
tagName | string | {referenceType} == “tag” | ✓ | ~ 1024 chars | Tag Name |
Enumeration type definition to specify as referenceType
Enumerator String Definition | Description |
---|---|
commit_hash | Commit hash |
branch | Branch |
tag | Tag |
LogSetting
Log setting
This type manages log output settings. This type holds the identifier of the log namespace used to output log data. The log namespace ID specifies the GS2-Log namespace to aggregate and store the log data. Through this setting, API request and response log data under this namespace will be output to the target GS2-Log. GS2-Log provides logs in real time, which can be used for system monitoring, analysis, debugging, etc.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
loggingNamespaceId | string | ✓ | ~ 1024 chars | Namespace GRN |
TransactionSetting
Transaction settings
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
enableAutoRun | bool | ✓ | false | Whether to automatically execute issued transactions on the server side | ||
enableAtomicCommit | bool | {enableAutoRun} == true | ✓ | false | Whether to commit the execution of transactions atomically | |
transactionUseDistributor | bool | {enableAtomicCommit} == true | ✓ | false | Whether to execute transactions asynchronously | |
acquireActionUseJobQueue | bool | {enableAtomicCommit} == true | ✓ | false | Whether to use GS2-JobQueue to execute the acquire action | |
distributorNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024 chars | GS2-Distributor namespace used for transaction execution | |
queueNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024 chars | Namespace in GS2-JobQueue used to run the transaction |
ScriptSetting
Script settings
In GS2, you can associate custom scripts with microservice events and execute them. This model holds the settings for triggering script execution.
There are two main ways to execute a script: synchronous execution and asynchronous execution. Synchronous execution blocks processing until the script has finished executing. Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API.
On the other hand, asynchronous execution does not block processing until the script has finished executing. Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API. However, asynchronous execution does not block processing until the script has finished executing, so it is generally recommended to use asynchronous execution.
There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge. By using Amazon EventBridge, you can write processing in languages other than Lua.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
triggerScriptId | string | ~ 1024 chars | Script GRN | |||
doneTriggerTargetType | enum { “none”, “gs2_script”, “aws” } | ✓ | “none” | ~ 128 chars | Notification of Completion | |
doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | Script GRN | ||
doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | Namespace GRN |
Enumeration type definition to specify as doneTriggerTargetType
Enumerator String Definition | Description |
---|---|
none | None |
gs2_script | GS2-Script |
aws | Amazon EventBridge |
Methods
describeNamespaces
Get list of namespaces
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<Namespace> | List of Namespace |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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.delete_bonus_model_master(
login_reward.DeleteBonusModelMasterRequest()
.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.delete_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.delete_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;
exportMaster
Export master data for the currently available loginReward master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | CurrentBonusMaster | Currently available loginReward 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.ExportMaster(
&login_reward.ExportMasterRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\ExportMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->exportMaster(
(new ExportMasterRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.ExportMasterRequest;
import io.gs2.loginReward.result.ExportMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
ExportMasterResult result = client.exportMaster(
new ExportMasterRequest()
.withNamespaceName("namespace1")
);
CurrentBonusMaster 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.ExportMasterRequest;
using Gs2.Gs2LoginReward.Result.ExportMasterResult;
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.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
new Gs2.Gs2LoginReward.Request.ExportMasterRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.exportMaster(
new Gs2LoginReward.ExportMasterRequest()
.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.export_master(
login_reward.ExportMasterRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.export_master({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('loginReward')
api_result_handler = client.export_master_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getCurrentBonusMaster
Get the currently available loginReward master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | CurrentBonusMaster | Currently available loginReward 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.GetCurrentBonusMaster(
&login_reward.GetCurrentBonusMasterRequest {
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\GetCurrentBonusMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCurrentBonusMaster(
(new GetCurrentBonusMasterRequest())
->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.GetCurrentBonusMasterRequest;
import io.gs2.loginReward.result.GetCurrentBonusMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
GetCurrentBonusMasterResult result = client.getCurrentBonusMaster(
new GetCurrentBonusMasterRequest()
.withNamespaceName("namespace1")
);
CurrentBonusMaster 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.GetCurrentBonusMasterRequest;
using Gs2.Gs2LoginReward.Result.GetCurrentBonusMasterResult;
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.GetCurrentBonusMasterResult> asyncResult = null;
yield return client.GetCurrentBonusMaster(
new Gs2.Gs2LoginReward.Request.GetCurrentBonusMasterRequest()
.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.getCurrentBonusMaster(
new Gs2LoginReward.GetCurrentBonusMasterRequest()
.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_current_bonus_master(
login_reward.GetCurrentBonusMasterRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.get_current_bonus_master({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('loginReward')
api_result_handler = client.get_current_bonus_master_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateCurrentBonusMaster
Update the currently available loginReward master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
settings | string | ✓ | ~ 5242880 chars | Master data |
Result
Type | Description | |
---|---|---|
item | CurrentBonusMaster | Updated and currently available loginReward 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.UpdateCurrentBonusMaster(
&login_reward.UpdateCurrentBonusMasterRequest {
NamespaceName: pointy.String("namespace1"),
Settings: pointy.String("{\"version\": \"2023-07-11\", \"bonusModels\": [{\"name\": \"schedule\", \"mode\": \"schedule\", \"periodEventId\": \"grn:gs2:schedule:grn-0001\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"disabled\"}, {\"name\": \"streaming\", \"mode\": \"streaming\", \"resetHour\": 15, \"repeat\": \"enabled\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"enabled\", \"missedReceiveReliefConsumeActions\": [{\"action\": \"Gs2Money:WithdrawByUserId\", \"request\": {\"namespaceName\": \"money-0001\", \"userId\": \"#{userId}\", \"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\UpdateCurrentBonusMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentBonusMaster(
(new UpdateCurrentBonusMasterRequest())
->withNamespaceName(self::namespace1)
->withSettings("{\"version\": \"2023-07-11\", \"bonusModels\": [{\"name\": \"schedule\", \"mode\": \"schedule\", \"periodEventId\": \"grn:gs2:schedule:grn-0001\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"disabled\"}, {\"name\": \"streaming\", \"mode\": \"streaming\", \"resetHour\": 15, \"repeat\": \"enabled\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"enabled\", \"missedReceiveReliefConsumeActions\": [{\"action\": \"Gs2Money:WithdrawByUserId\", \"request\": {\"namespaceName\": \"money-0001\", \"userId\": \"#{userId}\", \"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.UpdateCurrentBonusMasterRequest;
import io.gs2.loginReward.result.UpdateCurrentBonusMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
UpdateCurrentBonusMasterResult result = client.updateCurrentBonusMaster(
new UpdateCurrentBonusMasterRequest()
.withNamespaceName("namespace1")
.withSettings("{\"version\": \"2023-07-11\", \"bonusModels\": [{\"name\": \"schedule\", \"mode\": \"schedule\", \"periodEventId\": \"grn:gs2:schedule:grn-0001\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"disabled\"}, {\"name\": \"streaming\", \"mode\": \"streaming\", \"resetHour\": 15, \"repeat\": \"enabled\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"enabled\", \"missedReceiveReliefConsumeActions\": [{\"action\": \"Gs2Money:WithdrawByUserId\", \"request\": {\"namespaceName\": \"money-0001\", \"userId\": \"#{userId}\", \"slot\": 0, \"count\": 200, \"paidOnly\": false}}]}]}")
);
CurrentBonusMaster 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.UpdateCurrentBonusMasterRequest;
using Gs2.Gs2LoginReward.Result.UpdateCurrentBonusMasterResult;
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.UpdateCurrentBonusMasterResult> asyncResult = null;
yield return client.UpdateCurrentBonusMaster(
new Gs2.Gs2LoginReward.Request.UpdateCurrentBonusMasterRequest()
.WithNamespaceName("namespace1")
.WithSettings("{\"version\": \"2023-07-11\", \"bonusModels\": [{\"name\": \"schedule\", \"mode\": \"schedule\", \"periodEventId\": \"grn:gs2:schedule:grn-0001\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"disabled\"}, {\"name\": \"streaming\", \"mode\": \"streaming\", \"resetHour\": 15, \"repeat\": \"enabled\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"enabled\", \"missedReceiveReliefConsumeActions\": [{\"action\": \"Gs2Money:WithdrawByUserId\", \"request\": {\"namespaceName\": \"money-0001\", \"userId\": \"#{userId}\", \"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.updateCurrentBonusMaster(
new Gs2LoginReward.UpdateCurrentBonusMasterRequest()
.withNamespaceName("namespace1")
.withSettings("{\"version\": \"2023-07-11\", \"bonusModels\": [{\"name\": \"schedule\", \"mode\": \"schedule\", \"periodEventId\": \"grn:gs2:schedule:grn-0001\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"disabled\"}, {\"name\": \"streaming\", \"mode\": \"streaming\", \"resetHour\": 15, \"repeat\": \"enabled\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"enabled\", \"missedReceiveReliefConsumeActions\": [{\"action\": \"Gs2Money:WithdrawByUserId\", \"request\": {\"namespaceName\": \"money-0001\", \"userId\": \"#{userId}\", \"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_current_bonus_master(
login_reward.UpdateCurrentBonusMasterRequest()
.with_namespace_name(self.hash1)
.with_settings('{"version": "2023-07-11", "bonusModels": [{"name": "schedule", "mode": "schedule", "periodEventId": "grn:gs2:schedule:grn-0001", "rewards": [{"acquireActions": [{"action": "Gs2Stamina:RecoverStaminaByUserId", "request": {"namespaceName": "stamina-0001", "staminaName": "quest", "userId": "#{userId}", "recoverValue": 100}}]}, {"acquireActions": [{"action": "Gs2Stamina:RecoverStaminaByUserId", "request": {"namespaceName": "stamina-0001", "staminaName": "quest", "userId": "#{userId}", "recoverValue": 100}}]}, {"acquireActions": [{"action": "Gs2Stamina:RecoverStaminaByUserId", "request": {"namespaceName": "stamina-0001", "staminaName": "quest", "userId": "#{userId}", "recoverValue": 100}}]}], "missedReceiveRelief": "disabled"}, {"name": "streaming", "mode": "streaming", "resetHour": 15, "repeat": "enabled", "rewards": [{"acquireActions": [{"action": "Gs2Stamina:RecoverStaminaByUserId", "request": {"namespaceName": "stamina-0001", "staminaName": "quest", "userId": "#{userId}", "recoverValue": 100}}]}, {"acquireActions": [{"action": "Gs2Stamina:RecoverStaminaByUserId", "request": {"namespaceName": "stamina-0001", "staminaName": "quest", "userId": "#{userId}", "recoverValue": 100}}]}, {"acquireActions": [{"action": "Gs2Stamina:RecoverStaminaByUserId", "request": {"namespaceName": "stamina-0001", "staminaName": "quest", "userId": "#{userId}", "recoverValue": 100}}]}], "missedReceiveRelief": "enabled", "missedReceiveReliefConsumeActions": [{"action": "Gs2Money:WithdrawByUserId", "request": {"namespaceName": "money-0001", "userId": "#{userId}", "slot": 0, "count": 200, "paidOnly": false}}]}]}')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.update_current_bonus_master({
namespaceName="namespace1",
settings="{\"version\": \"2023-07-11\", \"bonusModels\": [{\"name\": \"schedule\", \"mode\": \"schedule\", \"periodEventId\": \"grn:gs2:schedule:grn-0001\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"disabled\"}, {\"name\": \"streaming\", \"mode\": \"streaming\", \"resetHour\": 15, \"repeat\": \"enabled\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"enabled\", \"missedReceiveReliefConsumeActions\": [{\"action\": \"Gs2Money:WithdrawByUserId\", \"request\": {\"namespaceName\": \"money-0001\", \"userId\": \"#{userId}\", \"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_current_bonus_master_async({
namespaceName="namespace1",
settings="{\"version\": \"2023-07-11\", \"bonusModels\": [{\"name\": \"schedule\", \"mode\": \"schedule\", \"periodEventId\": \"grn:gs2:schedule:grn-0001\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"disabled\"}, {\"name\": \"streaming\", \"mode\": \"streaming\", \"resetHour\": 15, \"repeat\": \"enabled\", \"rewards\": [{\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}, {\"acquireActions\": [{\"action\": \"Gs2Stamina:RecoverStaminaByUserId\", \"request\": {\"namespaceName\": \"stamina-0001\", \"staminaName\": \"quest\", \"userId\": \"#{userId}\", \"recoverValue\": 100}}]}], \"missedReceiveRelief\": \"enabled\", \"missedReceiveReliefConsumeActions\": [{\"action\": \"Gs2Money:WithdrawByUserId\", \"request\": {\"namespaceName\": \"money-0001\", \"userId\": \"#{userId}\", \"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;
updateCurrentBonusMasterFromGitHub
Update the currently available loginReward master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
checkoutSetting | GitHubCheckoutSetting | ✓ | Setup to check out master data from GitHub |
Result
Type | Description | |
---|---|---|
item | CurrentBonusMaster | Updated and currently available loginReward 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.UpdateCurrentBonusMasterFromGitHub(
&login_reward.UpdateCurrentBonusMasterFromGitHubRequest {
NamespaceName: pointy.String("namespace1"),
CheckoutSetting: &loginReward.GitHubCheckoutSetting{
ApiKeyId: pointy.String("$gitHubApiKey1.apiKeyId"),
RepositoryName: pointy.String("gs2io/master-data"),
SourcePath: pointy.String("path/to/file.json"),
ReferenceType: pointy.String("branch"),
BranchName: pointy.String("develop"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\UpdateCurrentBonusMasterFromGitHubRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentBonusMasterFromGitHub(
(new UpdateCurrentBonusMasterFromGitHubRequest())
->withNamespaceName(self::namespace1)
->withCheckoutSetting((new GitHubCheckoutSetting())
->withApiKeyId(self::$gitHubApiKey1.apiKeyId)
->withRepositoryName("gs2io/master-data")
->withSourcePath("path/to/file.json")
->withReferenceType("branch")
->withBranchName("develop")
)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.UpdateCurrentBonusMasterFromGitHubRequest;
import io.gs2.loginReward.result.UpdateCurrentBonusMasterFromGitHubResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
UpdateCurrentBonusMasterFromGitHubResult result = client.updateCurrentBonusMasterFromGitHub(
new UpdateCurrentBonusMasterFromGitHubRequest()
.withNamespaceName("namespace1")
.withCheckoutSetting(new GitHubCheckoutSetting()
.withApiKeyId("$gitHubApiKey1.apiKeyId")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
CurrentBonusMaster 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.UpdateCurrentBonusMasterFromGitHubRequest;
using Gs2.Gs2LoginReward.Result.UpdateCurrentBonusMasterFromGitHubResult;
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.UpdateCurrentBonusMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentBonusMasterFromGitHub(
new Gs2.Gs2LoginReward.Request.UpdateCurrentBonusMasterFromGitHubRequest()
.WithNamespaceName("namespace1")
.WithCheckoutSetting(new Gs2.Gs2LoginReward.Model.GitHubCheckoutSetting()
.WithApiKeyId("$gitHubApiKey1.apiKeyId")
.WithRepositoryName("gs2io/master-data")
.WithSourcePath("path/to/file.json")
.WithReferenceType("branch")
.WithBranchName("develop")
),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.updateCurrentBonusMasterFromGitHub(
new Gs2LoginReward.UpdateCurrentBonusMasterFromGitHubRequest()
.withNamespaceName("namespace1")
.withCheckoutSetting(new Gs2LoginReward.model.GitHubCheckoutSetting()
.withApiKeyId("$gitHubApiKey1.apiKeyId")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import 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_current_bonus_master_from_git_hub(
login_reward.UpdateCurrentBonusMasterFromGitHubRequest()
.with_namespace_name(self.hash1)
.with_checkout_setting(login_reward.GitHubCheckoutSetting()
.with_api_key_id(self.git_hub_api_key1.api_key_id)
.with_repository_name('gs2io/master-data')
.with_source_path('path/to/file.json')
.with_reference_type('branch')
.with_branch_name('develop')
)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.update_current_bonus_master_from_git_hub({
namespaceName="namespace1",
checkoutSetting={
api_key_id="$gitHubApiKey1.apiKeyId",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('loginReward')
api_result_handler = client.update_current_bonus_master_from_git_hub_async({
namespaceName="namespace1",
checkoutSetting={
api_key_id="$gitHubApiKey1.apiKeyId",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
describeBonusModels
Get list of loginReward
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
items | List<BonusModel> | List of Bonuss |
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.DescribeBonusModels(
&login_reward.DescribeBonusModelsRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\DescribeBonusModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeBonusModels(
(new DescribeBonusModelsRequest())
->withNamespaceName(self::namespace1)
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.DescribeBonusModelsRequest;
import io.gs2.loginReward.result.DescribeBonusModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DescribeBonusModelsResult result = client.describeBonusModels(
new DescribeBonusModelsRequest()
.withNamespaceName("namespace1")
);
List<BonusModel> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.DescribeBonusModelsRequest;
using Gs2.Gs2LoginReward.Result.DescribeBonusModelsResult;
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.DescribeBonusModelsResult> asyncResult = null;
yield return client.DescribeBonusModels(
new Gs2.Gs2LoginReward.Request.DescribeBonusModelsRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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.describeBonusModels(
new Gs2LoginReward.DescribeBonusModelsRequest()
.withNamespaceName("namespace1")
);
const items = result.getItems();
} 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_models(
login_reward.DescribeBonusModelsRequest()
.with_namespace_name(self.hash1)
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.describe_bonus_models({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('loginReward')
api_result_handler = client.describe_bonus_models_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
getBonusModel
Get loginReward
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
bonusModelName | string | ✓ | ~ 128 chars | Bonus Model Name |
Result
Type | Description | |
---|---|---|
item | BonusModel | Bonus |
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.GetBonusModel(
&login_reward.GetBonusModelRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-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\GetBonusModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getBonusModel(
(new GetBonusModelRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-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.GetBonusModelRequest;
import io.gs2.loginReward.result.GetBonusModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
GetBonusModelResult result = client.getBonusModel(
new GetBonusModelRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
);
BonusModel 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.GetBonusModelRequest;
using Gs2.Gs2LoginReward.Result.GetBonusModelResult;
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.GetBonusModelResult> asyncResult = null;
yield return client.GetBonusModel(
new Gs2.Gs2LoginReward.Request.GetBonusModelRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-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.getBonusModel(
new Gs2LoginReward.GetBonusModelRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-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(
login_reward.GetBonusModelRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.get_bonus_model({
namespaceName="namespace1",
bonusModelName="bonus-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_async({
namespaceName="namespace1",
bonusModelName="bonus-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;
receive
Get login rewards
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
bonusModelName | string | ✓ | ~ 128 chars | Bonus Model Name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
config | List<Config> | [] | ~ 32 items | Set values to be applied to transaction variables |
Result
Type | Description | |
---|---|---|
item | ReceiveStatus | Receive status |
bonusModel | BonusModel | Login Bonus Model |
transactionId | string | Issed transaction ID |
stampSheet | string | Stamp sheets used to execute the purchase process |
stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
autoRunStampSheet | bool? | Is transaction auto-execution enabled? |
atomicCommit | bool? | Transaction to commit atomically |
transaction | string | Issued transaction |
transactionResult | TransactionResult | Transaction execution result |
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.Receive(
&login_reward.ReceiveRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
AccessToken: pointy.String("accessToken-0001"),
Config: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
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\ReceiveRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->receive(
(new ReceiveRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withAccessToken(self::$accessToken0001)
->withConfig(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
$transactionId = $result->getTransactionId();
$stampSheet = $result->getStampSheet();
$stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
$autoRunStampSheet = $result->getAutoRunStampSheet();
$atomicCommit = $result->getAtomicCommit();
$transaction = $result->getTransaction();
$transactionResult = $result->getTransactionResult();
} 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.ReceiveRequest;
import io.gs2.loginReward.result.ReceiveResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
ReceiveResult result = client.receive(
new ReceiveRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
.withConfig(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
String transactionId = result.getTransactionId();
String stampSheet = result.getStampSheet();
String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
boolean autoRunStampSheet = result.getAutoRunStampSheet();
boolean atomicCommit = result.getAtomicCommit();
String transaction = result.getTransaction();
TransactionResult transactionResult = result.getTransactionResult();
} 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.ReceiveRequest;
using Gs2.Gs2LoginReward.Result.ReceiveResult;
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.ReceiveResult> asyncResult = null;
yield return client.Receive(
new Gs2.Gs2LoginReward.Request.ReceiveRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithAccessToken("accessToken-0001")
.WithConfig(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
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.receive(
new Gs2LoginReward.ReceiveRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
.withConfig(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
const transactionId = result.getTransactionId();
const stampSheet = result.getStampSheet();
const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
const autoRunStampSheet = result.getAutoRunStampSheet();
const atomicCommit = result.getAtomicCommit();
const transaction = result.getTransaction();
const transactionResult = result.getTransactionResult();
} 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.receive(
login_reward.ReceiveRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_access_token(self.access_token_0001)
.with_config(None)
)
item = result.item
bonus_model = result.bonus_model
transaction_id = result.transaction_id
stamp_sheet = result.stamp_sheet
stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
auto_run_stamp_sheet = result.auto_run_stamp_sheet
atomic_commit = result.atomic_commit
transaction = result.transaction
transaction_result = result.transaction_result
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.receive({
namespaceName="namespace1",
bonusModelName="bonus-0001",
accessToken="accessToken-0001",
config=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
client = gs2('loginReward')
api_result_handler = client.receive_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
accessToken="accessToken-0001",
config=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
receiveByUserId
Get login rewards by userId
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
bonusModelName | string | ✓ | ~ 128 chars | Bonus Model Name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
config | List<Config> | [] | ~ 32 items | Set values to be applied to transaction variables | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | ReceiveStatus | Receive status |
bonusModel | BonusModel | Login Bonus Model |
transactionId | string | Issed transaction ID |
stampSheet | string | Stamp sheets used to execute the purchase process |
stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
autoRunStampSheet | bool? | Is transaction auto-execution enabled? |
atomicCommit | bool? | Transaction to commit atomically |
transaction | string | Issued transaction |
transactionResult | TransactionResult | Transaction execution result |
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.ReceiveByUserId(
&login_reward.ReceiveByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
UserId: pointy.String("user-0001"),
Config: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
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\ReceiveByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->receiveByUserId(
(new ReceiveByUserIdRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withUserId("user-0001")
->withConfig(null)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
$transactionId = $result->getTransactionId();
$stampSheet = $result->getStampSheet();
$stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
$autoRunStampSheet = $result->getAutoRunStampSheet();
$atomicCommit = $result->getAtomicCommit();
$transaction = $result->getTransaction();
$transactionResult = $result->getTransactionResult();
} 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.ReceiveByUserIdRequest;
import io.gs2.loginReward.result.ReceiveByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
ReceiveByUserIdResult result = client.receiveByUserId(
new ReceiveByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withConfig(null)
.withTimeOffsetToken(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
String transactionId = result.getTransactionId();
String stampSheet = result.getStampSheet();
String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
boolean autoRunStampSheet = result.getAutoRunStampSheet();
boolean atomicCommit = result.getAtomicCommit();
String transaction = result.getTransaction();
TransactionResult transactionResult = result.getTransactionResult();
} 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.ReceiveByUserIdRequest;
using Gs2.Gs2LoginReward.Result.ReceiveByUserIdResult;
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.ReceiveByUserIdResult> asyncResult = null;
yield return client.ReceiveByUserId(
new Gs2.Gs2LoginReward.Request.ReceiveByUserIdRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithUserId("user-0001")
.WithConfig(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
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.receiveByUserId(
new Gs2LoginReward.ReceiveByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withConfig(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
const transactionId = result.getTransactionId();
const stampSheet = result.getStampSheet();
const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
const autoRunStampSheet = result.getAutoRunStampSheet();
const atomicCommit = result.getAtomicCommit();
const transaction = result.getTransaction();
const transactionResult = result.getTransactionResult();
} 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.receive_by_user_id(
login_reward.ReceiveByUserIdRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_user_id('user-0001')
.with_config(None)
.with_time_offset_token(None)
)
item = result.item
bonus_model = result.bonus_model
transaction_id = result.transaction_id
stamp_sheet = result.stamp_sheet
stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
auto_run_stamp_sheet = result.auto_run_stamp_sheet
atomic_commit = result.atomic_commit
transaction = result.transaction
transaction_result = result.transaction_result
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.receive_by_user_id({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
config=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
client = gs2('loginReward')
api_result_handler = client.receive_by_user_id_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
config=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
missedReceive
Get login rewards
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
bonusModelName | string | ✓ | ~ 128 chars | Bonus Model Name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
stepNumber | int | ✓ | ~ 100 | Step number to receive | ||
config | List<Config> | [] | ~ 32 items | Set values to be applied to transaction variables |
Result
Type | Description | |
---|---|---|
item | ReceiveStatus | Receive status |
bonusModel | BonusModel | Login Bonus Model |
transactionId | string | Issed transaction ID |
stampSheet | string | Stamp sheets used to execute the purchase process |
stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
autoRunStampSheet | bool? | Is transaction auto-execution enabled? |
atomicCommit | bool? | Transaction to commit atomically |
transaction | string | Issued transaction |
transactionResult | TransactionResult | Transaction execution result |
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.MissedReceive(
&login_reward.MissedReceiveRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
AccessToken: pointy.String("accessToken-0001"),
StepNumber: pointy.Int32(1),
Config: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
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\MissedReceiveRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->missedReceive(
(new MissedReceiveRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withAccessToken(self::$accessToken0001)
->withStepNumber(1)
->withConfig(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
$transactionId = $result->getTransactionId();
$stampSheet = $result->getStampSheet();
$stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
$autoRunStampSheet = $result->getAutoRunStampSheet();
$atomicCommit = $result->getAtomicCommit();
$transaction = $result->getTransaction();
$transactionResult = $result->getTransactionResult();
} 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.MissedReceiveRequest;
import io.gs2.loginReward.result.MissedReceiveResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
MissedReceiveResult result = client.missedReceive(
new MissedReceiveRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
.withStepNumber(1)
.withConfig(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
String transactionId = result.getTransactionId();
String stampSheet = result.getStampSheet();
String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
boolean autoRunStampSheet = result.getAutoRunStampSheet();
boolean atomicCommit = result.getAtomicCommit();
String transaction = result.getTransaction();
TransactionResult transactionResult = result.getTransactionResult();
} 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.MissedReceiveRequest;
using Gs2.Gs2LoginReward.Result.MissedReceiveResult;
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.MissedReceiveResult> asyncResult = null;
yield return client.MissedReceive(
new Gs2.Gs2LoginReward.Request.MissedReceiveRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithAccessToken("accessToken-0001")
.WithStepNumber(1)
.WithConfig(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
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.missedReceive(
new Gs2LoginReward.MissedReceiveRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
.withStepNumber(1)
.withConfig(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
const transactionId = result.getTransactionId();
const stampSheet = result.getStampSheet();
const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
const autoRunStampSheet = result.getAutoRunStampSheet();
const atomicCommit = result.getAtomicCommit();
const transaction = result.getTransaction();
const transactionResult = result.getTransactionResult();
} 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.missed_receive(
login_reward.MissedReceiveRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_access_token(self.access_token_0001)
.with_step_number(1)
.with_config(None)
)
item = result.item
bonus_model = result.bonus_model
transaction_id = result.transaction_id
stamp_sheet = result.stamp_sheet
stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
auto_run_stamp_sheet = result.auto_run_stamp_sheet
atomic_commit = result.atomic_commit
transaction = result.transaction
transaction_result = result.transaction_result
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.missed_receive({
namespaceName="namespace1",
bonusModelName="bonus-0001",
accessToken="accessToken-0001",
stepNumber=1,
config=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
client = gs2('loginReward')
api_result_handler = client.missed_receive_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
accessToken="accessToken-0001",
stepNumber=1,
config=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
missedReceiveByUserId
Get login rewards by userId
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
bonusModelName | string | ✓ | ~ 128 chars | Bonus Model Name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
stepNumber | int | ✓ | ~ 100 | Step number to receive | ||
config | List<Config> | [] | ~ 32 items | Set values to be applied to transaction variables | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | ReceiveStatus | Receive status |
bonusModel | BonusModel | Login Bonus Model |
transactionId | string | Issed transaction ID |
stampSheet | string | Stamp sheets used to execute the purchase process |
stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
autoRunStampSheet | bool? | Is transaction auto-execution enabled? |
atomicCommit | bool? | Transaction to commit atomically |
transaction | string | Issued transaction |
transactionResult | TransactionResult | Transaction execution result |
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.MissedReceiveByUserId(
&login_reward.MissedReceiveByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
UserId: pointy.String("user-0001"),
StepNumber: pointy.Int32(1),
Config: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
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\MissedReceiveByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->missedReceiveByUserId(
(new MissedReceiveByUserIdRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withUserId("user-0001")
->withStepNumber(1)
->withConfig(null)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
$transactionId = $result->getTransactionId();
$stampSheet = $result->getStampSheet();
$stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
$autoRunStampSheet = $result->getAutoRunStampSheet();
$atomicCommit = $result->getAtomicCommit();
$transaction = $result->getTransaction();
$transactionResult = $result->getTransactionResult();
} 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.MissedReceiveByUserIdRequest;
import io.gs2.loginReward.result.MissedReceiveByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
MissedReceiveByUserIdResult result = client.missedReceiveByUserId(
new MissedReceiveByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withStepNumber(1)
.withConfig(null)
.withTimeOffsetToken(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
String transactionId = result.getTransactionId();
String stampSheet = result.getStampSheet();
String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
boolean autoRunStampSheet = result.getAutoRunStampSheet();
boolean atomicCommit = result.getAtomicCommit();
String transaction = result.getTransaction();
TransactionResult transactionResult = result.getTransactionResult();
} 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.MissedReceiveByUserIdRequest;
using Gs2.Gs2LoginReward.Result.MissedReceiveByUserIdResult;
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.MissedReceiveByUserIdResult> asyncResult = null;
yield return client.MissedReceiveByUserId(
new Gs2.Gs2LoginReward.Request.MissedReceiveByUserIdRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithUserId("user-0001")
.WithStepNumber(1)
.WithConfig(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
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.missedReceiveByUserId(
new Gs2LoginReward.MissedReceiveByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withStepNumber(1)
.withConfig(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
const transactionId = result.getTransactionId();
const stampSheet = result.getStampSheet();
const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
const autoRunStampSheet = result.getAutoRunStampSheet();
const atomicCommit = result.getAtomicCommit();
const transaction = result.getTransaction();
const transactionResult = result.getTransactionResult();
} 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.missed_receive_by_user_id(
login_reward.MissedReceiveByUserIdRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_user_id('user-0001')
.with_step_number(1)
.with_config(None)
.with_time_offset_token(None)
)
item = result.item
bonus_model = result.bonus_model
transaction_id = result.transaction_id
stamp_sheet = result.stamp_sheet
stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
auto_run_stamp_sheet = result.auto_run_stamp_sheet
atomic_commit = result.atomic_commit
transaction = result.transaction
transaction_result = result.transaction_result
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.missed_receive_by_user_id({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
stepNumber=1,
config=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
client = gs2('loginReward')
api_result_handler = client.missed_receive_by_user_id_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
stepNumber=1,
config=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
describeReceiveStatuses
Get list of login_reward
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
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<ReceiveStatus> | List of ReceiveStatuses |
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.DescribeReceiveStatuses(
&login_reward.DescribeReceiveStatusesRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("accessToken-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\DescribeReceiveStatusesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeReceiveStatuses(
(new DescribeReceiveStatusesRequest())
->withNamespaceName(self::namespace1)
->withAccessToken(self::$accessToken0001)
->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.DescribeReceiveStatusesRequest;
import io.gs2.loginReward.result.DescribeReceiveStatusesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DescribeReceiveStatusesResult result = client.describeReceiveStatuses(
new DescribeReceiveStatusesRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
List<ReceiveStatus> 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.DescribeReceiveStatusesRequest;
using Gs2.Gs2LoginReward.Result.DescribeReceiveStatusesResult;
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.DescribeReceiveStatusesResult> asyncResult = null;
yield return client.DescribeReceiveStatuses(
new Gs2.Gs2LoginReward.Request.DescribeReceiveStatusesRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("accessToken-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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.describeReceiveStatuses(
new Gs2LoginReward.DescribeReceiveStatusesRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import 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_receive_statuses(
login_reward.DescribeReceiveStatusesRequest()
.with_namespace_name(self.hash1)
.with_access_token(self.access_token_0001)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.describe_receive_statuses({
namespaceName="namespace1",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('loginReward')
api_result_handler = client.describe_receive_statuses_async({
namespaceName="namespace1",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
describeReceiveStatusesByUserId
Obtain list of login_reward by specifying a user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired | |
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
items | List<ReceiveStatus> | List of ReceiveStatuses |
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.DescribeReceiveStatusesByUserId(
&login_reward.DescribeReceiveStatusesByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
PageToken: nil,
Limit: nil,
TimeOffsetToken: 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\DescribeReceiveStatusesByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeReceiveStatusesByUserId(
(new DescribeReceiveStatusesByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(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.DescribeReceiveStatusesByUserIdRequest;
import io.gs2.loginReward.result.DescribeReceiveStatusesByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DescribeReceiveStatusesByUserIdResult result = client.describeReceiveStatusesByUserId(
new DescribeReceiveStatusesByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<ReceiveStatus> 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.DescribeReceiveStatusesByUserIdRequest;
using Gs2.Gs2LoginReward.Result.DescribeReceiveStatusesByUserIdResult;
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.DescribeReceiveStatusesByUserIdResult> asyncResult = null;
yield return client.DescribeReceiveStatusesByUserId(
new Gs2.Gs2LoginReward.Request.DescribeReceiveStatusesByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(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.describeReceiveStatusesByUserId(
new Gs2LoginReward.DescribeReceiveStatusesByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(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_receive_statuses_by_user_id(
login_reward.DescribeReceiveStatusesByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(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_receive_statuses_by_user_id({
namespaceName="namespace1",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('loginReward')
api_result_handler = client.describe_receive_statuses_by_user_id_async({
namespaceName="namespace1",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
getReceiveStatus
Get Receive Status
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
bonusModelName | string | ✓ | ~ 128 chars | Bonus Model Name | ||
accessToken | string | ✓ | ~ 128 chars | User Id |
Result
Type | Description | |
---|---|---|
item | ReceiveStatus | ReceiveStatus |
bonusModel | BonusModel | Bonus Model |
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.GetReceiveStatus(
&login_reward.GetReceiveStatusRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
AccessToken: pointy.String("accessToken-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
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\GetReceiveStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getReceiveStatus(
(new GetReceiveStatusRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withAccessToken(self::$accessToken0001)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.GetReceiveStatusRequest;
import io.gs2.loginReward.result.GetReceiveStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
GetReceiveStatusResult result = client.getReceiveStatus(
new GetReceiveStatusRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.GetReceiveStatusRequest;
using Gs2.Gs2LoginReward.Result.GetReceiveStatusResult;
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.GetReceiveStatusResult> asyncResult = null;
yield return client.GetReceiveStatus(
new Gs2.Gs2LoginReward.Request.GetReceiveStatusRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithAccessToken("accessToken-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
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.getReceiveStatus(
new Gs2LoginReward.GetReceiveStatusRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} 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_receive_status(
login_reward.GetReceiveStatusRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_access_token(self.access_token_0001)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.get_receive_status({
namespaceName="namespace1",
bonusModelName="bonus-0001",
accessToken="accessToken-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.get_receive_status_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
accessToken="accessToken-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
getReceiveStatusByUserId
Get Receive Status by specifying user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
bonusModelName | string | ✓ | ~ 128 chars | Bonus Model Name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | ReceiveStatus | ReceiveStatus |
bonusModel | BonusModel | Bonus Model |
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.GetReceiveStatusByUserId(
&login_reward.GetReceiveStatusByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
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\GetReceiveStatusByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getReceiveStatusByUserId(
(new GetReceiveStatusByUserIdRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.GetReceiveStatusByUserIdRequest;
import io.gs2.loginReward.result.GetReceiveStatusByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
GetReceiveStatusByUserIdResult result = client.getReceiveStatusByUserId(
new GetReceiveStatusByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.GetReceiveStatusByUserIdRequest;
using Gs2.Gs2LoginReward.Result.GetReceiveStatusByUserIdResult;
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.GetReceiveStatusByUserIdResult> asyncResult = null;
yield return client.GetReceiveStatusByUserId(
new Gs2.Gs2LoginReward.Request.GetReceiveStatusByUserIdRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
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.getReceiveStatusByUserId(
new Gs2LoginReward.GetReceiveStatusByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} 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_receive_status_by_user_id(
login_reward.GetReceiveStatusByUserIdRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_user_id('user-0001')
.with_time_offset_token(None)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.get_receive_status_by_user_id({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.get_receive_status_by_user_id_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
deleteReceiveStatusByUserId
Delete receive status by specifying user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
bonusModelName | string | ✓ | ~ 128 chars | Bonus Model Name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | ReceiveStatus | ReceiveStatus |
bonusModel | BonusModel | Bonus Model |
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.DeleteReceiveStatusByUserId(
&login_reward.DeleteReceiveStatusByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
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\DeleteReceiveStatusByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteReceiveStatusByUserId(
(new DeleteReceiveStatusByUserIdRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.DeleteReceiveStatusByUserIdRequest;
import io.gs2.loginReward.result.DeleteReceiveStatusByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DeleteReceiveStatusByUserIdResult result = client.deleteReceiveStatusByUserId(
new DeleteReceiveStatusByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.DeleteReceiveStatusByUserIdRequest;
using Gs2.Gs2LoginReward.Result.DeleteReceiveStatusByUserIdResult;
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.DeleteReceiveStatusByUserIdResult> asyncResult = null;
yield return client.DeleteReceiveStatusByUserId(
new Gs2.Gs2LoginReward.Request.DeleteReceiveStatusByUserIdRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
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.deleteReceiveStatusByUserId(
new Gs2LoginReward.DeleteReceiveStatusByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} 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_receive_status_by_user_id(
login_reward.DeleteReceiveStatusByUserIdRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_user_id('user-0001')
.with_time_offset_token(None)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.delete_receive_status_by_user_id({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.delete_receive_status_by_user_id_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
deleteReceiveStatusByStampSheet
Execute reset of receive status as acquire action
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stampSheet | string | ✓ | ~ 5242880 chars | Transaction | ||
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
item | ReceiveStatus | ReceiveStatus |
bonusModel | BonusModel | Bonus Model |
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.DeleteReceiveStatusByStampSheet(
&login_reward.DeleteReceiveStatusByStampSheetRequest {
StampSheet: pointy.String("stampSheet"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
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\DeleteReceiveStatusByStampSheetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteReceiveStatusByStampSheet(
(new DeleteReceiveStatusByStampSheetRequest())
->withStampSheet(self::stampSheet)
->withKeyId(self::key-0001)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.DeleteReceiveStatusByStampSheetRequest;
import io.gs2.loginReward.result.DeleteReceiveStatusByStampSheetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
DeleteReceiveStatusByStampSheetResult result = client.deleteReceiveStatusByStampSheet(
new DeleteReceiveStatusByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.DeleteReceiveStatusByStampSheetRequest;
using Gs2.Gs2LoginReward.Result.DeleteReceiveStatusByStampSheetResult;
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.DeleteReceiveStatusByStampSheetResult> asyncResult = null;
yield return client.DeleteReceiveStatusByStampSheet(
new Gs2.Gs2LoginReward.Request.DeleteReceiveStatusByStampSheetRequest()
.WithStampSheet("stampSheet")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
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.deleteReceiveStatusByStampSheet(
new Gs2LoginReward.DeleteReceiveStatusByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} 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_receive_status_by_stamp_sheet(
login_reward.DeleteReceiveStatusByStampSheetRequest()
.with_stamp_sheet(self.stamp_sheet)
.with_key_id(self.key1.key_id)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.delete_receive_status_by_stamp_sheet({
stampSheet="stampSheet",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.delete_receive_status_by_stamp_sheet_async({
stampSheet="stampSheet",
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
markReceived
Mark as received
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
bonusModelName | string | ✓ | ~ 128 chars | Bonus Model Name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
stepNumber | int | ✓ | ~ 100 | Step Number |
Result
Type | Description | |
---|---|---|
item | ReceiveStatus | ReceiveStatus |
bonusModel | BonusModel | Bonus Model |
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.MarkReceived(
&login_reward.MarkReceivedRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
AccessToken: pointy.String("accessToken-0001"),
StepNumber: pointy.Int32(1),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
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\MarkReceivedRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->markReceived(
(new MarkReceivedRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withAccessToken(self::$accessToken0001)
->withStepNumber(1)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.MarkReceivedRequest;
import io.gs2.loginReward.result.MarkReceivedResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
MarkReceivedResult result = client.markReceived(
new MarkReceivedRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
.withStepNumber(1)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.MarkReceivedRequest;
using Gs2.Gs2LoginReward.Result.MarkReceivedResult;
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.MarkReceivedResult> asyncResult = null;
yield return client.MarkReceived(
new Gs2.Gs2LoginReward.Request.MarkReceivedRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithAccessToken("accessToken-0001")
.WithStepNumber(1),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
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.markReceived(
new Gs2LoginReward.MarkReceivedRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withAccessToken("accessToken-0001")
.withStepNumber(1)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} 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.mark_received(
login_reward.MarkReceivedRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_access_token(self.access_token_0001)
.with_step_number(1)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.mark_received({
namespaceName="namespace1",
bonusModelName="bonus-0001",
accessToken="accessToken-0001",
stepNumber=1,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.mark_received_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
accessToken="accessToken-0001",
stepNumber=1,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
markReceivedByUserId
Mark as received by specifying user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
bonusModelName | string | ✓ | ~ 128 chars | Bonus Model Name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
stepNumber | int | ✓ | ~ 100 | Step Number | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | ReceiveStatus | ReceiveStatus |
bonusModel | BonusModel | Bonus Model |
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.MarkReceivedByUserId(
&login_reward.MarkReceivedByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
UserId: pointy.String("user-0001"),
StepNumber: pointy.Int32(1),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
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\MarkReceivedByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->markReceivedByUserId(
(new MarkReceivedByUserIdRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withUserId("user-0001")
->withStepNumber(1)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.MarkReceivedByUserIdRequest;
import io.gs2.loginReward.result.MarkReceivedByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
MarkReceivedByUserIdResult result = client.markReceivedByUserId(
new MarkReceivedByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withStepNumber(1)
.withTimeOffsetToken(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.MarkReceivedByUserIdRequest;
using Gs2.Gs2LoginReward.Result.MarkReceivedByUserIdResult;
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.MarkReceivedByUserIdResult> asyncResult = null;
yield return client.MarkReceivedByUserId(
new Gs2.Gs2LoginReward.Request.MarkReceivedByUserIdRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithUserId("user-0001")
.WithStepNumber(1)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
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.markReceivedByUserId(
new Gs2LoginReward.MarkReceivedByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withStepNumber(1)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} 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.mark_received_by_user_id(
login_reward.MarkReceivedByUserIdRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_user_id('user-0001')
.with_step_number(1)
.with_time_offset_token(None)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.mark_received_by_user_id({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
stepNumber=1,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.mark_received_by_user_id_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
stepNumber=1,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
unmarkReceivedByUserId
Unmark as received by specifying user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
bonusModelName | string | ✓ | ~ 128 chars | Bonus Model Name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
stepNumber | int | ✓ | ~ 100 | Step Number | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | ReceiveStatus | ReceiveStatus |
bonusModel | BonusModel | Bonus Model |
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.UnmarkReceivedByUserId(
&login_reward.UnmarkReceivedByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
BonusModelName: pointy.String("bonus-0001"),
UserId: pointy.String("user-0001"),
StepNumber: pointy.Int32(1),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
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\UnmarkReceivedByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->unmarkReceivedByUserId(
(new UnmarkReceivedByUserIdRequest())
->withNamespaceName(self::namespace1)
->withBonusModelName("bonus-0001")
->withUserId("user-0001")
->withStepNumber(1)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.UnmarkReceivedByUserIdRequest;
import io.gs2.loginReward.result.UnmarkReceivedByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
UnmarkReceivedByUserIdResult result = client.unmarkReceivedByUserId(
new UnmarkReceivedByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withStepNumber(1)
.withTimeOffsetToken(null)
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.UnmarkReceivedByUserIdRequest;
using Gs2.Gs2LoginReward.Result.UnmarkReceivedByUserIdResult;
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.UnmarkReceivedByUserIdResult> asyncResult = null;
yield return client.UnmarkReceivedByUserId(
new Gs2.Gs2LoginReward.Request.UnmarkReceivedByUserIdRequest()
.WithNamespaceName("namespace1")
.WithBonusModelName("bonus-0001")
.WithUserId("user-0001")
.WithStepNumber(1)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
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.unmarkReceivedByUserId(
new Gs2LoginReward.UnmarkReceivedByUserIdRequest()
.withNamespaceName("namespace1")
.withBonusModelName("bonus-0001")
.withUserId("user-0001")
.withStepNumber(1)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} 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.unmark_received_by_user_id(
login_reward.UnmarkReceivedByUserIdRequest()
.with_namespace_name(self.hash1)
.with_bonus_model_name('bonus-0001')
.with_user_id('user-0001')
.with_step_number(1)
.with_time_offset_token(None)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.unmark_received_by_user_id({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
stepNumber=1,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.unmark_received_by_user_id_async({
namespaceName="namespace1",
bonusModelName="bonus-0001",
userId="user-0001",
stepNumber=1,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
markReceivedByStampTask
Execute mark as received as consume action
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stampTask | string | ✓ | ~ 5242880 chars | Consume Action | ||
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
item | ReceiveStatus | ReceiveStatus |
bonusModel | BonusModel | Bonus Model |
newContextStack | string | Request of context in which consume action execution results are recorded |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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.MarkReceivedByStampTask(
&login_reward.MarkReceivedByStampTaskRequest {
StampTask: pointy.String("stampTask"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\LoginReward\Gs2LoginRewardRestClient;
use Gs2\LoginReward\Request\MarkReceivedByStampTaskRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->markReceivedByStampTask(
(new MarkReceivedByStampTaskRequest())
->withStampTask(self::stampTask)
->withKeyId(self::key-0001)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
$newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.loginReward.rest.Gs2LoginRewardRestClient;
import io.gs2.loginReward.request.MarkReceivedByStampTaskRequest;
import io.gs2.loginReward.result.MarkReceivedByStampTaskResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
MarkReceivedByStampTaskResult result = client.markReceivedByStampTask(
new MarkReceivedByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2LoginReward.Gs2LoginRewardRestClient;
using Gs2.Gs2LoginReward.Request.MarkReceivedByStampTaskRequest;
using Gs2.Gs2LoginReward.Result.MarkReceivedByStampTaskResult;
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.MarkReceivedByStampTaskResult> asyncResult = null;
yield return client.MarkReceivedByStampTask(
new Gs2.Gs2LoginReward.Request.MarkReceivedByStampTaskRequest()
.WithStampTask("stampTask")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
var newContextStack = result.NewContextStack;
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.markReceivedByStampTask(
new Gs2LoginReward.MarkReceivedByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
const newContextStack = result.getNewContextStack();
} 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.mark_received_by_stamp_task(
login_reward.MarkReceivedByStampTaskRequest()
.with_stamp_task(self.stamp_task)
.with_key_id(self.key1.key_id)
)
item = result.item
bonus_model = result.bonus_model
new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.mark_received_by_stamp_task({
stampTask="stampTask",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
newContextStack = result.newContextStack;
client = gs2('loginReward')
api_result_handler = client.mark_received_by_stamp_task_async({
stampTask="stampTask",
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
newContextStack = result.newContextStack;
unmarkReceivedByStampSheet
Execute unmark as received as acquire action
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stampSheet | string | ✓ | ~ 5242880 chars | Transaction | ||
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
item | ReceiveStatus | ReceiveStatus |
bonusModel | BonusModel | Bonus Model |
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.UnmarkReceivedByStampSheet(
&login_reward.UnmarkReceivedByStampSheetRequest {
StampSheet: pointy.String("stampSheet"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
bonusModel := result.BonusModel
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\UnmarkReceivedByStampSheetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->unmarkReceivedByStampSheet(
(new UnmarkReceivedByStampSheetRequest())
->withStampSheet(self::stampSheet)
->withKeyId(self::key-0001)
);
$item = $result->getItem();
$bonusModel = $result->getBonusModel();
} 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.UnmarkReceivedByStampSheetRequest;
import io.gs2.loginReward.result.UnmarkReceivedByStampSheetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2LoginRewardRestClient client = new Gs2LoginRewardRestClient(session);
try {
UnmarkReceivedByStampSheetResult result = client.unmarkReceivedByStampSheet(
new UnmarkReceivedByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
ReceiveStatus item = result.getItem();
BonusModel bonusModel = result.getBonusModel();
} 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.UnmarkReceivedByStampSheetRequest;
using Gs2.Gs2LoginReward.Result.UnmarkReceivedByStampSheetResult;
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.UnmarkReceivedByStampSheetResult> asyncResult = null;
yield return client.UnmarkReceivedByStampSheet(
new Gs2.Gs2LoginReward.Request.UnmarkReceivedByStampSheetRequest()
.WithStampSheet("stampSheet")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var bonusModel = result.BonusModel;
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.unmarkReceivedByStampSheet(
new Gs2LoginReward.UnmarkReceivedByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
const item = result.getItem();
const bonusModel = result.getBonusModel();
} 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.unmark_received_by_stamp_sheet(
login_reward.UnmarkReceivedByStampSheetRequest()
.with_stamp_sheet(self.stamp_sheet)
.with_key_id(self.key1.key_id)
)
item = result.item
bonus_model = result.bonus_model
except core.Gs2Exception as e:
exit(1)
client = gs2('loginReward')
api_result = client.unmark_received_by_stamp_sheet({
stampSheet="stampSheet",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;
client = gs2('loginReward')
api_result_handler = client.unmark_received_by_stamp_sheet_async({
stampSheet="stampSheet",
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
bonusModel = result.bonusModel;