API Reference of GS2-Mission SDK
Model
Complete
Mission Accomplishments
| Type | Condition | Require | Default | Limitation | Description |
---|
completeId | string | | ✓ | | ~ 1024 chars | Status of Achievement GRN |
userId | string | | ✓ | | ~ 128 chars | User Id |
missionGroupName | string | | ✓ | | ~ 128 chars | Mission Group Name |
completedMissionTaskNames | List<string> | | | [] | | List of Completed Task Names |
receivedMissionTaskNames | List<string> | | | [] | | List of Reward has been received Task Names |
nextResetAt | long | | | | | Next reset timing |
createdAt | long | | ✓ | | | Datetime of creation |
updatedAt | long | | ✓ | | | Datetime of last update |
revision | long | | | 0 | ~ 9223372036854775805 | Revision |
NotificationSetting
| Type | Condition | Require | Default | Limitation | Description |
---|
gatewayNamespaceId | string | | ✓ | | ~ 1024 chars | Namespace GRN |
enableTransferMobileNotification | bool? | | | | | Forwarding to mobile push notification |
sound | string | | | | ~ 1024 chars | Sound file name to be used for mobile push notifications |
CounterModelMaster
Counter Model Master
The counter model master is an entity that can be set as a condition for accomplishment of mission tasks.
Since counter values can be referenced from multiple mission groups, a single counter can be set as an accomplishment condition for multiple mission groups, such as weekly and daily missions.
| Type | Condition | Require | Default | Limitation | Description |
---|
counterId | string | | ✓ | | ~ 1024 chars | Counter Model Master GRN |
name | string | | ✓ | | ~ 128 chars | Counter Name |
metadata | string | | | | ~ 1024 chars | metadata |
description | string | | | | ~ 1024 chars | description of Namespace |
scopes | List<CounterScopeModel> | | ✓ | [] | | List of Counter reset timing |
challengePeriodEventId | string | | | | ~ 1024 chars | GS2-Schedule event GRN that sets the period during which the counter can be operated. |
createdAt | long | | ✓ | | | Datetime of creation |
updatedAt | long | | ✓ | | | Datetime of last update |
revision | long | | | 0 | ~ 9223372036854775805 | Revision |
CounterScopeModel
| Type | Condition | Require | Default | Limitation | Description |
---|
resetType | enum [’notReset’, ‘daily’, ‘weekly’, ‘monthly’] | | ✓ | | ~ 128 chars | Reset timing |
resetDayOfMonth | int | {resetType} == “monthly” | ✓ | | 1 ~ 31 | Date to reset (If the value exceeds the days of the month, it is treated as the last day.) |
resetDayOfWeek | enum [‘sunday’, ‘monday’, ’tuesday’, ‘wednesday’, ’thursday’, ‘friday’, ‘saturday’] | {resetType} == “weekly” | ✓ | | ~ 128 chars | Day of the week to reset |
resetHour | int | {resetType} in [“monthly”, “weekly”, “daily”] | ✓ | | ~ 23 | Hour of Reset |
MissionGroupModelMaster
Mission Group Model Master
A mission group is an entity that groups tasks by counter reset timing.
For example, one group for daily missions. One group for Weekly Mission.
| Type | Condition | Require | Default | Limitation | Description |
---|
missionGroupId | string | | ✓ | | ~ 1024 chars | Mission Group Master GRN |
name | string | | ✓ | | ~ 128 chars | Mission Group Name |
metadata | string | | | | ~ 1024 chars | metadata |
description | string | | | | ~ 1024 chars | description of Namespace |
resetType | enum [’notReset’, ‘daily’, ‘weekly’, ‘monthly’] | | ✓ | “notReset” | ~ 128 chars | Reset timing |
resetDayOfMonth | int | {resetType} == “monthly” | ✓ | | 1 ~ 31 | Date to reset (If the value exceeds the days of the month, it is treated as the last day.) |
resetDayOfWeek | enum [‘sunday’, ‘monday’, ’tuesday’, ‘wednesday’, ’thursday’, ‘friday’, ‘saturday’] | {resetType} == “weekly” | ✓ | | ~ 128 chars | Day of the week to reset |
resetHour | int | {resetType} in [“monthly”, “weekly”, “daily”] | ✓ | | ~ 23 | Hour of Reset |
completeNotificationNamespaceId | string | | | | ~ 1024 chars | Push notifications when mission tasks are accomplished |
createdAt | long | | ✓ | | | Datetime of creation |
updatedAt | long | | ✓ | | | Datetime of last update |
revision | long | | | 0 | ~ 9223372036854775805 | Revision |
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 | | ✓ | | ~ 32 chars | Namespace name |
description | string | | | | ~ 1024 chars | description of Namespace |
transactionSetting | TransactionSetting | | ✓ | | | Transaction settings |
missionCompleteScript | ScriptSetting | | | | | Script to run when a mission is accomplished |
counterIncrementScript | ScriptSetting | | | | | Script to run when the counter rises |
receiveRewardsScript | ScriptSetting | | | | | Script to run when a reward is received |
completeNotification | NotificationSetting | | | | | Push notifications when mission tasks are accomplished |
logSetting | LogSetting | | | | | Log output settings |
createdAt | long | | ✓ | | | Datetime of creation |
updatedAt | long | | ✓ | | | Datetime of last update |
queueNamespaceId | string | | | | ~ 1024 chars | Namespace in GS2-JobQueue used to run the stamp sheet |
keyId | string | | | | ~ 1024 chars | GS2-Key namespace used to issue stamp sheets |
revision | long | | | 0 | ~ 9223372036854775805 | Revision |
Counter
Counter
A counter is an entity that keeps track of mission progress for each game player.
Counter values are aggregated by the duration of the associated task.
Therefore, one counter can have multiple values.
For example, for a quest clear count counter, the number of times the quest was completed this month, this week, and today. For example, a quest clear count counter could have the following values.
| Type | Condition | Require | Default | Limitation | Description |
---|
counterId | string | | ✓ | | ~ 1024 chars | Counter GRN |
userId | string | | ✓ | | ~ 128 chars | User Id |
name | string | | ✓ | | ~ 128 chars | Counter Name |
values | List<ScopedValue> | | | | | Value |
createdAt | long | | ✓ | | | Datetime of creation |
updatedAt | long | | ✓ | | | Datetime of last update |
revision | long | | | 0 | ~ 9223372036854775805 | Revision |
CurrentMissionMaster
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.
Please refer to the documentation for the format of the JSON file.
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceId | string | | ✓ | | ~ 1024 chars | Namespace GRN |
settings | string | | ✓ | | ~ 5242880 chars | Master data |
CounterModel
Counter Model
The counter model is an entity that can be set as a condition for accomplishing mission tasks.
Since counter values can be referenced by multiple mission groups, a single counter can be set as an accomplishment condition for multiple mission groups, such as weekly and daily missions.
| Type | Condition | Require | Default | Limitation | Description |
---|
counterId | string | | ✓ | | ~ 1024 chars | Counter Model GRN |
name | string | | ✓ | | ~ 128 chars | Counter Name |
metadata | string | | | | ~ 1024 chars | metadata |
scopes | List<CounterScopeModel> | | ✓ | [] | | List of Counter reset timing |
challengePeriodEventId | string | | | | ~ 1024 chars | GS2-Schedule event GRN that sets the period during which the counter can be operated. |
MissionGroupModel
Mission Group Model
A mission group is an entity that groups tasks by counter reset timing.
For example, one group for daily missions. One group for Weekly Mission.
| Type | Condition | Require | Default | Limitation | Description |
---|
missionGroupId | string | | ✓ | | ~ 1024 chars | Mission Group GRN |
name | string | | ✓ | | ~ 128 chars | Mission Group Name |
metadata | string | | | | ~ 1024 chars | metadata |
tasks | List<MissionTaskModel> | | | | | List of Mission Task |
resetType | enum [’notReset’, ‘daily’, ‘weekly’, ‘monthly’] | | ✓ | “notReset” | ~ 128 chars | Reset timing |
resetDayOfMonth | int | {resetType} == “monthly” | ✓ | | 1 ~ 31 | Date to reset (If the value exceeds the days of the month, it is treated as the last day.) |
resetDayOfWeek | enum [‘sunday’, ‘monday’, ’tuesday’, ‘wednesday’, ’thursday’, ‘friday’, ‘saturday’] | {resetType} == “weekly” | ✓ | | ~ 128 chars | Day of the week to reset |
resetHour | int | {resetType} in [“monthly”, “weekly”, “daily”] | ✓ | | ~ 23 | Hour of Reset |
completeNotificationNamespaceId | string | | | | ~ 1024 chars | Namespace GRN |
MissionTaskModel
Mission Task Model Master
A mission task is an entity that defines the conditions under which a reward will be given if the value of the associated counter exceeds a certain level.
| Type | Condition | Require | Default | Limitation | Description |
---|
missionTaskId | string | | ✓ | | ~ 1024 chars | Mission Task GRN |
name | string | | ✓ | | ~ 128 chars | Task Name |
metadata | string | | | | ~ 1024 chars | metadata |
counterName | string | | ✓ | | ~ 128 chars | Counter Name |
targetResetType | enum [’notReset’, ‘daily’, ‘weekly’, ‘monthly’] | | | | ~ 128 chars | Target Reset timing |
targetValue | long | | ✓ | | 1 ~ 9223372036854775805 | Target value |
completeAcquireActions | List<AcquireAction> | | | [] | | Rewards for mission accomplishment |
challengePeriodEventId | string | | | | ~ 1024 chars | GS2-Schedule event GRN with a set period of time during which rewards can be received |
premiseMissionTaskName | string | | | | ~ 128 chars | Name of the tasks accomplish to attempt this task |
ScopedValue
| Type | Condition | Require | Default | Limitation | Description |
---|
resetType | enum [’notReset’, ‘daily’, ‘weekly’, ‘monthly’] | | ✓ | | ~ 128 chars | Reset timing |
value | long | | ✓ | 0 | ~ 9223372036854775805 | Count value |
nextResetAt | long | | | | | Next reset timing |
updatedAt | long | | ✓ | | | Datetime of last update |
MissionTaskModelMaster
Mission Task Model Master
A mission task is an entity that defines the conditions under which a reward will be given if the value of the associated counter exceeds a certain level.
| Type | Condition | Require | Default | Limitation | Description |
---|
missionTaskId | string | | ✓ | | ~ 1024 chars | Mission Task Master GRN |
name | string | | ✓ | | ~ 128 chars | Task Name |
metadata | string | | | | ~ 1024 chars | metadata |
description | string | | | | ~ 1024 chars | description of Namespace |
counterName | string | | ✓ | | ~ 128 chars | Counter Name |
targetResetType | enum [’notReset’, ‘daily’, ‘weekly’, ‘monthly’] | | | | ~ 128 chars | Target Reset timing |
targetValue | long | | ✓ | | 1 ~ 9223372036854775805 | Target value |
completeAcquireActions | List<AcquireAction> | | | [] | | Rewards for mission accomplishment |
challengePeriodEventId | string | | | | ~ 1024 chars | GS2-Schedule event GRN with a set period of time during which rewards can be received |
premiseMissionTaskName | string | | | | ~ 128 chars | Name of the tasks accomplish to attempt this task |
createdAt | long | | ✓ | | | Datetime of creation |
updatedAt | long | | ✓ | | | Datetime of last update |
revision | long | | | 0 | ~ 9223372036854775805 | Revision |
AcquireAction
| Type | Condition | Require | Default | Limitation | Description |
---|
action | enum [] | | ✓ | | ~ 128 chars | Types of actions to be performed in the stamp sheet |
request | string | | ✓ | | ~ 1048576 chars | JSON of request |
Config
| Type | Condition | Require | Default | Limitation | Description |
---|
key | string | | ✓ | | ~ 64 chars | Name |
value | string | | | | ~ 51200 chars | Value |
LogSetting
| Type | Condition | Require | Default | Limitation | Description |
---|
loggingNamespaceId | string | | ✓ | | ~ 1024 chars | Namespace GRN |
GitHubCheckoutSetting
| 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 |
ScriptSetting
| 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 |
TransactionSetting
| Type | Condition | Require | Default | Limitation | Description |
---|
enableAutoRun | bool | | ✓ | false | | Automatically run issued stamp sheets on the server side, or |
distributorNamespaceId | string | {enableAutoRun} | ✓ | | ~ 1024 chars | GS2-Distributor namespace used for stamp sheet execution |
keyId | string | !{enableAutoRun} | ✓ | | ~ 1024 chars | GS2-Key encryption key used to sign the stamp sheet |
queueNamespaceId | string | | ✓ | | ~ 1024 chars | Namespace in GS2-JobQueue used to run the stamp sheet |
Methods
describeCompletes
Get list of achievement statuses
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 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<Complete> | List of status of achievement |
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/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.DescribeCompletes(
&mission.DescribeCompletesRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("$access_token_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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeCompletesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeCompletes(
(new DescribeCompletesRequest())
->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeCompletesRequest;
import io.gs2.mission.result.DescribeCompletesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DescribeCompletesResult result = client.describeCompletes(
new DescribeCompletesRequest()
.withNamespaceName("namespace1")
.withAccessToken("$access_token_0001")
.withPageToken(null)
.withLimit(null)
);
List<Complete> 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.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.DescribeCompletesRequest;
using Gs2.Gs2Mission.Result.DescribeCompletesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.DescribeCompletesResult> asyncResult = null;
yield return client.DescribeCompletes(
new Gs2.Gs2Mission.Request.DescribeCompletesRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("$access_token_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 Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.describeCompletes(
new Gs2Mission.DescribeCompletesRequest()
.withNamespaceName("namespace1")
.withAccessToken("$access_token_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 mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.describe_completes(
mission.DescribeCompletesRequest()
.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('mission')
api_result = client.describe_completes({
namespaceName='namespace1',
accessToken='$access_token_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;
describeCompletesByUserId
Obtain list of achievement statuses by specifying the user ID
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 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 |
Result
| Type | Description |
---|
items | List<Complete> | List of status of achievement |
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/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.DescribeCompletesByUserId(
&mission.DescribeCompletesByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeCompletesByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeCompletesByUserId(
(new DescribeCompletesByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeCompletesByUserIdRequest;
import io.gs2.mission.result.DescribeCompletesByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DescribeCompletesByUserIdResult result = client.describeCompletesByUserId(
new DescribeCompletesByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
);
List<Complete> 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.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.DescribeCompletesByUserIdRequest;
using Gs2.Gs2Mission.Result.DescribeCompletesByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.DescribeCompletesByUserIdResult> asyncResult = null;
yield return client.DescribeCompletesByUserId(
new Gs2.Gs2Mission.Request.DescribeCompletesByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-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 Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.describeCompletesByUserId(
new Gs2Mission.DescribeCompletesByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-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 mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.describe_completes_by_user_id(
mission.DescribeCompletesByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-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('mission')
api_result = client.describe_completes_by_user_id({
namespaceName='namespace1',
userId='user-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;
complete
Issue stamp sheets to receive rewards for mission accomplishment
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
missionGroupName | string | | ✓ | | ~ 128 chars | Mission Group Name |
missionTaskName | string | | ✓ | | ~ 128 chars | Task Name |
accessToken | string | | ✓ | | ~ 128 chars | User Id |
config | List<Config> | | | [] | | Set values to be applied to stamp sheet variables |
Result
| Type | Description |
---|
transactionId | string | Transaction ID of the stamp sheet issued |
stampSheet | string | Stamp sheet to receive rewards for mission accomplishment |
stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
autoRunStampSheet | bool? | Is stamp sheet auto-execution enabled? |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.Complete(
&mission.CompleteRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-0001"),
MissionTaskName: pointy.String("mission-task-0001"),
AccessToken: pointy.String("$access_token_0001"),
Config: nil,
}
)
if err != nil {
panic("error occurred")
}
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CompleteRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->complete(
(new CompleteRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-0001")
->withMissionTaskName("mission-task-0001")
->withAccessToken(self::$accessToken0001)
->withConfig(null)
);
$transactionId = $result->getTransactionId();
$stampSheet = $result->getStampSheet();
$stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
$autoRunStampSheet = $result->getAutoRunStampSheet();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.CompleteRequest;
import io.gs2.mission.result.CompleteResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
CompleteResult result = client.complete(
new CompleteRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-0001")
.withAccessToken("$access_token_0001")
.withConfig(null)
);
String transactionId = result.getTransactionId();
String stampSheet = result.getStampSheet();
String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
boolean autoRunStampSheet = result.getAutoRunStampSheet();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.CompleteRequest;
using Gs2.Gs2Mission.Result.CompleteResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.CompleteResult> asyncResult = null;
yield return client.Complete(
new Gs2.Gs2Mission.Request.CompleteRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-0001")
.WithMissionTaskName("mission-task-0001")
.WithAccessToken("$access_token_0001")
.WithConfig(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.complete(
new Gs2Mission.CompleteRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-0001")
.withAccessToken("$access_token_0001")
.withConfig(null)
);
const transactionId = result.getTransactionId();
const stampSheet = result.getStampSheet();
const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
const autoRunStampSheet = result.getAutoRunStampSheet();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.complete(
mission.CompleteRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
.with_mission_task_name('mission-task-0001')
.with_access_token(self.access_token_0001)
.with_config(None)
)
transaction_id = result.transaction_id
stamp_sheet = result.stamp_sheet
stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
auto_run_stamp_sheet = result.auto_run_stamp_sheet
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.complete({
namespaceName='namespace1',
missionGroupName='mission-group-0001',
missionTaskName='mission-task-0001',
accessToken='$access_token_0001',
config=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
completeByUserId
Issue stamp sheets to receive rewards for mission accomplishment by specifying user IDs
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
missionGroupName | string | | ✓ | | ~ 128 chars | Mission Group Name |
missionTaskName | string | | ✓ | | ~ 128 chars | Task Name |
userId | string | | ✓ | | ~ 128 chars | User Id |
config | List<Config> | | | [] | | Set values to be applied to stamp sheet variables |
Result
| Type | Description |
---|
transactionId | string | Transaction ID of the stamp sheet issued |
stampSheet | string | Stamp sheet to receive rewards for mission accomplishment |
stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
autoRunStampSheet | bool? | Is stamp sheet auto-execution enabled? |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.CompleteByUserId(
&mission.CompleteByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-0001"),
MissionTaskName: pointy.String("mission-task-0001"),
UserId: pointy.String("user-0001"),
Config: nil,
}
)
if err != nil {
panic("error occurred")
}
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CompleteByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->completeByUserId(
(new CompleteByUserIdRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-0001")
->withMissionTaskName("mission-task-0001")
->withUserId("user-0001")
->withConfig(null)
);
$transactionId = $result->getTransactionId();
$stampSheet = $result->getStampSheet();
$stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
$autoRunStampSheet = $result->getAutoRunStampSheet();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.CompleteByUserIdRequest;
import io.gs2.mission.result.CompleteByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
CompleteByUserIdResult result = client.completeByUserId(
new CompleteByUserIdRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-0001")
.withUserId("user-0001")
.withConfig(null)
);
String transactionId = result.getTransactionId();
String stampSheet = result.getStampSheet();
String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
boolean autoRunStampSheet = result.getAutoRunStampSheet();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.CompleteByUserIdRequest;
using Gs2.Gs2Mission.Result.CompleteByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.CompleteByUserIdResult> asyncResult = null;
yield return client.CompleteByUserId(
new Gs2.Gs2Mission.Request.CompleteByUserIdRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-0001")
.WithMissionTaskName("mission-task-0001")
.WithUserId("user-0001")
.WithConfig(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.completeByUserId(
new Gs2Mission.CompleteByUserIdRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-0001")
.withUserId("user-0001")
.withConfig(null)
);
const transactionId = result.getTransactionId();
const stampSheet = result.getStampSheet();
const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
const autoRunStampSheet = result.getAutoRunStampSheet();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.complete_by_user_id(
mission.CompleteByUserIdRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
.with_mission_task_name('mission-task-0001')
.with_user_id('user-0001')
.with_config(None)
)
transaction_id = result.transaction_id
stamp_sheet = result.stamp_sheet
stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
auto_run_stamp_sheet = result.auto_run_stamp_sheet
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.complete_by_user_id({
namespaceName='namespace1',
missionGroupName='mission-group-0001',
missionTaskName='mission-task-0001',
userId='user-0001',
config=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
receiveByUserId
Receive rewards for mission accomplishment
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
missionGroupName | string | | ✓ | | ~ 128 chars | Mission Group Name |
missionTaskName | string | | ✓ | | ~ 128 chars | Task Name |
userId | string | | ✓ | | ~ 128 chars | User Id |
Result
| Type | Description |
---|
item | Complete | Received Achievement |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.ReceiveByUserId(
&mission.ReceiveByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-0001"),
MissionTaskName: pointy.String("mission-task-0001"),
UserId: pointy.String("user-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\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)
->withMissionGroupName("mission-group-0001")
->withMissionTaskName("mission-task-0001")
->withUserId("user-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.ReceiveByUserIdRequest;
import io.gs2.mission.result.ReceiveByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
ReceiveByUserIdResult result = client.receiveByUserId(
new ReceiveByUserIdRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-0001")
.withUserId("user-0001")
);
Complete 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.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.ReceiveByUserIdRequest;
using Gs2.Gs2Mission.Result.ReceiveByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.ReceiveByUserIdResult> asyncResult = null;
yield return client.ReceiveByUserId(
new Gs2.Gs2Mission.Request.ReceiveByUserIdRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-0001")
.WithMissionTaskName("mission-task-0001")
.WithUserId("user-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 Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.receiveByUserId(
new Gs2Mission.ReceiveByUserIdRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-0001")
.withUserId("user-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.receive_by_user_id(
mission.ReceiveByUserIdRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
.with_mission_task_name('mission-task-0001')
.with_user_id('user-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.receive_by_user_id({
namespaceName='namespace1',
missionGroupName='mission-group-0001',
missionTaskName='mission-task-0001',
userId='user-0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
revertReceiveByUserId
Receive rewards for mission accomplishment
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
missionGroupName | string | | ✓ | | ~ 128 chars | Mission Group Name |
missionTaskName | string | | ✓ | | ~ 128 chars | Task Name |
userId | string | | ✓ | | ~ 128 chars | User Id |
Result
| Type | Description |
---|
item | Complete | Received Achievement |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.RevertReceiveByUserId(
&mission.RevertReceiveByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-0001"),
MissionTaskName: pointy.String("mission-task-0001"),
UserId: pointy.String("user-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\RevertReceiveByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->revertReceiveByUserId(
(new RevertReceiveByUserIdRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-0001")
->withMissionTaskName("mission-task-0001")
->withUserId("user-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.RevertReceiveByUserIdRequest;
import io.gs2.mission.result.RevertReceiveByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
RevertReceiveByUserIdResult result = client.revertReceiveByUserId(
new RevertReceiveByUserIdRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-0001")
.withUserId("user-0001")
);
Complete 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.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.RevertReceiveByUserIdRequest;
using Gs2.Gs2Mission.Result.RevertReceiveByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.RevertReceiveByUserIdResult> asyncResult = null;
yield return client.RevertReceiveByUserId(
new Gs2.Gs2Mission.Request.RevertReceiveByUserIdRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-0001")
.WithMissionTaskName("mission-task-0001")
.WithUserId("user-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 Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.revertReceiveByUserId(
new Gs2Mission.RevertReceiveByUserIdRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withMissionTaskName("mission-task-0001")
.withUserId("user-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.revert_receive_by_user_id(
mission.RevertReceiveByUserIdRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
.with_mission_task_name('mission-task-0001')
.with_user_id('user-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.revert_receive_by_user_id({
namespaceName='namespace1',
missionGroupName='mission-group-0001',
missionTaskName='mission-task-0001',
userId='user-0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getComplete
Obtain achievement status
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
missionGroupName | string | | ✓ | | ~ 128 chars | Mission Group Name |
accessToken | string | | ✓ | | ~ 128 chars | User Id |
Result
| Type | Description |
---|
item | Complete | status of achievement |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.GetComplete(
&mission.GetCompleteRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-0001"),
AccessToken: pointy.String("$access_token_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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetCompleteRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getComplete(
(new GetCompleteRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-0001")
->withAccessToken(self::$accessToken0001)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetCompleteRequest;
import io.gs2.mission.result.GetCompleteResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
GetCompleteResult result = client.getComplete(
new GetCompleteRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withAccessToken("$access_token_0001")
);
Complete 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.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.GetCompleteRequest;
using Gs2.Gs2Mission.Result.GetCompleteResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.GetCompleteResult> asyncResult = null;
yield return client.GetComplete(
new Gs2.Gs2Mission.Request.GetCompleteRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-0001")
.WithAccessToken("$access_token_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 Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.getComplete(
new Gs2Mission.GetCompleteRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withAccessToken("$access_token_0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.get_complete(
mission.GetCompleteRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
.with_access_token(self.access_token_0001)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.get_complete({
namespaceName='namespace1',
missionGroupName='mission-group-0001',
accessToken='$access_token_0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getCompleteByUserId
Obtain achievement status by specifying user ID
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
missionGroupName | string | | ✓ | | ~ 128 chars | Mission Group Name |
userId | string | | ✓ | | ~ 128 chars | User Id |
Result
| Type | Description |
---|
item | Complete | status of achievement |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.GetCompleteByUserId(
&mission.GetCompleteByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
MissionGroupName: pointy.String("mission-group-0001"),
UserId: pointy.String("user-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetCompleteByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCompleteByUserId(
(new GetCompleteByUserIdRequest())
->withNamespaceName(self::namespace1)
->withMissionGroupName("mission-group-0001")
->withUserId("user-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetCompleteByUserIdRequest;
import io.gs2.mission.result.GetCompleteByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
GetCompleteByUserIdResult result = client.getCompleteByUserId(
new GetCompleteByUserIdRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withUserId("user-0001")
);
Complete 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.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.GetCompleteByUserIdRequest;
using Gs2.Gs2Mission.Result.GetCompleteByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.GetCompleteByUserIdResult> asyncResult = null;
yield return client.GetCompleteByUserId(
new Gs2.Gs2Mission.Request.GetCompleteByUserIdRequest()
.WithNamespaceName("namespace1")
.WithMissionGroupName("mission-group-0001")
.WithUserId("user-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 Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.getCompleteByUserId(
new Gs2Mission.GetCompleteByUserIdRequest()
.withNamespaceName("namespace1")
.withMissionGroupName("mission-group-0001")
.withUserId("user-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.get_complete_by_user_id(
mission.GetCompleteByUserIdRequest()
.with_namespace_name(self.hash1)
.with_mission_group_name('mission-group-0001')
.with_user_id('user-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.get_complete_by_user_id({
namespaceName='namespace1',
missionGroupName='mission-group-0001',
userId='user-0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteCompleteByUserId
Delete achievement status
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
userId | string | | ✓ | | ~ 128 chars | User Id |
missionGroupName | string | | ✓ | | ~ 128 chars | Mission Group Name |
Result
| Type | Description |
---|
item | Complete | Deleted Achievements |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.DeleteCompleteByUserId(
&mission.DeleteCompleteByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
MissionGroupName: pointy.String("mission-group-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DeleteCompleteByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteCompleteByUserId(
(new DeleteCompleteByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withMissionGroupName("mission-group-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DeleteCompleteByUserIdRequest;
import io.gs2.mission.result.DeleteCompleteByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DeleteCompleteByUserIdResult result = client.deleteCompleteByUserId(
new DeleteCompleteByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withMissionGroupName("mission-group-0001")
);
Complete 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.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.DeleteCompleteByUserIdRequest;
using Gs2.Gs2Mission.Result.DeleteCompleteByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.DeleteCompleteByUserIdResult> asyncResult = null;
yield return client.DeleteCompleteByUserId(
new Gs2.Gs2Mission.Request.DeleteCompleteByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithMissionGroupName("mission-group-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.deleteCompleteByUserId(
new Gs2Mission.DeleteCompleteByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withMissionGroupName("mission-group-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.delete_complete_by_user_id(
mission.DeleteCompleteByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_mission_group_name('mission-group-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.delete_complete_by_user_id({
namespaceName='namespace1',
userId='user-0001',
missionGroupName='mission-group-0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
receiveByStampTask
Create achievement status
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
stampTask | string | | ✓ | | ~ 5242880 chars | Stamp task |
keyId | string | | ✓ | | ~ 1024 chars | encryption key GRN |
Result
| Type | Description |
---|
item | Complete | status of achievement |
newContextStack | string | Request of context in which stamp task execution results are recorded |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.ReceiveByStampTask(
&mission.ReceiveByStampTaskRequest {
StampTask: pointy.String("$stampTask"),
KeyId: pointy.String("$key1.keyId"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\ReceiveByStampTaskRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->receiveByStampTask(
(new ReceiveByStampTaskRequest())
->withStampTask(self::$stampTask)
->withKeyId(self::$key1.keyId)
);
$item = $result->getItem();
$newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.ReceiveByStampTaskRequest;
import io.gs2.mission.result.ReceiveByStampTaskResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
ReceiveByStampTaskResult result = client.receiveByStampTask(
new ReceiveByStampTaskRequest()
.withStampTask("$stampTask")
.withKeyId("$key1.keyId")
);
Complete item = result.getItem();
String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.ReceiveByStampTaskRequest;
using Gs2.Gs2Mission.Result.ReceiveByStampTaskResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.ReceiveByStampTaskResult> asyncResult = null;
yield return client.ReceiveByStampTask(
new Gs2.Gs2Mission.Request.ReceiveByStampTaskRequest()
.WithStampTask("$stampTask")
.WithKeyId("$key1.keyId"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.receiveByStampTask(
new Gs2Mission.ReceiveByStampTaskRequest()
.withStampTask("$stampTask")
.withKeyId("$key1.keyId")
);
const item = result.getItem();
const newContextStack = result.getNewContextStack();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.receive_by_stamp_task(
mission.ReceiveByStampTaskRequest()
.with_stamp_task(self.stamp_task)
.with_key_id(self.key1.key_id)
)
item = result.item
new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.receive_by_stamp_task({
stampTask='$stampTask',
keyId='$key1.keyId',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
newContextStack = result.newContextStack;
revertReceiveByStampSheet
Create achievement status
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
stampSheet | string | | ✓ | | ~ 5242880 chars | Stamp sheet |
keyId | string | | ✓ | | ~ 1024 chars | encryption key GRN |
Result
| Type | Description |
---|
item | Complete | status of achievement |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.RevertReceiveByStampSheet(
&mission.RevertReceiveByStampSheetRequest {
StampSheet: pointy.String("$stampSheet"),
KeyId: pointy.String("$key1.keyId"),
}
)
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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\RevertReceiveByStampSheetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->revertReceiveByStampSheet(
(new RevertReceiveByStampSheetRequest())
->withStampSheet(self::$stampSheet)
->withKeyId(self::$key1.keyId)
);
$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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.RevertReceiveByStampSheetRequest;
import io.gs2.mission.result.RevertReceiveByStampSheetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
RevertReceiveByStampSheetResult result = client.revertReceiveByStampSheet(
new RevertReceiveByStampSheetRequest()
.withStampSheet("$stampSheet")
.withKeyId("$key1.keyId")
);
Complete 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.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.RevertReceiveByStampSheetRequest;
using Gs2.Gs2Mission.Result.RevertReceiveByStampSheetResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.RevertReceiveByStampSheetResult> asyncResult = null;
yield return client.RevertReceiveByStampSheet(
new Gs2.Gs2Mission.Request.RevertReceiveByStampSheetRequest()
.WithStampSheet("$stampSheet")
.WithKeyId("$key1.keyId"),
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 Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.revertReceiveByStampSheet(
new Gs2Mission.RevertReceiveByStampSheetRequest()
.withStampSheet("$stampSheet")
.withKeyId("$key1.keyId")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.revert_receive_by_stamp_sheet(
mission.RevertReceiveByStampSheetRequest()
.with_stamp_sheet(self.stamp_sheet)
.with_key_id(self.key1.key_id)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.revert_receive_by_stamp_sheet({
stampSheet='$stampSheet',
keyId='$key1.keyId',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
describeCounterModelMasters
Get list of counter model masters
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 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<CounterModelMaster> | List of Counter Model Master |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.DescribeCounterModelMasters(
&mission.DescribeCounterModelMastersRequest {
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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeCounterModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeCounterModelMasters(
(new DescribeCounterModelMastersRequest())
->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeCounterModelMastersRequest;
import io.gs2.mission.result.DescribeCounterModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DescribeCounterModelMastersResult result = client.describeCounterModelMasters(
new DescribeCounterModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<CounterModelMaster> 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.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.DescribeCounterModelMastersRequest;
using Gs2.Gs2Mission.Result.DescribeCounterModelMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.DescribeCounterModelMastersResult> asyncResult = null;
yield return client.DescribeCounterModelMasters(
new Gs2.Gs2Mission.Request.DescribeCounterModelMastersRequest()
.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 Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.describeCounterModelMasters(
new Gs2Mission.DescribeCounterModelMastersRequest()
.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 mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.describe_counter_model_masters(
mission.DescribeCounterModelMastersRequest()
.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('mission')
api_result = client.describe_counter_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;
createCounterModelMaster
Create new counter model master
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
name | string | | ✓ | | ~ 128 chars | Counter Name |
metadata | string | | | | ~ 1024 chars | metadata |
description | string | | | | ~ 1024 chars | description of Namespace |
scopes | List<CounterScopeModel> | | ✓ | [] | | List of Counter reset timing |
challengePeriodEventId | string | | | | ~ 1024 chars | GS2-Schedule event GRN that sets the period during which the counter can be operated. |
Result
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.CreateCounterModelMaster(
&mission.CreateCounterModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
Name: pointy.String("counter-0001"),
Metadata: nil,
Description: nil,
Scopes: []mission.CounterScopeModel{
mission.CounterScopeModel{
ResetType: pointy.String("notReset"),
},
},
ChallengePeriodEventId: 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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CreateCounterModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createCounterModelMaster(
(new CreateCounterModelMasterRequest())
->withNamespaceName(self::namespace1)
->withName("counter-0001")
->withMetadata(null)
->withDescription(null)
->withScopes([ (new \Gs2\Mission\Model\CounterScopeModel())
->withResetType("notReset"),
])
->withChallengePeriodEventId(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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.CreateCounterModelMasterRequest;
import io.gs2.mission.result.CreateCounterModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
CreateCounterModelMasterResult result = client.createCounterModelMaster(
new CreateCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withName("counter-0001")
.withMetadata(null)
.withDescription(null)
.withScopes(Arrays.asList(
new io.gs2.mission.model.CounterScopeModel()
.withResetType("notReset")
))
.withChallengePeriodEventId(null)
);
CounterModelMaster 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.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.CreateCounterModelMasterRequest;
using Gs2.Gs2Mission.Result.CreateCounterModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.CreateCounterModelMasterResult> asyncResult = null;
yield return client.CreateCounterModelMaster(
new Gs2.Gs2Mission.Request.CreateCounterModelMasterRequest()
.WithNamespaceName("namespace1")
.WithName("counter-0001")
.WithMetadata(null)
.WithDescription(null)
.WithScopes(new Gs2.Gs2Mission.Model.CounterScopeModel[] {
new Gs2.Gs2Mission.Model.CounterScopeModel()
.WithResetType("notReset")
})
.WithChallengePeriodEventId(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 Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.createCounterModelMaster(
new Gs2Mission.CreateCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withName("counter-0001")
.withMetadata(null)
.withDescription(null)
.withScopes([
new Gs2Mission.model.CounterScopeModel()
.withResetType("notReset")
])
.withChallengePeriodEventId(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.create_counter_model_master(
mission.CreateCounterModelMasterRequest()
.with_namespace_name(self.hash1)
.with_name('counter-0001')
.with_metadata(None)
.with_description(None)
.with_scopes([ mission.CounterScopeModel()
.with_reset_type('notReset'),
])
.with_challenge_period_event_id(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.create_counter_model_master({
namespaceName='namespace1',
name='counter-0001',
metadata=nil,
description=nil,
scopes={
{
resetType='notReset',
}
},
challengePeriodEventId=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getCounterModelMaster
Obtain counter model master
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
counterName | string | | ✓ | | ~ 128 chars | Counter Name |
Result
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.GetCounterModelMaster(
&mission.GetCounterModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
CounterName: pointy.String("counter-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetCounterModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCounterModelMaster(
(new GetCounterModelMasterRequest())
->withNamespaceName(self::namespace1)
->withCounterName("counter-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetCounterModelMasterRequest;
import io.gs2.mission.result.GetCounterModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
GetCounterModelMasterResult result = client.getCounterModelMaster(
new GetCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
);
CounterModelMaster 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.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.GetCounterModelMasterRequest;
using Gs2.Gs2Mission.Result.GetCounterModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.GetCounterModelMasterResult> asyncResult = null;
yield return client.GetCounterModelMaster(
new Gs2.Gs2Mission.Request.GetCounterModelMasterRequest()
.WithNamespaceName("namespace1")
.WithCounterName("counter-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 Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.getCounterModelMaster(
new Gs2Mission.GetCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.get_counter_model_master(
mission.GetCounterModelMasterRequest()
.with_namespace_name(self.hash1)
.with_counter_name('counter-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.get_counter_model_master({
namespaceName='namespace1',
counterName='counter-0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateCounterModelMaster
Update counter model master
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
counterName | string | | ✓ | | ~ 128 chars | Counter Name |
metadata | string | | | | ~ 1024 chars | metadata |
description | string | | | | ~ 1024 chars | description of Namespace |
scopes | List<CounterScopeModel> | | ✓ | [] | | List of Counter reset timing |
challengePeriodEventId | string | | | | ~ 1024 chars | GS2-Schedule event GRN that sets the period during which the counter can be operated. |
Result
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.UpdateCounterModelMaster(
&mission.UpdateCounterModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
CounterName: pointy.String("counter-0001"),
Metadata: pointy.String("COUNTER1"),
Description: pointy.String("description1"),
Scopes: []mission.CounterScopeModel{
mission.CounterScopeModel{
ResetType: pointy.String("monthly"),
ResetHour: pointy.Int32(5),
ResetDayOfMonth: pointy.Int32(1),
},
},
ChallengePeriodEventId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\UpdateCounterModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCounterModelMaster(
(new UpdateCounterModelMasterRequest())
->withNamespaceName(self::namespace1)
->withCounterName("counter-0001")
->withMetadata("COUNTER1")
->withDescription("description1")
->withScopes([ (new \Gs2\Mission\Model\CounterScopeModel())
->withResetType("monthly")
->withResetHour(5)
->withResetDayOfMonth(1),
])
->withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:\namespace1:event:event-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.UpdateCounterModelMasterRequest;
import io.gs2.mission.result.UpdateCounterModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
UpdateCounterModelMasterResult result = client.updateCounterModelMaster(
new UpdateCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
.withMetadata("COUNTER1")
.withDescription("description1")
.withScopes(Arrays.asList(
new io.gs2.mission.model.CounterScopeModel()
.withResetType("monthly")
.withResetHour(5)
.withResetDayOfMonth(1)
))
.withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001")
);
CounterModelMaster 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.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.UpdateCounterModelMasterRequest;
using Gs2.Gs2Mission.Result.UpdateCounterModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.UpdateCounterModelMasterResult> asyncResult = null;
yield return client.UpdateCounterModelMaster(
new Gs2.Gs2Mission.Request.UpdateCounterModelMasterRequest()
.WithNamespaceName("namespace1")
.WithCounterName("counter-0001")
.WithMetadata("COUNTER1")
.WithDescription("description1")
.WithScopes(new Gs2.Gs2Mission.Model.CounterScopeModel[] {
new Gs2.Gs2Mission.Model.CounterScopeModel()
.WithResetType("monthly")
.WithResetHour(5)
.WithResetDayOfMonth(1)
})
.WithChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.updateCounterModelMaster(
new Gs2Mission.UpdateCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
.withMetadata("COUNTER1")
.withDescription("description1")
.withScopes([
new Gs2Mission.model.CounterScopeModel()
.withResetType("monthly")
.withResetHour(5)
.withResetDayOfMonth(1)
])
.withChallengePeriodEventId("grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.update_counter_model_master(
mission.UpdateCounterModelMasterRequest()
.with_namespace_name(self.hash1)
.with_counter_name('counter-0001')
.with_metadata('COUNTER1')
.with_description('description1')
.with_scopes([ mission.CounterScopeModel()
.with_reset_type('monthly')
.with_reset_hour(5)
.with_reset_day_of_month(1),
])
.with_challenge_period_event_id('grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.update_counter_model_master({
namespaceName='namespace1',
counterName='counter-0001',
metadata='COUNTER1',
description='description1',
scopes={
{
resetType='monthly',
resetHour=5,
resetDayOfMonth=1,
}
},
challengePeriodEventId='grn:gs2:ap-northeast-1:YourOwnerId:schedule:namespace1:event:event-0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteCounterModelMaster
Delete counter model master
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 chars | Namespace name |
counterName | string | | ✓ | | ~ 128 chars | Counter Name |
Result
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.DeleteCounterModelMaster(
&mission.DeleteCounterModelMasterRequest {
NamespaceName: pointy.String("namespace1"),
CounterName: pointy.String("counter-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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DeleteCounterModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteCounterModelMaster(
(new DeleteCounterModelMasterRequest())
->withNamespaceName(self::namespace1)
->withCounterName("counter-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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DeleteCounterModelMasterRequest;
import io.gs2.mission.result.DeleteCounterModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DeleteCounterModelMasterResult result = client.deleteCounterModelMaster(
new DeleteCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
);
CounterModelMaster 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.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.DeleteCounterModelMasterRequest;
using Gs2.Gs2Mission.Result.DeleteCounterModelMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.DeleteCounterModelMasterResult> asyncResult = null;
yield return client.DeleteCounterModelMaster(
new Gs2.Gs2Mission.Request.DeleteCounterModelMasterRequest()
.WithNamespaceName("namespace1")
.WithCounterName("counter-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 Gs2Mission from '@/gs2/mission';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);
try {
const result = await client.deleteCounterModelMaster(
new Gs2Mission.DeleteCounterModelMasterRequest()
.withNamespaceName("namespace1")
.withCounterName("counter-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import mission
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)
try:
result = client.delete_counter_model_master(
mission.DeleteCounterModelMasterRequest()
.with_namespace_name(self.hash1)
.with_counter_name('counter-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('mission')
api_result = client.delete_counter_model_master({
namespaceName='namespace1',
counterName='counter-0001',
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
describeMissionGroupModelMasters
Get list of mission group masters
Request
| Type | Condition | Require | Default | Limitation | Description |
---|
namespaceName | string | | ✓ | | ~ 32 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
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
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 := mission.Gs2MissionRestClient{
Session: &session,
}
result, err := client.DescribeMissionGroupModelMasters(
&mission.DescribeMissionGroupModelMastersRequest {
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\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeMissionGroupModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeMissionGroupModelMasters(
(new DescribeMissionGroupModelMastersRequest())
->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.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeMissionGroupModelMastersRequest;
import io.gs2.mission.result.DescribeMissionGroupModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);
try {
DescribeMissionGroupModelMastersResult result = client.describeMissionGroupModelMasters(
new DescribeMissionGroupModelMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<MissionGroupModelMaster> 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.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.DescribeMissionGroupModelMastersRequest;
using Gs2.Gs2Mission.Result.DescribeMissionGroupModelMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);
AsyncResult<Gs2.Gs2Mission.Result.DescribeMissionGroupModelMastersResult> asyncResult = null;
yield return client.DescribeMissionGroupModelMasters(
new Gs2.Gs2Mission.Request.DescribeMissionGroupModelMastersRequest()
.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';