API Reference of GS2-Mission SDK

Model

Complete

Mission Accomplishments

TypeConditionRequireDefaultLimitationDescription
completeIdstring~ 1024 charsStatus of Achievement GRN
userIdstring~ 128 charsUser Id
missionGroupNamestring~ 128 charsMission Group Name
completedMissionTaskNamesList<string>[]~ 1000 itemsList of Completed Task Names
receivedMissionTaskNamesList<string>[]~ 1000 itemsList of Reward has been received Task Names
nextResetAtlongNext reset timing
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision


NotificationSetting

Push notification settings

This is a setting for sending push notifications when an event occurs in a GS2 microservice. The push notification here refers to the processing via the WebSocket interface provided by GS2-Gateway, and is different from the push notification of a smartphone. For example, when a matchmaking is completed or a friend request is received, the GS2-Gateway can send a push notification via the WebSocket interface, and the game client can detect the change of the state.

GS2-Gateway’s push notifications can be used to send additional processing to mobile push notifications when the destination device is offline. If you use mobile push notifications well, you may be able to realize a flow in which you can notify the player by using mobile push notifications even if you end the game during matchmaking and return to the game.

TypeConditionRequireDefaultLimitationDescription
gatewayNamespaceIdstring“grn:gs2:{region}:{ownerId}:gateway:default”~ 1024 charsGS2-Gateway namespace to use for push notifications
enableTransferMobileNotificationbool?falseForwarding to mobile push notification
soundstring{enableTransferMobileNotification} == true~ 1024 charsSound 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.

TypeConditionRequireDefaultLimitationDescription
counterIdstring~ 1024 charsCounter Model Master GRN
namestring~ 128 charsCounter Name
metadatastring~ 1024 charsmetadata
descriptionstring~ 1024 charsDescription
scopesList<CounterScopeModel>[]1 ~ 100 itemsList of Counter reset timing
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN that sets the period during which the counter can be operated.
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision


CounterScopeModel

TypeConditionRequireDefaultLimitationDescription
resetTypeenum [
“notReset”,
“daily”,
“weekly”,
“monthly”
]
~ 128 charsReset timing
resetDayOfMonthint{resetType} == “monthly”1 ~ 31Date to reset (If the value exceeds the days of the month, it is treated as the last day.)
resetDayOfWeekenum [
“sunday”,
“monday”,
“tuesday”,
“wednesday”,
“thursday”,
“friday”,
“saturday”
]
{resetType} == “weekly”~ 128 charsDay of the week to reset
resetHourint{resetType} in [“monthly”, “weekly”, “daily”]~ 23Hour 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.

TypeConditionRequireDefaultLimitationDescription
missionGroupIdstring~ 1024 charsMission Group Master GRN
namestring~ 128 charsMission Group Name
metadatastring~ 1024 charsmetadata
descriptionstring~ 1024 charsDescription
resetTypeenum [
“notReset”,
“daily”,
“weekly”,
“monthly”
]
“notReset”~ 128 charsReset timing
resetDayOfMonthint{resetType} == “monthly”1 ~ 31Date to reset (If the value exceeds the days of the month, it is treated as the last day.)
resetDayOfWeekenum [
“sunday”,
“monday”,
“tuesday”,
“wednesday”,
“thursday”,
“friday”,
“saturday”
]
{resetType} == “weekly”~ 128 charsDay of the week to reset
resetHourint{resetType} in [“monthly”, “weekly”, “daily”]~ 23Hour of Reset
completeNotificationNamespaceIdstring~ 1024 charsPush notifications when mission tasks are accomplished
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision


Namespace

Namespace

Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.

Therefore, it is necessary to create a namespace before starting to use each service.

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsNamespace GRN
namestring~ 32 charsNamespace name
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction settings
missionCompleteScriptScriptSettingScript to run when a mission is accomplished
counterIncrementScriptScriptSettingScript to run when the counter rises
receiveRewardsScriptScriptSettingScript to run when a reward is received
completeNotificationNotificationSettingPush notifications when mission tasks are accomplished
logSettingLogSettingLog output settings
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
queueNamespaceIdstring~ 1024 charsNamespace in GS2-JobQueue used to run the stamp sheet
keyIdstring~ 1024 charsGS2-Key namespace used to issue stamp sheets
revisionlong0~ 9223372036854775805Revision


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.

TypeConditionRequireDefaultLimitationDescription
counterIdstring~ 1024 charsCounter GRN
userIdstring~ 128 charsUser Id
namestring~ 128 charsCounter Name
valuesList<ScopedValue>~ 32 itemsValue
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision


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.

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsNamespace GRN
settingsstring~ 5242880 charsMaster 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.

TypeConditionRequireDefaultLimitationDescription
counterIdstring~ 1024 charsCounter Model GRN
namestring~ 128 charsCounter Name
metadatastring~ 1024 charsmetadata
scopesList<CounterScopeModel>[]1 ~ 100 itemsList of Counter reset timing
challengePeriodEventIdstring~ 1024 charsGS2-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.

TypeConditionRequireDefaultLimitationDescription
missionGroupIdstring~ 1024 charsMission Group GRN
namestring~ 128 charsMission Group Name
metadatastring~ 1024 charsmetadata
tasksList<MissionTaskModel>~ 1000 itemsList of Mission Task
resetTypeenum [
“notReset”,
“daily”,
“weekly”,
“monthly”
]
“notReset”~ 128 charsReset timing
resetDayOfMonthint{resetType} == “monthly”1 ~ 31Date to reset (If the value exceeds the days of the month, it is treated as the last day.)
resetDayOfWeekenum [
“sunday”,
“monday”,
“tuesday”,
“wednesday”,
“thursday”,
“friday”,
“saturday”
]
{resetType} == “weekly”~ 128 charsDay of the week to reset
resetHourint{resetType} in [“monthly”, “weekly”, “daily”]~ 23Hour of Reset
completeNotificationNamespaceIdstring~ 1024 charsNamespace 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.

TypeConditionRequireDefaultLimitationDescription
missionTaskIdstring~ 1024 charsMission Task GRN
namestring~ 128 charsTask Name
metadatastring~ 1024 charsmetadata
counterNamestring~ 128 charsCounter Name
targetResetTypeenum [
“notReset”,
“daily”,
“weekly”,
“monthly”
]
~ 128 charsTarget Reset timing
targetValuelong1 ~ 9223372036854775805Target value
completeAcquireActionsList<AcquireAction>[]~ 100 itemsRewards for mission accomplishment
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN with a set period of time during which rewards can be received
premiseMissionTaskNamestring~ 128 charsName of the tasks accomplish to attempt this task


ScopedValue

TypeConditionRequireDefaultLimitationDescription
resetTypeenum [
“notReset”,
“daily”,
“weekly”,
“monthly”
]
~ 128 charsReset timing
valuelong0~ 9223372036854775805Count value
nextResetAtlongNext reset timing
updatedAtlongDatetime 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.

TypeConditionRequireDefaultLimitationDescription
missionTaskIdstring~ 1024 charsMission Task Master GRN
namestring~ 128 charsTask Name
metadatastring~ 1024 charsmetadata
descriptionstring~ 1024 charsDescription
counterNamestring~ 128 charsCounter Name
targetResetTypeenum [
“notReset”,
“daily”,
“weekly”,
“monthly”
]
~ 128 charsTarget Reset timing
targetValuelong1 ~ 9223372036854775805Target value
completeAcquireActionsList<AcquireAction>[]~ 100 itemsRewards for mission accomplishment
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN with a set period of time during which rewards can be received
premiseMissionTaskNamestring~ 128 charsName of the tasks accomplish to attempt this task
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision


AcquireAction

TypeConditionRequireDefaultLimitationDescription
actionenum [
]
~ 128 charsTypes of actions to be performed in the stamp sheet
requeststring~ 1048576 charsJSON of request

Config

TypeConditionRequireDefaultLimitationDescription
keystring~ 64 charsName
valuestring~ 51200 charsValue

LogSetting

TypeConditionRequireDefaultLimitationDescription
loggingNamespaceIdstring~ 1024 charsNamespace GRN

GitHubCheckoutSetting

TypeConditionRequireDefaultLimitationDescription
apiKeyIdstring~ 1024 charsGitHub API key GRN
repositoryNamestring~ 1024 charsRepository Name
sourcePathstring~ 1024 charsSource code file path
referenceTypeenum [
“commit_hash”,
“branch”,
“tag”
]
~ 128 charsSource of code
commitHashstring{referenceType} == “commit_hash”~ 1024 charsCommit hash
branchNamestring{referenceType} == “branch”~ 1024 charsBranch Name
tagNamestring{referenceType} == “tag”~ 1024 charsTag Name

ScriptSetting

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

TransactionSetting

TypeConditionRequireDefaultLimitationDescription
enableAutoRunboolfalseAutomatically run issued stamp sheets on the server side, or
distributorNamespaceIdstring“grn:gs2:{region}:{ownerId}:distributor:default”~ 1024 charsGS2-Distributor namespace used for stamp sheet execution
keyIdstring!{enableAutoRun}“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024 charsGS2-Key encryption key used to sign the stamp sheet
queueNamespaceIdstring“grn:gs2:{region}:{ownerId}:queue:default”~ 1024 charsNamespace in GS2-JobQueue used to run the stamp sheet

Methods

describeCompletes

Get list of achievement statuses

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
accessTokenstring~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<Complete>List of status of achievement
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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("accessToken-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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("accessToken-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("accessToken-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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='accessToken-0001',
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;

describeCompletesByUserId

Obtain list of achievement statuses by specifying the user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<Complete>List of status of achievement
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
missionGroupNamestring~ 128 charsMission Group Name
missionTaskNamestring~ 128 charsTask Name
accessTokenstring~ 128 charsUser Id
configList<Config>[]~ 32 itemsSet values to be applied to stamp sheet variables

Result

TypeDescription
transactionIdstringTransaction ID of the stamp sheet issued
stampSheetstringStamp sheet to receive rewards for mission accomplishment
stampSheetEncryptionKeyIdstringCryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheetbool?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("accessToken-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("accessToken-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("accessToken-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("accessToken-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='accessToken-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

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
missionGroupNamestring~ 128 charsMission Group Name
missionTaskNamestring~ 128 charsTask Name
userIdstring~ 128 charsUser Id
configList<Config>[]~ 32 itemsSet values to be applied to stamp sheet variables

Result

TypeDescription
transactionIdstringTransaction ID of the stamp sheet issued
stampSheetstringStamp sheet to receive rewards for mission accomplishment
stampSheetEncryptionKeyIdstringCryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheetbool?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

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
missionGroupNamestring~ 128 charsMission Group Name
missionTaskNamestring~ 128 charsTask Name
userIdstring~ 128 charsUser Id

Result

TypeDescription
itemCompleteReceived 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

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
missionGroupNamestring~ 128 charsMission Group Name
missionTaskNamestring~ 128 charsTask Name
userIdstring~ 128 charsUser Id

Result

TypeDescription
itemCompleteReceived 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

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
missionGroupNamestring~ 128 charsMission Group Name
accessTokenstring~ 128 charsUser Id

Result

TypeDescription
itemCompletestatus 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("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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("accessToken-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("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("accessToken-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='accessToken-0001',
})

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

result = api_result.result
item = result.item;

getCompleteByUserId

Obtain achievement status by specifying user ID

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
missionGroupNamestring~ 128 charsMission Group Name
userIdstring~ 128 charsUser Id

Result

TypeDescription
itemCompletestatus 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

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
userIdstring~ 128 charsUser Id
missionGroupNamestring~ 128 charsMission Group Name

Result

TypeDescription
itemCompleteDeleted 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

TypeConditionRequireDefaultLimitationDescription
stampTaskstring~ 5242880 charsStamp task
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemCompletestatus of achievement
newContextStackstringRequest 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("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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::key-0001)
    );
    $item = $result->getItem();
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("key-0001")
    );
    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("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as 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("key-0001")
    );
    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='key-0001',
})

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

result = api_result.result
item = result.item;
newContextStack = result.newContextStack;

revertReceiveByStampSheet

Create achievement status

Request

TypeConditionRequireDefaultLimitationDescription
stampSheetstring~ 5242880 charsStamp sheet
keyIdstring~ 1024 charsencryption key GRN

Result

TypeDescription
itemCompletestatus 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("key-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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::key-0001)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("key-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.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("key-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("key-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_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='key-0001',
})

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

result = api_result.result
item = result.item;

describeCounterModelMasters

Get list of counter model masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<CounterModelMaster>List of Counter Model Master
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
namestring~ 128 charsCounter Name
metadatastring~ 1024 charsmetadata
descriptionstring~ 1024 charsDescription
scopesList<CounterScopeModel>[]1 ~ 100 itemsList of Counter reset timing
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN that sets the period during which the counter can be operated.

Result

TypeDescription
itemCounterModelMasterCounter model master created

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

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
counterNamestring~ 128 charsCounter Name

Result

TypeDescription
itemCounterModelMasterCounter Model Master

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

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
counterNamestring~ 128 charsCounter Name
metadatastring~ 1024 charsmetadata
descriptionstring~ 1024 charsDescription
scopesList<CounterScopeModel>[]1 ~ 100 itemsList of Counter reset timing
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN that sets the period during which the counter can be operated.

Result

TypeDescription
itemCounterModelMasterUpdated counter model master

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

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
counterNamestring~ 128 charsCounter Name

Result

TypeDescription
itemCounterModelMasterDeleted counter model master

Implementation Example