NAV
go python java php typescript csharp GS2-Script

GS2-Mission

GS2 SDK のリファレンス

GS2 SDK リファレンス

モデル

Complete

ミッションの達成状況

説明
completeId string 達成状況GRN
userId string ユーザーID
missionGroupName string ミッショングループ名
completedMissionTaskNames string[] 達成済みのタスク名リスト
receivedMissionTaskNames string[] 報酬の受け取り済みのタスク名リスト
nextResetAt long 次回リセットタイミング
createdAt long 作成日時
updatedAt long 最終更新日時

NotificationSetting

説明
gatewayNamespaceId string ネームスペースGRN
enableTransferMobileNotification bool モバイルプッシュ通知へ転送するか
sound string モバイルプッシュ通知で使用するサウンドファイル名

CounterModelMaster

カウンターモデルマスター

カウンターモデルマスターはミッションタスクの達成条件に設定可能なエンティティです。
カウンターの値は複数のミッショングループから参照可能なため、1つのカウンターでウィークリーミッションとデイリーミッションといった複数のミッショングループの達成条件に設定ができます。

説明
counterId string カウンターモデルマスターGRN
name string カウンター名
metadata string メタデータ
description string 説明文
scopes CounterScopeModel[] カウンターのリセットタイミングリスト
challengePeriodEventId string カウンターの操作が可能な期間を設定した GS2-Schedule イベントGRN
createdAt long 作成日時
updatedAt long 最終更新日時

CounterScopeModel

説明
resetType enum ['notReset', 'daily', 'weekly', 'monthly'] リセットタイミング
resetDayOfMonth int リセットをする日にち
resetDayOfWeek enum ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] リセットする曜日
resetHour int リセット時刻

MissionGroupModelMaster

ミッショングループモデルマスター

ミッショングループはカウンターのリセットタイミングでタスクをグルーピングするエンティティです。
たとえば、デイリーミッションで1つのグループ。ウィークリーミッションで1つのグループとなります。

説明
missionGroupId string ミッショングループマスターGRN
name string ミッショングループ名
metadata string メタデータ
description string 説明文
resetType enum ['notReset', 'daily', 'weekly', 'monthly'] リセットタイミング
resetDayOfMonth int リセットをする日にち
resetDayOfWeek enum ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] リセットする曜日
resetHour int リセット時刻
completeNotificationNamespaceId string ミッションのタスクを達成したときのプッシュ通知
createdAt long 作成日時
updatedAt long 最終更新日時

Namespace

ネームスペース

ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。
GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。

そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。

説明
namespaceId string ネームスペースGRN
name string ネームスペース名
description string 説明文
transactionSetting TransactionSetting トランザクション設定
missionCompleteScript ScriptSetting ミッションを達成したときに実行するスクリプト
counterIncrementScript ScriptSetting カウンターを上昇したときに実行するスクリプト
receiveRewardsScript ScriptSetting 報酬を受け取ったときに実行するスクリプト
completeNotification NotificationSetting ミッションのタスクを達成したときのプッシュ通知
logSetting LogSetting ログの出力設定
createdAt long 作成日時
updatedAt long 最終更新日時

Counter

カウンター

カウンターはミッションの進行状況をゲームプレイヤー毎に保持するエンティティです。
カウンターの値は関連付けられたタスクの期間ごとに集計されます。

そのため、1つのカウンターは複数の値を持ちます。
例えば、クエストのクリア回数カウンターであれば、今月のクリア回数、今週のクリア回数、今日のクリア回数。といった具合です。

説明
counterId string カウンターGRN
userId string ユーザーID
name string カウンター名
values ScopedValue[]
createdAt long 作成日時
updatedAt long 最終更新日時

CurrentMissionMaster

現在有効なマスターデータ

GS2ではマスターデータの管理にJSON形式のファイルを使用します。
ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。

JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが
よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。

JSONファイルの形式についてはドキュメントを参照ください。

説明
namespaceId string ネームスペースGRN
settings string マスターデータ

CounterModel

カウンターモデル

カウンターモデルはミッションタスクの達成条件に設定可能なエンティティです。
カウンターの値は複数のミッショングループから参照可能なため、1つのカウンターでウィークリーミッションとデイリーミッションといった複数のミッショングループの達成条件に設定ができます。

説明
counterId string カウンターモデルGRN
name string カウンター名
metadata string メタデータ
scopes CounterScopeModel[] カウンターのリセットタイミングリスト
challengePeriodEventId string カウンターの操作が可能な期間を設定した GS2-Schedule イベントGRN

MissionGroupModel

ミッショングループモデル

ミッショングループはカウンターのリセットタイミングでタスクをグルーピングするエンティティです。
たとえば、デイリーミッションで1つのグループ。ウィークリーミッションで1つのグループとなります。

説明
missionGroupId string ミッショングループGRN
name string ミッショングループ名
metadata string メタデータ
tasks MissionTaskModel[] ミッションタスクリスト
resetType enum ['notReset', 'daily', 'weekly', 'monthly'] リセットタイミング
resetDayOfMonth int リセットをする日にち
resetDayOfWeek enum ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] リセットする曜日
resetHour int リセット時刻
completeNotificationNamespaceId string ネームスペースGRN

MissionTaskModel

説明
missionTaskId string ミッションタスクGRN
name string タスク名
metadata string メタデータ
counterName string カウンター名
targetValue long 目標値
completeAcquireActions AcquireAction[] ミッション達成時の報酬
challengePeriodEventId string 報酬が受け取り可能な期間を設定した GS2-Schedule イベントGRN
premiseMissionTaskName string このタスクに挑戦するために達成しておく必要のあるタスクの名前

ScopedValue

説明
resetType enum ['notReset', 'daily', 'weekly', 'monthly'] リセットタイミング
value long カウント
nextResetAt long 次回リセットタイミング
updatedAt long 最終更新日時

MissionTaskModelMaster

ミッションタスクモデルマスター

ミッションタスクは関連付けたカウンターの値が一定を超えたら報酬が貰える条件を定義するエンティティです。

説明
missionTaskId string ミッションタスクマスターGRN
name string タスク名
metadata string メタデータ
description string 説明文
counterName string カウンター名
targetValue long 目標値
completeAcquireActions AcquireAction[] ミッション達成時の報酬
challengePeriodEventId string 報酬が受け取り可能な期間を設定した GS2-Schedule イベントGRN
premiseMissionTaskName string このタスクに挑戦するために達成しておく必要のあるタスクの名前
createdAt long 作成日時
updatedAt long 最終更新日時

AcquireAction

説明
action enum [] スタンプシートを使用して実行するアクションの種類
request string リクエストのJSON

Config

説明
key string 名前
value string

LogSetting

説明
loggingNamespaceId string ネームスペースGRN

GitHubCheckoutSetting

説明
apiKeyId string GitHub のAPIキーGRN
repositoryName string リポジトリ名
sourcePath string ソースコードのファイルパス
referenceType enum ['commit_hash', 'branch', 'tag'] コードの取得元
commitHash string コミットハッシュ
branchName string ブランチ名
tagName string タグ名

ScriptSetting

説明
triggerScriptId string スクリプトGRN
doneTriggerTargetType enum ['none', 'gs2_script', 'aws'] 完了通知の通知先
doneTriggerScriptId string スクリプトGRN
doneTriggerQueueNamespaceId string ネームスペースGRN

TransactionSetting

説明
enableAutoRun bool 発行したスタンプシートをサーバーサイドで自動的に実行するか
distributorNamespaceId string スタンプシートの実行に使用する GS2-Distributor ネームスペース
keyId string スタンプシートの署名に使用する GS2-Key の暗号鍵
queueNamespaceId string スタンプシートの実行に使用する GS2-JobQueue のネームスペース

メソッド

describeCompletes

describeCompletes

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeCompletes(
    &mission.DescribeCompletesRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeCompletesRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeCompletes(
        (new DescribeCompletesRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeCompletesRequest;
import io.gs2.mission.result.DescribeCompletesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    DescribeCompletesResult result = client.describeCompletes(
        new DescribeCompletesRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Complete> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.DescribeCompletesRequest;
using Gs2.Gs2Mission.Result.DescribeCompletesResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeCompletes(
    new DescribeCompletesRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withPageToken(null)
        .withLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.describeCompletes(
        new Gs2Mission.DescribeCompletesRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.describe_completes(
        mission.DescribeCompletesRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.describe_completes({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

達成状況の一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items Complete[] 達成状況のリスト
nextPageToken string リストの続きを取得するためのページトークン

describeCompletesByUserId

describeCompletesByUserId

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeCompletesByUserId(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

ユーザIDを指定して達成状況の一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items Complete[] 達成状況のリスト
nextPageToken string リストの続きを取得するためのページトークン

complete

complete

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.Complete(
    &mission.CompleteRequest {
        NamespaceName: pointy.String("namespace1"),
        MissionGroupName: pointy.String("mission-group-0001"),
        MissionTaskName: pointy.String("mission-task-0001"),
        AccessToken: pointy.String("$access_token_0001"),
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CompleteRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->complete(
        (new CompleteRequest())
            ->withNamespaceName(self::namespace1)
            ->withMissionGroupName("mission-group-0001")
            ->withMissionTaskName("mission-task-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withConfig(null)
    );
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.CompleteRequest;
import io.gs2.mission.result.CompleteResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    CompleteResult result = client.complete(
        new CompleteRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withAccessToken("$access_token_0001")
            .withConfig(null)
    );
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.CompleteRequest;
using Gs2.Gs2Mission.Result.CompleteResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.complete(
    new CompleteRequest()
        .withNamespaceName("namespace1")
        .withMissionGroupName("mission-group-0001")
        .withMissionTaskName("mission-task-0001")
        .withAccessToken("$access_token_0001")
        .withConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.complete(
        new Gs2Mission.CompleteRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withMissionTaskName("mission-task-0001")
            .withAccessToken("$access_token_0001")
            .withConfig(null)
    );
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.complete(
        mission.CompleteRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
            .with_mission_task_name('mission-task-0001')
            .with_access_token(self.access_token_0001)
            .with_config(None)
    )
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.complete({
    namespaceName='namespace1',
    missionGroupName='mission-group-0001',
    missionTaskName='mission-task-0001',
    accessToken='$access_token_0001',
    config=nil,
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;

ミッション達成報酬を受領するためのスタンプシートを発行

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
missionGroupName string ~ 128文字 ミッショングループ名
missionTaskName string ~ 128文字 タスク名
accessToken string ~ 128文字 ユーザーID
config Config[] [] スタンプシートの変数に適用する設定値

Result

説明
transactionId string 発行されたスタンプシートのトランザクションID
stampSheet string ミッションの達成報酬を受領するスタンプシート
stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN
autoRunStampSheet bool スタンプシートの自動実行が有効か

completeByUserId

completeByUserId

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.completeByUserId(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;

ユーザーIDを指定してミッション達成報酬を受領するためのスタンプシートを発行

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
missionGroupName string ~ 128文字 ミッショングループ名
missionTaskName string ~ 128文字 タスク名
userId string ~ 128文字 ユーザーID
config Config[] [] スタンプシートの変数に適用する設定値

Result

説明
transactionId string 発行されたスタンプシートのトランザクションID
stampSheet string ミッションの達成報酬を受領するスタンプシート
stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN
autoRunStampSheet bool スタンプシートの自動実行が有効か

receiveByUserId

receiveByUserId

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.receiveByUserId(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ミッション達成報酬を受領する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
missionGroupName string ~ 128文字 ミッショングループ名
missionTaskName string ~ 128文字 タスク名
userId string ~ 128文字 ユーザーID

Result

説明
item Complete 受領した達成状況

getComplete

getComplete

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.GetComplete(
    &mission.GetCompleteRequest {
        NamespaceName: pointy.String("namespace1"),
        MissionGroupName: pointy.String("mission-group-0001"),
        AccessToken: pointy.String("$access_token_0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetCompleteRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getComplete(
        (new GetCompleteRequest())
            ->withNamespaceName(self::namespace1)
            ->withMissionGroupName("mission-group-0001")
            ->withAccessToken(self::$accessToken0001)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetCompleteRequest;
import io.gs2.mission.result.GetCompleteResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    GetCompleteResult result = client.getComplete(
        new GetCompleteRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withAccessToken("$access_token_0001")
    );
    Complete item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.GetCompleteRequest;
using Gs2.Gs2Mission.Result.GetCompleteResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getComplete(
    new GetCompleteRequest()
        .withNamespaceName("namespace1")
        .withMissionGroupName("mission-group-0001")
        .withAccessToken("$access_token_0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.getComplete(
        new Gs2Mission.GetCompleteRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withAccessToken("$access_token_0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.get_complete(
        mission.GetCompleteRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
            .with_access_token(self.access_token_0001)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.get_complete({
    namespaceName='namespace1',
    missionGroupName='mission-group-0001',
    accessToken='$access_token_0001',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

達成状況を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
missionGroupName string ~ 128文字 ミッショングループ名
accessToken string ~ 128文字 ユーザーID

Result

説明
item Complete 達成状況

getCompleteByUserId

getCompleteByUserId

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getCompleteByUserId(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ユーザIDを指定して達成状況を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
missionGroupName string ~ 128文字 ミッショングループ名
userId string ~ 128文字 ユーザーID

Result

説明
item Complete 達成状況

deleteCompleteByUserId

deleteCompleteByUserId

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteCompleteByUserId(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

達成状況を削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
missionGroupName string ~ 128文字 ミッショングループ名

Result

説明
item Complete 削除した達成状況

receiveByStampTask

receiveByStampTask

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.ReceiveByStampTask(
    &mission.ReceiveByStampTaskRequest {
        StampTask: pointy.String("$stampTask"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\ReceiveByStampTaskRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->receiveByStampTask(
        (new ReceiveByStampTaskRequest())
            ->withStampTask(self::$stampTask)
            ->withKeyId(self::$key1.keyId)
    );
    $item = $result->getItem();
    $newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.ReceiveByStampTaskRequest;
import io.gs2.mission.result.ReceiveByStampTaskResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    ReceiveByStampTaskResult result = client.receiveByStampTask(
        new ReceiveByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    Complete item = result.getItem();
    String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.ReceiveByStampTaskRequest;
using Gs2.Gs2Mission.Result.ReceiveByStampTaskResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.receiveByStampTask(
    new ReceiveByStampTaskRequest()
        .withStampTask("$stampTask")
        .withKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.receiveByStampTask(
        new Gs2Mission.ReceiveByStampTaskRequest()
            .withStampTask("$stampTask")
            .withKeyId("$key1.keyId")
    );
    const item = result.getItem();
    const newContextStack = result.getNewContextStack();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.receive_by_stamp_task(
        mission.ReceiveByStampTaskRequest()
            .with_stamp_task(self.stamp_task)
            .with_key_id(self.key1.key_id)
    )
    item = result.item
    new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.receive_by_stamp_task({
    stampTask='$stampTask',
    keyId='$key1.keyId',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

達成状況を作成

Request

必須 デフォルト 値の制限 説明
stampTask string ~ 5242880文字 スタンプタスク
keyId string ~ 1024文字 暗号鍵GRN

Result

説明
item Complete 達成状況
newContextStack string スタンプタスクの実行結果を記録したコンテキスト

describeCounterModelMasters

describeCounterModelMasters

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeCounterModelMasters(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

カウンターモデルマスターの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items CounterModelMaster[] カウンターモデルマスターのリスト
nextPageToken string リストの続きを取得するためのページトークン

createCounterModelMaster

createCounterModelMaster

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createCounterModelMaster(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

カウンターモデルマスターを新規作成

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
name string ~ 128文字 カウンター名
metadata string ~ 1024文字 メタデータ
description string ~ 1024文字 説明文
scopes CounterScopeModel[] [] カウンターのリセットタイミングリスト
challengePeriodEventId string ~ 1024文字 カウンターの操作が可能な期間を設定した GS2-Schedule イベントGRN

Result

説明
item CounterModelMaster 作成したカウンターモデルマスター

getCounterModelMaster

getCounterModelMaster

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getCounterModelMaster(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

カウンターモデルマスターを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
counterName string ~ 128文字 カウンター名

Result

説明
item CounterModelMaster カウンターモデルマスター

updateCounterModelMaster

updateCounterModelMaster

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCounterModelMaster(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

カウンターモデルマスターを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
counterName string ~ 128文字 カウンター名
metadata string ~ 1024文字 メタデータ
description string ~ 1024文字 説明文
scopes CounterScopeModel[] [] カウンターのリセットタイミングリスト
challengePeriodEventId string ~ 1024文字 カウンターの操作が可能な期間を設定した GS2-Schedule イベントGRN

Result

説明
item CounterModelMaster 更新したカウンターモデルマスター

deleteCounterModelMaster

deleteCounterModelMaster

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DeleteCounterModelMaster(
    &mission.DeleteCounterModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        CounterName: pointy.String("counter-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DeleteCounterModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteCounterModelMaster(
        (new DeleteCounterModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withCounterName("counter-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DeleteCounterModelMasterRequest;
import io.gs2.mission.result.DeleteCounterModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    DeleteCounterModelMasterResult result = client.deleteCounterModelMaster(
        new DeleteCounterModelMasterRequest()
            .withNamespaceName("namespace1")
            .withCounterName("counter-0001")
    );
    CounterModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.DeleteCounterModelMasterRequest;
using Gs2.Gs2Mission.Result.DeleteCounterModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteCounterModelMaster(
    new DeleteCounterModelMasterRequest()
        .withNamespaceName("namespace1")
        .withCounterName("counter-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.deleteCounterModelMaster(
        new Gs2Mission.DeleteCounterModelMasterRequest()
            .withNamespaceName("namespace1")
            .withCounterName("counter-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.delete_counter_model_master(
        mission.DeleteCounterModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_counter_name('counter-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.delete_counter_model_master({
    namespaceName='namespace1',
    counterName='counter-0001',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

カウンターモデルマスターを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
counterName string ~ 128文字 カウンター名

Result

説明
item CounterModelMaster 削除したカウンターモデルマスター

describeMissionGroupModelMasters

describeMissionGroupModelMasters

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/mission"
import "github.com/openlyinc/pointy"

session := core.Gs2RestSession{
    Credential: &core.BasicGs2Credential{
        ClientId: "your client id",
        ClientSecret: "your client secret",
    },
    Region: core.ApNortheast1,
}

if err := session.Connect(); err != nil {
    panic("error occurred")
}

client := mission.Gs2MissionRestClient{
    Session: &session,
}
result, err := client.DescribeMissionGroupModelMasters(
    &mission.DescribeMissionGroupModelMastersRequest {
        NamespaceName: pointy.String("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeMissionGroupModelMastersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeMissionGroupModelMasters(
        (new DescribeMissionGroupModelMastersRequest())
            ->withNamespaceName(self::namespace1)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeMissionGroupModelMastersRequest;
import io.gs2.mission.result.DescribeMissionGroupModelMastersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    DescribeMissionGroupModelMastersResult result = client.describeMissionGroupModelMasters(
        new DescribeMissionGroupModelMastersRequest()
            .withNamespaceName("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<MissionGroupModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.DescribeMissionGroupModelMastersRequest;
using Gs2.Gs2Mission.Result.DescribeMissionGroupModelMastersResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2MissionRestClient(session);

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeMissionGroupModelMasters(
    new DescribeMissionGroupModelMastersRequest()
        .withNamespaceName("namespace1")
        .withPageToken(null)
        .withLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
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.describeMissionGroupModelMasters(
        new Gs2Mission.DescribeMissionGroupModelMastersRequest()
            .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_mission_group_model_masters(
        mission.DescribeMissionGroupModelMastersRequest()
            .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_mission_group_model_masters({
    namespaceName='namespace1',
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

ミッショングループマスターの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items MissionGroupModelMaster[] ミッショングループマスターのリスト
nextPageToken string リストの続きを取得するためのページトークン

createMissionGroupModelMaster

createMissionGroupModelMaster

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.CreateMissionGroupModelMaster(
    &mission.CreateMissionGroupModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Name: pointy.String("mission-group-0001"),
        Metadata: nil,
        Description: nil,
        ResetType: pointy.String("notReset"),
        ResetDayOfMonth: nil,
        ResetDayOfWeek: pointy.String("monday"),
        ResetHour: pointy.Int32(10),
        CompleteNotificationNamespaceId: 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\CreateMissionGroupModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createMissionGroupModelMaster(
        (new CreateMissionGroupModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("mission-group-0001")
            ->withMetadata(null)
            ->withDescription(null)
            ->withResetType("notReset")
            ->withResetDayOfMonth(null)
            ->withResetDayOfWeek("monday")
            ->withResetHour(10)
            ->withCompleteNotificationNamespaceId(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.CreateMissionGroupModelMasterRequest;
import io.gs2.mission.result.CreateMissionGroupModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    CreateMissionGroupModelMasterResult result = client.createMissionGroupModelMaster(
        new CreateMissionGroupModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("mission-group-0001")
            .withMetadata(null)
            .withDescription(null)
            .withResetType("notReset")
            .withResetDayOfMonth(null)
            .withResetDayOfWeek("monday")
            .withResetHour(10)
            .withCompleteNotificationNamespaceId(null)
    );
    MissionGroupModelMaster 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.CreateMissionGroupModelMasterRequest;
using Gs2.Gs2Mission.Result.CreateMissionGroupModelMasterResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createMissionGroupModelMaster(
    new CreateMissionGroupModelMasterRequest()
        .withNamespaceName("namespace1")
        .withName("mission-group-0001")
        .withMetadata(null)
        .withDescription(null)
        .withResetType("notReset")
        .withResetDayOfMonth(null)
        .withResetDayOfWeek("monday")
        .withResetHour(10)
        .withCompleteNotificationNamespaceId(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.createMissionGroupModelMaster(
        new Gs2Mission.CreateMissionGroupModelMasterRequest()
            .withNamespaceName("namespace1")
            .withName("mission-group-0001")
            .withMetadata(null)
            .withDescription(null)
            .withResetType("notReset")
            .withResetDayOfMonth(null)
            .withResetDayOfWeek("monday")
            .withResetHour(10)
            .withCompleteNotificationNamespaceId(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_mission_group_model_master(
        mission.CreateMissionGroupModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_name('mission-group-0001')
            .with_metadata(None)
            .with_description(None)
            .with_reset_type('notReset')
            .with_reset_day_of_month(None)
            .with_reset_day_of_week('monday')
            .with_reset_hour(10)
            .with_complete_notification_namespace_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.create_mission_group_model_master({
    namespaceName='namespace1',
    name='mission-group-0001',
    metadata=nil,
    description=nil,
    resetType='notReset',
    resetDayOfMonth=nil,
    resetDayOfWeek='monday',
    resetHour=10,
    completeNotificationNamespaceId=nil,
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ミッショングループマスターを新規作成

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
name string ~ 128文字 ミッショングループ名
metadata string ~ 1024文字 メタデータ
description string ~ 1024文字 説明文
resetType enum ['notReset', 'daily', 'weekly', 'monthly'] "notReset" ~ 128文字 リセットタイミング
resetDayOfMonth int {resetType} == "monthly" 1 ~ 31 リセットをする日にち
resetDayOfWeek enum ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] {resetType} == "weekly" ~ 128文字 リセットする曜日
resetHour int {resetType} in ["monthly", "weekly", "daily"] ~ 23 リセット時刻
completeNotificationNamespaceId string ~ 1024文字 ミッションのタスクを達成したときのプッシュ通知

Result

説明
item MissionGroupModelMaster 作成したミッショングループマスター

getMissionGroupModelMaster

getMissionGroupModelMaster

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.GetMissionGroupModelMaster(
    &mission.GetMissionGroupModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        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\GetMissionGroupModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getMissionGroupModelMaster(
        (new GetMissionGroupModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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.GetMissionGroupModelMasterRequest;
import io.gs2.mission.result.GetMissionGroupModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    GetMissionGroupModelMasterResult result = client.getMissionGroupModelMaster(
        new GetMissionGroupModelMasterRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
    );
    MissionGroupModelMaster 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.GetMissionGroupModelMasterRequest;
using Gs2.Gs2Mission.Result.GetMissionGroupModelMasterResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getMissionGroupModelMaster(
    new GetMissionGroupModelMasterRequest()
        .withNamespaceName("namespace1")
        .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.getMissionGroupModelMaster(
        new Gs2Mission.GetMissionGroupModelMasterRequest()
            .withNamespaceName("namespace1")
            .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.get_mission_group_model_master(
        mission.GetMissionGroupModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.get_mission_group_model_master({
    namespaceName='namespace1',
    missionGroupName='mission-group-0001',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ミッショングループマスターを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
missionGroupName string ~ 128文字 ミッショングループ名

Result

説明
item MissionGroupModelMaster ミッショングループマスター

updateMissionGroupModelMaster

updateMissionGroupModelMaster

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.UpdateMissionGroupModelMaster(
    &mission.UpdateMissionGroupModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        MissionGroupName: pointy.String("mission-group-0001"),
        Metadata: pointy.String("MISSION_GROUP1"),
        Description: pointy.String("description1"),
        ResetType: pointy.String("weekly"),
        ResetDayOfMonth: nil,
        ResetDayOfWeek: pointy.String("monday"),
        ResetHour: pointy.Int32(10),
        CompleteNotificationNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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\UpdateMissionGroupModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateMissionGroupModelMaster(
        (new UpdateMissionGroupModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withMissionGroupName("mission-group-0001")
            ->withMetadata("MISSION_GROUP1")
            ->withDescription("description1")
            ->withResetType("weekly")
            ->withResetDayOfMonth(null)
            ->withResetDayOfWeek("monday")
            ->withResetHour(10)
            ->withCompleteNotificationNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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.UpdateMissionGroupModelMasterRequest;
import io.gs2.mission.result.UpdateMissionGroupModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    UpdateMissionGroupModelMasterResult result = client.updateMissionGroupModelMaster(
        new UpdateMissionGroupModelMasterRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withMetadata("MISSION_GROUP1")
            .withDescription("description1")
            .withResetType("weekly")
            .withResetDayOfMonth(null)
            .withResetDayOfWeek("monday")
            .withResetHour(10)
            .withCompleteNotificationNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-0001")
    );
    MissionGroupModelMaster 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.UpdateMissionGroupModelMasterRequest;
using Gs2.Gs2Mission.Result.UpdateMissionGroupModelMasterResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateMissionGroupModelMaster(
    new UpdateMissionGroupModelMasterRequest()
        .withNamespaceName("namespace1")
        .withMissionGroupName("mission-group-0001")
        .withMetadata("MISSION_GROUP1")
        .withDescription("description1")
        .withResetType("weekly")
        .withResetDayOfMonth(null)
        .withResetDayOfWeek("monday")
        .withResetHour(10)
        .withCompleteNotificationNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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.updateMissionGroupModelMaster(
        new Gs2Mission.UpdateMissionGroupModelMasterRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
            .withMetadata("MISSION_GROUP1")
            .withDescription("description1")
            .withResetType("weekly")
            .withResetDayOfMonth(null)
            .withResetDayOfWeek("monday")
            .withResetHour(10)
            .withCompleteNotificationNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-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_mission_group_model_master(
        mission.UpdateMissionGroupModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
            .with_metadata('MISSION_GROUP1')
            .with_description('description1')
            .with_reset_type('weekly')
            .with_reset_day_of_month(None)
            .with_reset_day_of_week('monday')
            .with_reset_hour(10)
            .with_complete_notification_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.update_mission_group_model_master({
    namespaceName='namespace1',
    missionGroupName='mission-group-0001',
    metadata='MISSION_GROUP1',
    description='description1',
    resetType='weekly',
    resetDayOfMonth=nil,
    resetDayOfWeek='monday',
    resetHour=10,
    completeNotificationNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:gateway:game-0001',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ミッショングループマスターを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
missionGroupName string ~ 128文字 ミッショングループ名
metadata string ~ 1024文字 メタデータ
description string ~ 1024文字 説明文
resetType enum ['notReset', 'daily', 'weekly', 'monthly'] "notReset" ~ 128文字 リセットタイミング
resetDayOfMonth int {resetType} == "monthly" 1 ~ 31 リセットをする日にち
resetDayOfWeek enum ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] {resetType} == "weekly" ~ 128文字 リセットする曜日
resetHour int {resetType} in ["monthly", "weekly", "daily"] ~ 23 リセット時刻
completeNotificationNamespaceId string ~ 1024文字 ミッションのタスクを達成したときのプッシュ通知

Result

説明
item MissionGroupModelMaster 更新したミッショングループマスター

deleteMissionGroupModelMaster

deleteMissionGroupModelMaster

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.DeleteMissionGroupModelMaster(
    &mission.DeleteMissionGroupModelMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        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\DeleteMissionGroupModelMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteMissionGroupModelMaster(
        (new DeleteMissionGroupModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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.DeleteMissionGroupModelMasterRequest;
import io.gs2.mission.result.DeleteMissionGroupModelMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    DeleteMissionGroupModelMasterResult result = client.deleteMissionGroupModelMaster(
        new DeleteMissionGroupModelMasterRequest()
            .withNamespaceName("namespace1")
            .withMissionGroupName("mission-group-0001")
    );
    MissionGroupModelMaster 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.DeleteMissionGroupModelMasterRequest;
using Gs2.Gs2Mission.Result.DeleteMissionGroupModelMasterResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteMissionGroupModelMaster(
    new DeleteMissionGroupModelMasterRequest()
        .withNamespaceName("namespace1")
        .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.deleteMissionGroupModelMaster(
        new Gs2Mission.DeleteMissionGroupModelMasterRequest()
            .withNamespaceName("namespace1")
            .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_mission_group_model_master(
        mission.DeleteMissionGroupModelMasterRequest()
            .with_namespace_name(self.hash1)
            .with_mission_group_name('mission-group-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.delete_mission_group_model_master({
    namespaceName='namespace1',
    missionGroupName='mission-group-0001',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ミッショングループマスターを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
missionGroupName string ~ 128文字 ミッショングループ名

Result

説明
item MissionGroupModelMaster 削除したミッショングループ

describeNamespaces

describeNamespaces

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.DescribeNamespaces(
    &mission.DescribeNamespacesRequest {
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeNamespacesRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeNamespaces(
        (new DescribeNamespacesRequest())
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DescribeNamespacesRequest;
import io.gs2.mission.result.DescribeNamespacesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    DescribeNamespacesResult result = client.describeNamespaces(
        new DescribeNamespacesRequest()
            .withPageToken(null)
            .withLimit(null)
    );
    List<Namespace> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.DescribeNamespacesRequest;
using Gs2.Gs2Mission.Result.DescribeNamespacesResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeNamespaces(
    new DescribeNamespacesRequest()
        .withPageToken(null)
        .withLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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.describeNamespaces(
        new Gs2Mission.DescribeNamespacesRequest()
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_namespaces(
        mission.DescribeNamespacesRequest()
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.describe_namespaces({
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

ネームスペースの一覧を取得

Request

必須 デフォルト 値の制限 説明
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items Namespace[] ネームスペースのリスト
nextPageToken string リストの続きを取得するためのページトークン

createNamespace

createNamespace

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.CreateNamespace(
    &mission.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        TransactionSetting: &mission.TransactionSetting{
            EnableAutoRun: pointy.Bool(false),
            QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"),
            KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"),
        },
        MissionCompleteScript: nil,
        CounterIncrementScript: nil,
        ReceiveRewardsScript: nil,
        CompleteNotification: nil,
        LogSetting: &mission.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\CreateNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName(self::namespace1)
            ->withDescription(null)
            ->withTransactionSetting((new \Gs2\Mission\Model\TransactionSetting())
                ->withEnableAutoRun(False)
                ->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
                ->withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:\namespace1:key:key-0001"))
            ->withMissionCompleteScript(null)
            ->withCounterIncrementScript(null)
            ->withReceiveRewardsScript(null)
            ->withCompleteNotification(null)
            ->withLogSetting((new \Gs2\Mission\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.CreateNamespaceRequest;
import io.gs2.mission.result.CreateNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withTransactionSetting(new io.gs2.mission.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
                .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
            .withMissionCompleteScript(null)
            .withCounterIncrementScript(null)
            .withReceiveRewardsScript(null)
            .withCompleteNotification(null)
            .withLogSetting(new io.gs2.mission.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.CreateNamespaceRequest;
using Gs2.Gs2Mission.Result.CreateNamespaceResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createNamespace(
    new CreateNamespaceRequest()
        .withName("namespace1")
        .withDescription(null)
        .withTransactionSetting(new Gs2.Gs2Mission.Model.TransactionSetting()
            .WithEnableAutoRun(false)
            .WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
            .WithKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
        .withMissionCompleteScript(null)
        .withCounterIncrementScript(null)
        .withReceiveRewardsScript(null)
        .withCompleteNotification(null)
        .withLogSetting(new Gs2.Gs2Mission.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.createNamespace(
        new Gs2Mission.CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withTransactionSetting(new Gs2Mission.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
                .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001"))
            .withMissionCompleteScript(null)
            .withCounterIncrementScript(null)
            .withReceiveRewardsScript(null)
            .withCompleteNotification(null)
            .withLogSetting(new Gs2Mission.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_namespace(
        mission.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_transaction_setting(
                mission.TransactionSetting()
                    .with_enable_auto_run(False)
                    .with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001')
                    .with_key_id('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001'))
            .with_mission_complete_script(None)
            .with_counter_increment_script(None)
            .with_receive_rewards_script(None)
            .with_complete_notification(None)
            .with_log_setting(
                mission.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.create_namespace({
    name='namespace1',
    description=nil,
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001',
        keyId='grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0001',
    },
    missionCompleteScript=nil,
    counterIncrementScript=nil,
    receiveRewardsScript=nil,
    completeNotification=nil,
    logSetting={
        loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1',
    },
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを新規作成

Request

必須 デフォルト 値の制限 説明
name string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
transactionSetting TransactionSetting トランザクション設定
missionCompleteScript ScriptSetting ミッションを達成したときに実行するスクリプト
counterIncrementScript ScriptSetting カウンターを上昇したときに実行するスクリプト
receiveRewardsScript ScriptSetting 報酬を受け取ったときに実行するスクリプト
completeNotification NotificationSetting ミッションのタスクを達成したときのプッシュ通知
logSetting LogSetting ログの出力設定

Result

説明
item Namespace 作成したネームスペース

getNamespaceStatus

getNamespaceStatus

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.GetNamespaceStatus(
    &mission.GetNamespaceStatusRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetNamespaceStatusRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName(self::namespace1)
    );
    $status = $result->getStatus();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetNamespaceStatusRequest;
import io.gs2.mission.result.GetNamespaceStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    GetNamespaceStatusResult result = client.getNamespaceStatus(
        new GetNamespaceStatusRequest()
            .withNamespaceName("namespace1")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Mission.Result.GetNamespaceStatusResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespaceStatus(
    new GetNamespaceStatusRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as 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.getNamespaceStatus(
        new Gs2Mission.GetNamespaceStatusRequest()
            .withNamespaceName("namespace1")
    );
    const status = result.getStatus();
} 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_namespace_status(
        mission.GetNamespaceStatusRequest()
            .with_namespace_name(self.hash1)
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.get_namespace_status({
    namespaceName='namespace1',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
status = result.status;

ネームスペースの状態を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
status string

getNamespace

getNamespace

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.GetNamespace(
    &mission.GetNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetNamespaceRequest;
import io.gs2.mission.result.GetNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    GetNamespaceResult result = client.getNamespace(
        new GetNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.GetNamespaceRequest;
using Gs2.Gs2Mission.Result.GetNamespaceResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespace(
    new GetNamespaceRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.getNamespace(
        new Gs2Mission.GetNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    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_namespace(
        mission.GetNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.get_namespace({
    namespaceName='namespace1',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item Namespace ネームスペース

updateNamespace

updateNamespace

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.UpdateNamespace(
    &mission.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        TransactionSetting: &mission.TransactionSetting{
            EnableAutoRun: pointy.Bool(false),
            QueueNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002"),
            KeyId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"),
        },
        MissionCompleteScript: &mission.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"),
        },
        CounterIncrementScript: &mission.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"),
        },
        ReceiveRewardsScript: &mission.ScriptSetting{
            TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"),
            DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"),
        },
        CompleteNotification: nil,
        LogSetting: &mission.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\UpdateNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName(self::namespace1)
            ->withDescription("description1")
            ->withTransactionSetting((new \Gs2\Mission\Model\TransactionSetting())
                ->withEnableAutoRun(False)
                ->withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
                ->withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:\namespace1:key:key-0002"))
            ->withMissionCompleteScript((new \Gs2\Mission\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-0002")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-0002"))
            ->withCounterIncrementScript((new \Gs2\Mission\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-0002")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-0002"))
            ->withReceiveRewardsScript((new \Gs2\Mission\Model\ScriptSetting())
                ->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-0002")
                ->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:\namespace1:script:script-0002"))
            ->withCompleteNotification(null)
            ->withLogSetting((new \Gs2\Mission\Model\LogSetting())
                ->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:\namespace1"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.UpdateNamespaceRequest;
import io.gs2.mission.result.UpdateNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withTransactionSetting(new io.gs2.mission.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
                .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
            .withMissionCompleteScript(new io.gs2.mission.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
            .withCounterIncrementScript(new io.gs2.mission.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
            .withReceiveRewardsScript(new io.gs2.mission.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
            .withCompleteNotification(null)
            .withLogSetting(new io.gs2.mission.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.UpdateNamespaceRequest;
using Gs2.Gs2Mission.Result.UpdateNamespaceResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateNamespace(
    new UpdateNamespaceRequest()
        .withNamespaceName("namespace1")
        .withDescription("description1")
        .withTransactionSetting(new Gs2.Gs2Mission.Model.TransactionSetting()
            .WithEnableAutoRun(false)
            .WithQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
            .WithKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
        .withMissionCompleteScript(new Gs2.Gs2Mission.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
        .withCounterIncrementScript(new Gs2.Gs2Mission.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
        .withReceiveRewardsScript(new Gs2.Gs2Mission.Model.ScriptSetting()
            .WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
            .WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
        .withCompleteNotification(null)
        .withLogSetting(new Gs2.Gs2Mission.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.updateNamespace(
        new Gs2Mission.UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withTransactionSetting(new Gs2Mission.model.TransactionSetting()
                .withEnableAutoRun(false)
                .withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002")
                .withKeyId("grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002"))
            .withMissionCompleteScript(new Gs2Mission.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
            .withCounterIncrementScript(new Gs2Mission.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
            .withReceiveRewardsScript(new Gs2Mission.model.ScriptSetting()
                .withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002")
                .withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002"))
            .withCompleteNotification(null)
            .withLogSetting(new Gs2Mission.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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_namespace(
        mission.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_transaction_setting(
                mission.TransactionSetting()
                    .with_enable_auto_run(False)
                    .with_queue_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002')
                    .with_key_id('grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002'))
            .with_mission_complete_script(
                mission.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002'))
            .with_counter_increment_script(
                mission.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002'))
            .with_receive_rewards_script(
                mission.ScriptSetting()
                    .with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002')
                    .with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002'))
            .with_complete_notification(None)
            .with_log_setting(
                mission.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.update_namespace({
    namespaceName='namespace1',
    description='description1',
    transactionSetting={
        enableAutoRun=false,
        queueNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0002',
        keyId='grn:gs2:ap-northeast-1:YourOwnerId:key:namespace1:key:key-0002',
    },
    missionCompleteScript={
        triggerScriptId='grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002',
        doneTriggerScriptId='grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002',
    },
    counterIncrementScript={
        triggerScriptId='grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002',
        doneTriggerScriptId='grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002',
    },
    receiveRewardsScript={
        triggerScriptId='grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002',
        doneTriggerScriptId='grn:gs2:ap-northeast-1:YourOwnerId:script:namespace1:script:script-0002',
    },
    completeNotification=nil,
    logSetting={
        loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1',
    },
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
transactionSetting TransactionSetting トランザクション設定
missionCompleteScript ScriptSetting ミッションを達成したときに実行するスクリプト
counterIncrementScript ScriptSetting カウンターを上昇したときに実行するスクリプト
receiveRewardsScript ScriptSetting 報酬を受け取ったときに実行するスクリプト
completeNotification NotificationSetting ミッションのタスクを達成したときのプッシュ通知
logSetting LogSetting ログの出力設定

Result

説明
item Namespace 更新したネームスペース

deleteNamespace

deleteNamespace

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.DeleteNamespace(
    &mission.DeleteNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DeleteNamespaceRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.DeleteNamespaceRequest;
import io.gs2.mission.result.DeleteNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    DeleteNamespaceResult result = client.deleteNamespace(
        new DeleteNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Mission.Gs2MissionRestClient;
using Gs2.Gs2Mission.Request.DeleteNamespaceRequest;
using Gs2.Gs2Mission.Result.DeleteNamespaceResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteNamespace(
    new DeleteNamespaceRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.deleteNamespace(
        new Gs2Mission.DeleteNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    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_namespace(
        mission.DeleteNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.delete_namespace({
    namespaceName='namespace1',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item Namespace 削除したネームスペース

describeCounters

describeCounters

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.DescribeCounters(
    &mission.DescribeCountersRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\DescribeCountersRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeCounters(
        (new DescribeCountersRequest())
            ->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.DescribeCountersRequest;
import io.gs2.mission.result.DescribeCountersResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    DescribeCountersResult result = client.describeCounters(
        new DescribeCountersRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Counter> 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.DescribeCountersRequest;
using Gs2.Gs2Mission.Result.DescribeCountersResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeCounters(
    new DescribeCountersRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withPageToken(null)
        .withLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.describeCounters(
        new Gs2Mission.DescribeCountersRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.describe_counters(
        mission.DescribeCountersRequest()
            .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_counters({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

カウンターの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items Counter[] カウンターのリスト
nextPageToken string リストの続きを取得するためのページトークン

describeCountersByUserId

describeCountersByUserId

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.DescribeCountersByUserId(
    &mission.DescribeCountersByUserIdRequest {
        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\DescribeCountersByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeCountersByUserId(
        (new DescribeCountersByUserIdRequest())
            ->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.DescribeCountersByUserIdRequest;
import io.gs2.mission.result.DescribeCountersByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    DescribeCountersByUserIdResult result = client.describeCountersByUserId(
        new DescribeCountersByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<Counter> 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.DescribeCountersByUserIdRequest;
using Gs2.Gs2Mission.Result.DescribeCountersByUserIdResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeCountersByUserId(
    new DescribeCountersByUserIdRequest()
        .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.describeCountersByUserId(
        new Gs2Mission.DescribeCountersByUserIdRequest()
            .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_counters_by_user_id(
        mission.DescribeCountersByUserIdRequest()
            .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_counters_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    pageToken=nil,
    limit=nil,
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

ユーザIDを指定してカウンターの一覧を取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items Counter[] カウンターのリスト
nextPageToken string リストの続きを取得するためのページトークン

increaseCounterByUserId

increaseCounterByUserId

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.IncreaseCounterByUserId(
    &mission.IncreaseCounterByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        CounterName: pointy.String("quest_complete"),
        UserId: pointy.String("user-0001"),
        Value: pointy.Int64(1),
    }
)
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\IncreaseCounterByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->increaseCounterByUserId(
        (new IncreaseCounterByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withCounterName("quest_complete")
            ->withUserId("user-0001")
            ->withValue(1)
    );
    $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.IncreaseCounterByUserIdRequest;
import io.gs2.mission.result.IncreaseCounterByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    IncreaseCounterByUserIdResult result = client.increaseCounterByUserId(
        new IncreaseCounterByUserIdRequest()
            .withNamespaceName("namespace1")
            .withCounterName("quest_complete")
            .withUserId("user-0001")
            .withValue(1L)
    );
    Counter 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.IncreaseCounterByUserIdRequest;
using Gs2.Gs2Mission.Result.IncreaseCounterByUserIdResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.increaseCounterByUserId(
    new IncreaseCounterByUserIdRequest()
        .withNamespaceName("namespace1")
        .withCounterName("quest_complete")
        .withUserId("user-0001")
        .withValue(1L),
    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.increaseCounterByUserId(
        new Gs2Mission.IncreaseCounterByUserIdRequest()
            .withNamespaceName("namespace1")
            .withCounterName("quest_complete")
            .withUserId("user-0001")
            .withValue(1)
    );
    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.increase_counter_by_user_id(
        mission.IncreaseCounterByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_counter_name('quest_complete')
            .with_user_id('user-0001')
            .with_value(1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.increase_counter_by_user_id({
    namespaceName='namespace1',
    counterName='quest_complete',
    userId='user-0001',
    value=1,
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

カウンターに加算

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
counterName string ~ 128文字 カウンター名
userId string ~ 128文字 ユーザーID
value long 1 ~ 9223372036854775806 加算する値

Result

説明
item Counter 作成したカウンター

getCounter

getCounter

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.GetCounter(
    &mission.GetCounterRequest {
        NamespaceName: pointy.String("namespace1"),
        CounterName: pointy.String("quest_complete"),
        AccessToken: pointy.String("$access_token_0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetCounterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCounter(
        (new GetCounterRequest())
            ->withNamespaceName(self::namespace1)
            ->withCounterName("quest_complete")
            ->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.GetCounterRequest;
import io.gs2.mission.result.GetCounterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    GetCounterResult result = client.getCounter(
        new GetCounterRequest()
            .withNamespaceName("namespace1")
            .withCounterName("quest_complete")
            .withAccessToken("$access_token_0001")
    );
    Counter 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.GetCounterRequest;
using Gs2.Gs2Mission.Result.GetCounterResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getCounter(
    new GetCounterRequest()
        .withNamespaceName("namespace1")
        .withCounterName("quest_complete")
        .withAccessToken("$access_token_0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.getCounter(
        new Gs2Mission.GetCounterRequest()
            .withNamespaceName("namespace1")
            .withCounterName("quest_complete")
            .withAccessToken("$access_token_0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.get_counter(
        mission.GetCounterRequest()
            .with_namespace_name(self.hash1)
            .with_counter_name('quest_complete')
            .with_access_token(self.access_token_0001)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.get_counter({
    namespaceName='namespace1',
    counterName='quest_complete',
    accessToken='$access_token_0001',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

カウンターを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
counterName string ~ 128文字 カウンター名
accessToken string ~ 128文字 ユーザーID

Result

説明
item Counter カウンター

getCounterByUserId

getCounterByUserId

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.GetCounterByUserId(
    &mission.GetCounterByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        CounterName: pointy.String("counter-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\GetCounterByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCounterByUserId(
        (new GetCounterByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withCounterName("counter-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.GetCounterByUserIdRequest;
import io.gs2.mission.result.GetCounterByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    GetCounterByUserIdResult result = client.getCounterByUserId(
        new GetCounterByUserIdRequest()
            .withNamespaceName("namespace1")
            .withCounterName("counter-0001")
            .withUserId("user-0001")
    );
    Counter 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.GetCounterByUserIdRequest;
using Gs2.Gs2Mission.Result.GetCounterByUserIdResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getCounterByUserId(
    new GetCounterByUserIdRequest()
        .withNamespaceName("namespace1")
        .withCounterName("counter-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.getCounterByUserId(
        new Gs2Mission.GetCounterByUserIdRequest()
            .withNamespaceName("namespace1")
            .withCounterName("counter-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_counter_by_user_id(
        mission.GetCounterByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_counter_name('counter-0001')
            .with_user_id('user-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.get_counter_by_user_id({
    namespaceName='namespace1',
    counterName='counter-0001',
    userId='user-0001',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ユーザIDを指定してカウンターを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
counterName string ~ 128文字 カウンター名
userId string ~ 128文字 ユーザーID

Result

説明
item Counter カウンター

deleteCounterByUserId

deleteCounterByUserId

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.DeleteCounterByUserId(
    &mission.DeleteCounterByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
        CounterName: pointy.String("quest_complete"),
    }
)
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\DeleteCounterByUserIdRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteCounterByUserId(
        (new DeleteCounterByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->withCounterName("quest_complete")
    );
    $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.DeleteCounterByUserIdRequest;
import io.gs2.mission.result.DeleteCounterByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    DeleteCounterByUserIdResult result = client.deleteCounterByUserId(
        new DeleteCounterByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withCounterName("quest_complete")
    );
    Counter 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.DeleteCounterByUserIdRequest;
using Gs2.Gs2Mission.Result.DeleteCounterByUserIdResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteCounterByUserId(
    new DeleteCounterByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001")
        .withCounterName("quest_complete"),
    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.deleteCounterByUserId(
        new Gs2Mission.DeleteCounterByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withCounterName("quest_complete")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.delete_counter_by_user_id(
        mission.DeleteCounterByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_counter_name('quest_complete')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.delete_counter_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    counterName='quest_complete',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

カウンターを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
counterName string ~ 128文字 カウンター名

Result

説明
item Counter 削除したカウンター

increaseByStampSheet

increaseByStampSheet

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.IncreaseByStampSheet(
    &mission.IncreaseByStampSheetRequest {
        StampSheet: pointy.String("$stampSheet"),
        KeyId: pointy.String("$key1.keyId"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\IncreaseByStampSheetRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->increaseByStampSheet(
        (new IncreaseByStampSheetRequest())
            ->withStampSheet(self::$stampSheet)
            ->withKeyId(self::$key1.keyId)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.IncreaseByStampSheetRequest;
import io.gs2.mission.result.IncreaseByStampSheetResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    IncreaseByStampSheetResult result = client.increaseByStampSheet(
        new IncreaseByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    Counter 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.IncreaseByStampSheetRequest;
using Gs2.Gs2Mission.Result.IncreaseByStampSheetResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.increaseByStampSheet(
    new IncreaseByStampSheetRequest()
        .withStampSheet("$stampSheet")
        .withKeyId("$key1.keyId"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Mission from '@/gs2/mission';

const session = new Gs2Core.Gs2RestSession(
    "ap-northeast-1",
    new Gs2Core.BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
await session.connect();
const client = new Gs2Mission.Gs2MissionRestClient(session);

try {
    const result = await client.increaseByStampSheet(
        new Gs2Mission.IncreaseByStampSheetRequest()
            .withStampSheet("$stampSheet")
            .withKeyId("$key1.keyId")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import mission

session = core.Gs2RestSession(
    core.BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    "ap-northeast-1",
)
session.connect()
client = mission.Gs2MissionRestClient(session)

try:
    result = client.increase_by_stamp_sheet(
        mission.IncreaseByStampSheetRequest()
            .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.increase_by_stamp_sheet({
    stampSheet='$stampSheet',
    keyId='$key1.keyId',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

スタンプシートを使用してカウンターを加算

Request

必須 デフォルト 値の制限 説明
stampSheet string ~ 5242880文字 スタンプシート
keyId string ~ 1024文字 暗号鍵GRN

Result

説明
item Counter カウンター加算後のカウンター

exportMaster

exportMaster

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.ExportMaster(
    &mission.ExportMasterRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\ExportMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->exportMaster(
        (new ExportMasterRequest())
            ->withNamespaceName(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.ExportMasterRequest;
import io.gs2.mission.result.ExportMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentMissionMaster 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.ExportMasterRequest;
using Gs2.Gs2Mission.Result.ExportMasterResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.exportMaster(
    new ExportMasterRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.exportMaster(
        new Gs2Mission.ExportMasterRequest()
            .withNamespaceName("namespace1")
    );
    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.export_master(
        mission.ExportMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.export_master({
    namespaceName='namespace1',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

現在有効なミッションマスターのマスターデータをエクスポート

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item CurrentMissionMaster 現在有効なミッションマスター

getCurrentMissionMaster

getCurrentMissionMaster

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.GetCurrentMissionMaster(
    &mission.GetCurrentMissionMasterRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Mission\Gs2MissionRestClient;
use Gs2\Mission\Request\GetCurrentMissionMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCurrentMissionMaster(
        (new GetCurrentMissionMasterRequest())
            ->withNamespaceName(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.mission.rest.Gs2MissionRestClient;
import io.gs2.mission.request.GetCurrentMissionMasterRequest;
import io.gs2.mission.result.GetCurrentMissionMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    GetCurrentMissionMasterResult result = client.getCurrentMissionMaster(
        new GetCurrentMissionMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentMissionMaster 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.GetCurrentMissionMasterRequest;
using Gs2.Gs2Mission.Result.GetCurrentMissionMasterResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getCurrentMissionMaster(
    new GetCurrentMissionMasterRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.getCurrentMissionMaster(
        new Gs2Mission.GetCurrentMissionMasterRequest()
            .withNamespaceName("namespace1")
    );
    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_current_mission_master(
        mission.GetCurrentMissionMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('mission')

api_result = client.get_current_mission_master({
    namespaceName='namespace1',
})

if(api_result.isError) then
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

現在有効なミッションマスターを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名

Result

説明
item CurrentMissionMaster 現在有効なミッションマスター

updateCurrentMissionMaster

updateCurrentMissionMaster

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.UpdateCurrentMissionMaster(
    &mission.UpdateCurrentMissionMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Settings: pointy.String("{\n  \"version\": \"2019-05-28\",\n  \"groups\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x10\",\n          \"metadata\": \"QUEST_X10\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 10,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x20\",\n          \"metadata\": \"QUEST_X20\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x10\",\n          \"targetValue\": 20,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"counterName\": \"lot_gacha\",\n          \"targetValue\": 1,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"daily\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x100\",\n          \"metadata\": \"QUEST_X100\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 100,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x1000\",\n          \"metadata\": \"QUEST_X1000\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x100\",\n          \"targetValue\": 1000,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"monday\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"story\",\n      \"metadata\": \"STORY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_1-1\",\n          \"metadata\": \"QUEST_1-1\",\n          \"counterName\": \"quest1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-2\",\n          \"metadata\": \"QUEST_1-2\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-3\",\n          \"metadata\": \"QUEST_1-3\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-2\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-4\",\n          \"metadata\": \"QUEST_1-4\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-3\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_2-1\",\n          \"metadata\": \"QUEST_2-1\",\n          \"counterName\": \"quest2\",\n          \"premiseMissionTaskName\": \"quest_1-4\",\n          \"targetValue\": 1\n        }\n      ],\n      \"resetType\": \"notReset\"\n    }\n  ],\n  \"counters\": [\n    {\n      \"name\": \"quest_complete\",\n      \"metadata\": \"QUEST_COMPLETE\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        },\n        {\n          \"resetType\": \"weekly\",\n          \"resetDayOfWeek\": \"monday\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"lot_gacha\",\n      \"metadata\": \"LOT_GACHA\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"quest1\",\n      \"metadata\": \"QUEST1\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    },\n    {\n      \"name\": \"quest2\",\n      \"metadata\": \"QUEST2\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    }\n  ]\n}"),
    }
)
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\UpdateCurrentMissionMasterRequest;

$session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region::AP_NORTHEAST_1
);

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentMissionMaster(
        (new UpdateCurrentMissionMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSettings("{\n  \"version\": \"2019-05-28\",\n  \"groups\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x10\",\n          \"metadata\": \"QUEST_X10\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 10,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x20\",\n          \"metadata\": \"QUEST_X20\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x10\",\n          \"targetValue\": 20,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"counterName\": \"lot_gacha\",\n          \"targetValue\": 1,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"daily\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x100\",\n          \"metadata\": \"QUEST_X100\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 100,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x1000\",\n          \"metadata\": \"QUEST_X1000\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x100\",\n          \"targetValue\": 1000,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"monday\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"story\",\n      \"metadata\": \"STORY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_1-1\",\n          \"metadata\": \"QUEST_1-1\",\n          \"counterName\": \"quest1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-2\",\n          \"metadata\": \"QUEST_1-2\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-3\",\n          \"metadata\": \"QUEST_1-3\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-2\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-4\",\n          \"metadata\": \"QUEST_1-4\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-3\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_2-1\",\n          \"metadata\": \"QUEST_2-1\",\n          \"counterName\": \"quest2\",\n          \"premiseMissionTaskName\": \"quest_1-4\",\n          \"targetValue\": 1\n        }\n      ],\n      \"resetType\": \"notReset\"\n    }\n  ],\n  \"counters\": [\n    {\n      \"name\": \"quest_complete\",\n      \"metadata\": \"QUEST_COMPLETE\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        },\n        {\n          \"resetType\": \"weekly\",\n          \"resetDayOfWeek\": \"monday\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"lot_gacha\",\n      \"metadata\": \"LOT_GACHA\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"quest1\",\n      \"metadata\": \"QUEST1\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    },\n    {\n      \"name\": \"quest2\",\n      \"metadata\": \"QUEST2\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    }\n  ]\n}")
    );
    $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.UpdateCurrentMissionMasterRequest;
import io.gs2.mission.result.UpdateCurrentMissionMasterResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2MissionRestClient client = new Gs2MissionRestClient(session);

try {
    UpdateCurrentMissionMasterResult result = client.updateCurrentMissionMaster(
        new UpdateCurrentMissionMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n  \"version\": \"2019-05-28\",\n  \"groups\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x10\",\n          \"metadata\": \"QUEST_X10\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 10,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x20\",\n          \"metadata\": \"QUEST_X20\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x10\",\n          \"targetValue\": 20,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"counterName\": \"lot_gacha\",\n          \"targetValue\": 1,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"daily\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x100\",\n          \"metadata\": \"QUEST_X100\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 100,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x1000\",\n          \"metadata\": \"QUEST_X1000\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x100\",\n          \"targetValue\": 1000,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"monday\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"story\",\n      \"metadata\": \"STORY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_1-1\",\n          \"metadata\": \"QUEST_1-1\",\n          \"counterName\": \"quest1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-2\",\n          \"metadata\": \"QUEST_1-2\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-3\",\n          \"metadata\": \"QUEST_1-3\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-2\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-4\",\n          \"metadata\": \"QUEST_1-4\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-3\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_2-1\",\n          \"metadata\": \"QUEST_2-1\",\n          \"counterName\": \"quest2\",\n          \"premiseMissionTaskName\": \"quest_1-4\",\n          \"targetValue\": 1\n        }\n      ],\n      \"resetType\": \"notReset\"\n    }\n  ],\n  \"counters\": [\n    {\n      \"name\": \"quest_complete\",\n      \"metadata\": \"QUEST_COMPLETE\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        },\n        {\n          \"resetType\": \"weekly\",\n          \"resetDayOfWeek\": \"monday\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"lot_gacha\",\n      \"metadata\": \"LOT_GACHA\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"quest1\",\n      \"metadata\": \"QUEST1\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    },\n    {\n      \"name\": \"quest2\",\n      \"metadata\": \"QUEST2\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    }\n  ]\n}")
    );
    CurrentMissionMaster 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.UpdateCurrentMissionMasterRequest;
using Gs2.Gs2Mission.Result.UpdateCurrentMissionMasterResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCurrentMissionMaster(
    new UpdateCurrentMissionMasterRequest()
        .withNamespaceName("namespace1")
        .withSettings("{\n  \"version\": \"2019-05-28\",\n  \"groups\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x10\",\n          \"metadata\": \"QUEST_X10\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 10,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x20\",\n          \"metadata\": \"QUEST_X20\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x10\",\n          \"targetValue\": 20,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"counterName\": \"lot_gacha\",\n          \"targetValue\": 1,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"daily\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x100\",\n          \"metadata\": \"QUEST_X100\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 100,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x1000\",\n          \"metadata\": \"QUEST_X1000\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x100\",\n          \"targetValue\": 1000,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"monday\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"story\",\n      \"metadata\": \"STORY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_1-1\",\n          \"metadata\": \"QUEST_1-1\",\n          \"counterName\": \"quest1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-2\",\n          \"metadata\": \"QUEST_1-2\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-3\",\n          \"metadata\": \"QUEST_1-3\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-2\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-4\",\n          \"metadata\": \"QUEST_1-4\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-3\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_2-1\",\n          \"metadata\": \"QUEST_2-1\",\n          \"counterName\": \"quest2\",\n          \"premiseMissionTaskName\": \"quest_1-4\",\n          \"targetValue\": 1\n        }\n      ],\n      \"resetType\": \"notReset\"\n    }\n  ],\n  \"counters\": [\n    {\n      \"name\": \"quest_complete\",\n      \"metadata\": \"QUEST_COMPLETE\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        },\n        {\n          \"resetType\": \"weekly\",\n          \"resetDayOfWeek\": \"monday\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"lot_gacha\",\n      \"metadata\": \"LOT_GACHA\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"quest1\",\n      \"metadata\": \"QUEST1\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    },\n    {\n      \"name\": \"quest2\",\n      \"metadata\": \"QUEST2\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    }\n  ]\n}"),
    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.updateCurrentMissionMaster(
        new Gs2Mission.UpdateCurrentMissionMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n  \"version\": \"2019-05-28\",\n  \"groups\": [\n    {\n      \"name\": \"daily\",\n      \"metadata\": \"DAILY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x10\",\n          \"metadata\": \"QUEST_X10\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 10,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 10}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x20\",\n          \"metadata\": \"QUEST_X20\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x10\",\n          \"targetValue\": 20,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 20}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"gacha\",\n          \"metadata\": \"GACHA\",\n          \"counterName\": \"lot_gacha\",\n          \"targetValue\": 1,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 30}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"daily\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"weekly\",\n      \"metadata\": \"WEEKLY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_x100\",\n          \"metadata\": \"QUEST_X100\",\n          \"counterName\": \"quest_complete\",\n          \"targetValue\": 100,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 40}\"\n            }\n          ]\n        },\n        {\n          \"name\": \"quest_x1000\",\n          \"metadata\": \"QUEST_X1000\",\n          \"counterName\": \"quest_complete\",\n          \"premiseMissionTaskName\": \"quest_x100\",\n          \"targetValue\": 1000,\n          \"completeAcquireActions\": [\n            {\n              \"action\": \"Gs2Experience:AddExperienceByUserId\",\n              \"request\": \"{\\\"experienceName\\\": \\\"basic\\\", \\\"userId\\\": \\\"#{userId}\\\", \\\"experienceModelName\\\": \\\"player\\\", \\\"propertyId\\\": \\\"player\\\", \\\"experienceValue\\\": 50}\"\n            }\n          ]\n        }\n      ],\n      \"resetType\": \"weekly\",\n      \"resetDayOfWeek\": \"monday\",\n      \"resetHour\": 10\n    },\n    {\n      \"name\": \"story\",\n      \"metadata\": \"STORY\",\n      \"tasks\": [\n        {\n          \"name\": \"quest_1-1\",\n          \"metadata\": \"QUEST_1-1\",\n          \"counterName\": \"quest1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-2\",\n          \"metadata\": \"QUEST_1-2\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-1\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-3\",\n          \"metadata\": \"QUEST_1-3\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-2\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_1-4\",\n          \"metadata\": \"QUEST_1-4\",\n          \"counterName\": \"quest1\",\n          \"premiseMissionTaskName\": \"quest_1-3\",\n          \"targetValue\": 1\n        },\n        {\n          \"name\": \"quest_2-1\",\n          \"metadata\": \"QUEST_2-1\",\n          \"counterName\": \"quest2\",\n          \"premiseMissionTaskName\": \"quest_1-4\",\n          \"targetValue\": 1\n        }\n      ],\n      \"resetType\": \"notReset\"\n    }\n  ],\n  \"counters\": [\n    {\n      \"name\": \"quest_complete\",\n      \"metadata\": \"QUEST_COMPLETE\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        },\n        {\n          \"resetType\": \"weekly\",\n          \"resetDayOfWeek\": \"monday\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"lot_gacha\",\n      \"metadata\": \"LOT_GACHA\",\n      \"scopes\": [\n        {\n          \"resetType\": \"daily\",\n          \"resetHour\": 5\n        }\n      ]\n    },\n    {\n      \"name\": \"quest1\",\n      \"metadata\": \"QUEST1\",\n      \"scopes\": [\n        {\n          \"resetType\": \"notReset\"\n        }\n      ]\n    },\n    {\n      \"name\": \"q