GS2-Schedule SDK API リファレンス
モデル
Namespace
ネームスペース
ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。
GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024文字 | ネームスペースGRN | ||
name | string | ✓ | ~ 128文字 | ネームスペース名 | ||
description | string | ~ 1024文字 | 説明文 | |||
logSetting | LogSetting | ログの出力設定 | ||||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
EventMaster
イベントマスター
イベントの期間は絶対期間と相対期間の2種類存在します。
絶対期間は 2021年1月1日 00:00(UTC) ~ 2021年1月7日 23:59(UTC) のような固定の期間で、
相対期間は トリガーを引いたタイミングから 24時間 のようなゲームプレイヤー毎に異なる期間をイベント期間とするものです。
イベントには開催期間だけでなく、繰り返しが設定できるようになっており
イベント期間のうち、月曜日の 10:00 ~ 11:00 だけをイベント期間とするような設定も可能です。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
eventId | string | ✓ | ~ 1024文字 | イベントマスターGRN | ||
name | string | ✓ | ~ 128文字 | イベントの種類名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 2048文字 | メタデータ | |||
scheduleType | enum { “absolute”, “relative” } | ✓ | ~ 128文字 | イベント期間の種類 | ||
absoluteBegin | long | イベントの開始日時 (UNIX時間 単位:ミリ秒) | ||||
absoluteEnd | long | イベントの終了日時 (UNIX時間 単位:ミリ秒) | ||||
relativeTriggerName | string | {scheduleType} == “relative” | ✓ | ~ 128文字 | イベントのトリガー名 | |
repeatSetting | RepeatSetting | ✓ | 繰り返し設定 | |||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
updatedAt | long | ✓ | 現在時刻 | 最終更新日時 (UNIX時間 単位:ミリ秒) | ||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
scheduleType に指定する列挙型の定義
定義 | 説明 |
---|---|
absolute | 固定期間 |
relative | プレイヤー別期間 |
Trigger
トリガー
トリガーはゲームプレイヤー毎に異なるイベント開催期間を実現する際に、イベントの開始の起点となるタイミングを定義するエンティティです。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
triggerId | string | ✓ | ~ 1024文字 | トリガーGRN | ||
name | string | ✓ | ~ 128文字 | トリガーの名前 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
createdAt | long | ✓ | 現在時刻 | 作成日時 (UNIX時間 単位:ミリ秒) | ||
expiresAt | long | ✓ | トリガーの有効期限 (UNIX時間 単位:ミリ秒) | |||
revision | long | 0 | ~ 9223372036854775805 | リビジョン |
Event
イベント
イベントの期間は絶対期間と相対期間の2種類存在します。
絶対期間は 2021年1月1日 00:00(UTC) ~ 2021年1月7日 23:59(UTC) のような固定の期間で、
相対期間は トリガーを引いたタイミングから 24時間 のようなゲームプレイヤー毎に異なる期間をイベント期間とするものです。
イベントには開催期間だけでなく、繰り返しが設定できるようになっており
イベント期間のうち、月曜日の 10:00 ~ 11:00 だけをイベント期間とするような設定も可能です。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
eventId | string | ✓ | ~ 1024文字 | GS2-Schedule イベントGRN | ||
name | string | ✓ | ~ 128文字 | イベントの種類名 | ||
metadata | string | ~ 2048文字 | メタデータ | |||
scheduleType | enum { “absolute”, “relative” } | ✓ | ~ 128文字 | イベント期間の種類 | ||
absoluteBegin | long | イベントの開始日時 (UNIX時間 単位:ミリ秒) | ||||
absoluteEnd | long | イベントの終了日時 (UNIX時間 単位:ミリ秒) | ||||
relativeTriggerName | string | {scheduleType} == “relative” | ✓ | ~ 128文字 | イベントのトリガー名 | |
repeatSetting | RepeatSetting | ✓ | 繰り返し設定 |
scheduleType に指定する列挙型の定義
定義 | 説明 |
---|---|
absolute | 固定期間 |
relative | プレイヤー別期間 |
RepeatSetting
繰り返し設定
イベント期間のうち、月曜日の 10:00 ~ 11:00 だけをイベント期間とするような設定をする際に利用します。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
repeatType | enum { “always”, “daily”, “weekly”, “monthly”, “custom” } | ✓ | “always” | ~ 128文字 | 繰り返しの種類 | |
beginDayOfMonth | int | {repeatType} == “monthly” | ✓ | 1 ~ 31 | イベントの繰り返し開始日(月の日数を超える場合は、最終日として扱われます) | |
endDayOfMonth | int | {repeatType} == “monthly” | ✓ | 1 ~ 31 | イベントの繰り返し終了日(月の日数を超える場合は、最終日として扱われます) | |
beginDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ✓ | ~ 128文字 | イベントの繰り返し開始曜日 | |
endDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ✓ | ~ 128文字 | イベントの繰り返し終了曜日 | |
beginHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ✓ | ~ 23 | イベントの繰り返し開始時間(単位:時) | |
endHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ✓ | ~ 24 | イベントの繰り返し終了時間(単位:時) | |
anchorTimestamp | long | {repeatType} == “custom” | ✓ | サイクルを開始する基準日 (UNIX時間 単位:ミリ秒) | ||
activeDays | int | {repeatType} == “custom” | ✓ | 1 ~ 2147483646.0 | サイクル内のアクティブな日数 | |
inactiveDays | int | {repeatType} == “custom” | ✓ | 1 ~ 2147483646.0 | サイクル内のインアクティブな日数 |
repeatType に指定する列挙型の定義
定義 | 説明 |
---|---|
always | イベント期間 常時 |
daily | イベント期間のうち 毎日X時~X時 |
weekly | イベント期間のうち 毎週X曜日 X時~X時 |
monthly | イベント期間のうち 毎月X日 X時~X時 |
custom | 基準日から始まり、イベント期間中、X日アクティブ、Y日インアクティブを繰り返す |
beginDayOfWeek に指定する列挙型の定義
定義 | 説明 |
---|---|
sunday | 日曜日 |
monday | 月曜日 |
tuesday | 火曜日 |
wednesday | 水曜日 |
thursday | 木曜日 |
friday | 金曜日 |
saturday | 土曜日 |
endDayOfWeek に指定する列挙型の定義
定義 | 説明 |
---|---|
sunday | 日曜日 |
monday | 月曜日 |
tuesday | 火曜日 |
wednesday | 水曜日 |
thursday | 木曜日 |
friday | 金曜日 |
saturday | 土曜日 |
RepeatSchedule
スケジュールの繰り返し状態
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
repeatCount | int | ✓ | ~ 2147483646 | 繰り返し回数 | ||
currentRepeatStartAt | long | リピート中のイベントの開始日時 (UNIX時間 単位:ミリ秒) | ||||
currentRepeatEndAt | long | リピート中のイベントの終了日時 (UNIX時間 単位:ミリ秒) | ||||
lastRepeatEndAt | long | 前回のイベントの終了日時 (UNIX時間 単位:ミリ秒) | ||||
nextRepeatStartAt | long | 次回のイベントの開始日時 (UNIX時間 単位:ミリ秒) |
CurrentEventMaster
現在有効なマスターデータ
GS2ではマスターデータの管理にJSON形式のファイルを使用します。
ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが
よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
Note
JSONファイルの形式については GS2-Schedule マスターデータリファレンス をご参照ください。型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024文字 | 現在有効なイベントマスターGRN | ||
settings | string | ✓ | ~ 5242880文字 | マスターデータ |
GitHubCheckoutSetting
GitHubからマスターデータをチェックアウトする設定
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
apiKeyId | string | ✓ | ~ 1024文字 | GitHub のAPIキーGRN | ||
repositoryName | string | ✓ | ~ 1024文字 | リポジトリ名 | ||
sourcePath | string | ✓ | ~ 1024文字 | ソースコードのファイルパス | ||
referenceType | enum { “commit_hash”, “branch”, “tag” } | ✓ | ~ 128文字 | コードの取得元 | ||
commitHash | string | {referenceType} == “commit_hash” | ✓ | ~ 1024文字 | コミットハッシュ | |
branchName | string | {referenceType} == “branch” | ✓ | ~ 1024文字 | ブランチ名 | |
tagName | string | {referenceType} == “tag” | ✓ | ~ 1024文字 | タグ名 |
referenceType に指定する列挙型の定義
定義 | 説明 |
---|---|
commit_hash | コミットハッシュ |
branch | ブランチ |
tag | タグ |
LogSetting
ログの書き出し設定
ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用されるログ名前空間の識別子(Namespace ID)を保持します。
ログ名前空間IDは、ログデータを集約し、保存する対象の GS2-Log の名前空間を指定します。
この設定を通じて、この名前空間以下のAPIリクエスト・レスポンスログデータが対象の GS2-Log へ出力されるようになります。
GS2-Log にはリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
loggingNamespaceId | string | ✓ | ~ 1024文字 | ネームスペースGRN |
メソッド
describeNamespaces
ネームスペースの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<Namespace> | ネームスペースのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&schedule.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\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\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.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DescribeNamespacesRequest;
import io.gs2.schedule.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(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.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DescribeNamespacesRequest;
using Gs2.Gs2Schedule.Result.DescribeNamespacesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Schedule.Request.DescribeNamespacesRequest()
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2Schedule.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 schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.describe_namespaces(
schedule.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('schedule')
api_result = client.describe_namespaces({
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('schedule')
api_result_handler = client.describe_namespaces_async({
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createNamespace
ネームスペースを新規作成
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | ネームスペース名 | ||
description | string | ~ 1024文字 | 説明文 | |||
logSetting | LogSetting | ログの出力設定 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 作成したネームスペース |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.CreateNamespace(
&schedule.CreateNamespaceRequest {
Name: pointy.String("namespace1"),
Description: nil,
LogSetting: &schedule.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\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)
->withLogSetting((new \Gs2\Schedule\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.CreateNamespaceRequest;
import io.gs2.schedule.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withLogSetting(new io.gs2.schedule.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
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.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.CreateNamespaceRequest;
using Gs2.Gs2Schedule.Result.CreateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Schedule.Request.CreateNamespaceRequest()
.WithName("namespace1")
.WithDescription(null)
.WithLogSetting(new Gs2.Gs2Schedule.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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 Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.createNamespace(
new Gs2Schedule.CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withLogSetting(new Gs2Schedule.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.create_namespace(
schedule.CreateNamespaceRequest()
.with_name(self.hash1)
.with_description(None)
.with_log_setting(
schedule.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.create_namespace({
name="namespace1",
description=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.create_namespace_async({
name="namespace1",
description=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getNamespaceStatus
ネームスペースの状態を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
status | string |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.GetNamespaceStatus(
&schedule.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\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\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.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.GetNamespaceStatusRequest;
import io.gs2.schedule.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(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.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Schedule.Result.GetNamespaceStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Schedule.Request.GetNamespaceStatusRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2Schedule.GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.get_namespace_status(
schedule.GetNamespaceStatusRequest()
.with_namespace_name(self.hash1)
)
status = result.status
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.get_namespace_status({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
client = gs2('schedule')
api_result_handler = client.get_namespace_status_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
getNamespace
ネームスペースを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | ネームスペース |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.GetNamespace(
&schedule.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\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\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.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.GetNamespaceRequest;
import io.gs2.schedule.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(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.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.GetNamespaceRequest;
using Gs2.Gs2Schedule.Result.GetNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Schedule.Request.GetNamespaceRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.getNamespace(
new Gs2Schedule.GetNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.get_namespace(
schedule.GetNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.get_namespace({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.get_namespace_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateNamespace
ネームスペースを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
description | string | ~ 1024文字 | 説明文 | |||
logSetting | LogSetting | ログの出力設定 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 更新したネームスペース |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.UpdateNamespace(
&schedule.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
Description: pointy.String("description1"),
LogSetting: &schedule.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\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")
->withLogSetting((new \Gs2\Schedule\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.UpdateNamespaceRequest;
import io.gs2.schedule.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withLogSetting(new io.gs2.schedule.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
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.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.UpdateNamespaceRequest;
using Gs2.Gs2Schedule.Result.UpdateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Schedule.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace1")
.WithDescription("description1")
.WithLogSetting(new Gs2.Gs2Schedule.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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 Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2Schedule.UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withLogSetting(new Gs2Schedule.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.update_namespace(
schedule.UpdateNamespaceRequest()
.with_namespace_name(self.hash1)
.with_description('description1')
.with_log_setting(
schedule.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.update_namespace({
namespaceName="namespace1",
description="description1",
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.update_namespace_async({
namespaceName="namespace1",
description="description1",
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteNamespace
ネームスペースを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 |
Result
型 | 説明 | |
---|---|---|
item | Namespace | 削除したネームスペース |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.DeleteNamespace(
&schedule.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\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\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.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DeleteNamespaceRequest;
import io.gs2.schedule.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(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.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DeleteNamespaceRequest;
using Gs2.Gs2Schedule.Result.DeleteNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Schedule.Request.DeleteNamespaceRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2Schedule.DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.delete_namespace(
schedule.DeleteNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.delete_namespace({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.delete_namespace_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
dumpUserDataByUserId
指定したユーザーIDに紐づくデータのダンプを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 |
---|
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.DumpUserDataByUserId(
&schedule.DumpUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DumpUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->dumpUserDataByUserId(
(new DumpUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DumpUserDataByUserIdRequest;
import io.gs2.schedule.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
new DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Schedule.Result.DumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2Schedule.Request.DumpUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.dumpUserDataByUserId(
new Gs2Schedule.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.dump_user_data_by_user_id(
schedule.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('schedule')
api_result_handler = client.dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
checkDumpUserDataByUserId
指定したユーザーIDに紐づくデータのダンプが完了しているか確認
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
url | string | 出力データのURL |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
&schedule.CheckDumpUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\CheckDumpUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->checkDumpUserDataByUserId(
(new CheckDumpUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$url = $result->getUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.schedule.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
new CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
String url = result.getUrl();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Schedule.Result.CheckDumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2Schedule.Request.CheckDumpUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.checkDumpUserDataByUserId(
new Gs2Schedule.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.check_dump_user_data_by_user_id(
schedule.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.check_dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
client = gs2('schedule')
api_result_handler = client.check_dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
cleanUserDataByUserId
指定したユーザーIDに紐づくデータのダンプを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 |
---|
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.CleanUserDataByUserId(
&schedule.CleanUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\CleanUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->cleanUserDataByUserId(
(new CleanUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.CleanUserDataByUserIdRequest;
import io.gs2.schedule.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
new CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Schedule.Result.CleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2Schedule.Request.CleanUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.cleanUserDataByUserId(
new Gs2Schedule.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.clean_user_data_by_user_id(
schedule.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.clean_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('schedule')
api_result_handler = client.clean_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
checkCleanUserDataByUserId
指定したユーザーIDに紐づくデータのダンプが完了しているか確認
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 |
---|
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
&schedule.CheckCleanUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\CheckCleanUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->checkCleanUserDataByUserId(
(new CheckCleanUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.schedule.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
new CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Schedule.Result.CheckCleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2Schedule.Request.CheckCleanUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.checkCleanUserDataByUserId(
new Gs2Schedule.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.check_clean_user_data_by_user_id(
schedule.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.check_clean_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('schedule')
api_result_handler = client.check_clean_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
prepareImportUserDataByUserId
指定したユーザーIDに紐づくデータのインポートを開始
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
uploadToken | string | アップロード後に結果を反映する際に使用するトークン |
uploadUrl | string | ユーザーデータアップロード処理の実行に使用するURL |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
&schedule.PrepareImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\PrepareImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->prepareImportUserDataByUserId(
(new PrepareImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$uploadToken = $result->getUploadToken();
$uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.schedule.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
new PrepareImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
String uploadToken = result.getUploadToken();
String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Schedule.Result.PrepareImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2Schedule.Request.PrepareImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.prepareImportUserDataByUserId(
new Gs2Schedule.PrepareImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const uploadToken = result.getUploadToken();
const uploadUrl = result.getUploadUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.prepare_import_user_data_by_user_id(
schedule.PrepareImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
upload_token = result.upload_token
upload_url = result.upload_url
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.prepare_import_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('schedule')
api_result_handler = client.prepare_import_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
importUserDataByUserId
指定したユーザーIDに紐づくデータのインポートを開始
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
uploadToken | string | ✓ | ~ 1024文字 | アップロード準備で受け取ったトークン | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 |
---|
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.ImportUserDataByUserId(
&schedule.ImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
UploadToken: pointy.String("upload-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\ImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->importUserDataByUserId(
(new ImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withUploadToken("upload-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.ImportUserDataByUserIdRequest;
import io.gs2.schedule.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
ImportUserDataByUserIdResult result = client.importUserDataByUserId(
new ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Schedule.Result.ImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2Schedule.Request.ImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithUploadToken("upload-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.importUserDataByUserId(
new Gs2Schedule.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.import_user_data_by_user_id(
schedule.ImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_upload_token('upload-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('schedule')
api_result_handler = client.import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
checkImportUserDataByUserId
指定したユーザーIDに紐づくデータのインポートが完了しているか確認
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
uploadToken | string | ✓ | ~ 1024文字 | アップロード準備で受け取ったトークン | ||
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
url | string | 出力ログのURL |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
&schedule.CheckImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
UploadToken: pointy.String("upload-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\CheckImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->checkImportUserDataByUserId(
(new CheckImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withUploadToken("upload-0001")
->withTimeOffsetToken(null)
);
$url = $result->getUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.CheckImportUserDataByUserIdRequest;
import io.gs2.schedule.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
new CheckImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
String url = result.getUrl();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Schedule.Result.CheckImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2Schedule.Request.CheckImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithUploadToken("upload-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.checkImportUserDataByUserId(
new Gs2Schedule.CheckImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.check_import_user_data_by_user_id(
schedule.CheckImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_upload_token('upload-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.check_import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
client = gs2('schedule')
api_result_handler = client.check_import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
describeEventMasters
イベントマスターの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<EventMaster> | イベントマスターのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.DescribeEventMasters(
&schedule.DescribeEventMastersRequest {
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\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DescribeEventMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeEventMasters(
(new DescribeEventMastersRequest())
->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.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DescribeEventMastersRequest;
import io.gs2.schedule.result.DescribeEventMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
DescribeEventMastersResult result = client.describeEventMasters(
new DescribeEventMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<EventMaster> 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.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DescribeEventMastersRequest;
using Gs2.Gs2Schedule.Result.DescribeEventMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DescribeEventMastersResult> asyncResult = null;
yield return client.DescribeEventMasters(
new Gs2.Gs2Schedule.Request.DescribeEventMastersRequest()
.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 Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.describeEventMasters(
new Gs2Schedule.DescribeEventMastersRequest()
.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 schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.describe_event_masters(
schedule.DescribeEventMastersRequest()
.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('schedule')
api_result = client.describe_event_masters({
namespaceName="namespace1",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('schedule')
api_result_handler = client.describe_event_masters_async({
namespaceName="namespace1",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createEventMaster
イベントマスターを新規作成
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
name | string | ✓ | ~ 128文字 | イベントの種類名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 2048文字 | メタデータ | |||
scheduleType | enum { “absolute”, “relative” } | ✓ | ~ 128文字 | イベント期間の種類 | ||
absoluteBegin | long | イベントの開始日時 (UNIX時間 単位:ミリ秒) | ||||
absoluteEnd | long | イベントの終了日時 (UNIX時間 単位:ミリ秒) | ||||
repeatType | enum { “always”, “daily”, “weekly”, “monthly” } | ✓ | “always” | ~ 128文字 | 繰り返しの種類 | |
repeatBeginDayOfMonth | int | {repeatType} == “monthly” | ✓ | 1 ~ 31 | イベントの繰り返し開始日(月の日数を超える場合は、最終日として扱われます) | |
repeatEndDayOfMonth | int | {repeatType} == “monthly” | ✓ | 1 ~ 31 | イベントの繰り返し終了日(月の日数を超える場合は、最終日として扱われます) | |
repeatBeginDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ✓ | ~ 128文字 | イベントの繰り返し開始曜日 | |
repeatEndDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ✓ | ~ 128文字 | イベントの繰り返し終了曜日 | |
repeatBeginHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ✓ | ~ 23 | イベントの繰り返し開始時間(単位:時) | |
repeatEndHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ✓ | ~ 24 | イベントの繰り返し終了時間(単位:時) | |
relativeTriggerName | string | {scheduleType} == “relative” | ✓ | ~ 128文字 | イベントのトリガー名 | |
repeatSetting | RepeatSetting | ✓ | 繰り返し設定 |
scheduleType に指定する列挙型の定義
定義 | 説明 |
---|---|
absolute | 固定期間 |
relative | プレイヤー別期間 |
repeatType に指定する列挙型の定義
定義 | 説明 |
---|---|
always | イベント期間 常時 |
daily | イベント期間のうち 毎日X時~X時 |
weekly | イベント期間のうち 毎週X曜日 X時~X時 |
monthly | イベント期間のうち 毎月X日 X時~X時 |
repeatBeginDayOfWeek に指定する列挙型の定義
定義 | 説明 |
---|---|
sunday | 日曜日 |
monday | 月曜日 |
tuesday | 火曜日 |
wednesday | 水曜日 |
thursday | 木曜日 |
friday | 金曜日 |
saturday | 土曜日 |
repeatEndDayOfWeek に指定する列挙型の定義
定義 | 説明 |
---|---|
sunday | 日曜日 |
monday | 月曜日 |
tuesday | 火曜日 |
wednesday | 水曜日 |
thursday | 木曜日 |
friday | 金曜日 |
saturday | 土曜日 |
Result
型 | 説明 | |
---|---|---|
item | EventMaster | 作成したイベントマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.CreateEventMaster(
&schedule.CreateEventMasterRequest {
NamespaceName: pointy.String("namespace1"),
Name: pointy.String("event-0001"),
Description: nil,
Metadata: nil,
ScheduleType: pointy.String("absolute"),
AbsoluteBegin: pointy.Int64(10000),
AbsoluteEnd: pointy.Int64(20000),
RelativeTriggerName: pointy.String("trigger-0001"),
RepeatSetting: &schedule.RepeatSetting{
BeginDayOfMonth: pointy.Int32(1),
EndDayOfMonth: pointy.Int32(2),
BeginDayOfWeek: pointy.String("monday"),
EndDayOfWeek: pointy.String("sunday"),
BeginHour: pointy.Int32(5),
EndHour: pointy.Int32(6),
},
}
)
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\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\CreateEventMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createEventMaster(
(new CreateEventMasterRequest())
->withNamespaceName(self::namespace1)
->withName("event-0001")
->withDescription(null)
->withMetadata(null)
->withScheduleType("absolute")
->withAbsoluteBegin(10000)
->withAbsoluteEnd(20000)
->withRelativeTriggerName("trigger-0001")
->withRepeatSetting((new \Gs2\Schedule\Model\RepeatSetting())
->withBeginDayOfMonth(1)
->withEndDayOfMonth(2)
->withBeginDayOfWeek("monday")
->withEndDayOfWeek("sunday")
->withBeginHour(5)
->withEndHour(6))
);
$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.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.CreateEventMasterRequest;
import io.gs2.schedule.result.CreateEventMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
CreateEventMasterResult result = client.createEventMaster(
new CreateEventMasterRequest()
.withNamespaceName("namespace1")
.withName("event-0001")
.withDescription(null)
.withMetadata(null)
.withScheduleType("absolute")
.withAbsoluteBegin(10000L)
.withAbsoluteEnd(20000L)
.withRelativeTriggerName("trigger-0001")
.withRepeatSetting(new io.gs2.schedule.model.RepeatSetting()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(2)
.withBeginDayOfWeek("monday")
.withEndDayOfWeek("sunday")
.withBeginHour(5)
.withEndHour(6))
);
EventMaster 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.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.CreateEventMasterRequest;
using Gs2.Gs2Schedule.Result.CreateEventMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.CreateEventMasterResult> asyncResult = null;
yield return client.CreateEventMaster(
new Gs2.Gs2Schedule.Request.CreateEventMasterRequest()
.WithNamespaceName("namespace1")
.WithName("event-0001")
.WithDescription(null)
.WithMetadata(null)
.WithScheduleType("absolute")
.WithAbsoluteBegin(10000L)
.WithAbsoluteEnd(20000L)
.WithRelativeTriggerName("trigger-0001")
.WithRepeatSetting(new Gs2.Gs2Schedule.Model.RepeatSetting()
.WithBeginDayOfMonth(1)
.WithEndDayOfMonth(2)
.WithBeginDayOfWeek("monday")
.WithEndDayOfWeek("sunday")
.WithBeginHour(5)
.WithEndHour(6)),
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 Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.createEventMaster(
new Gs2Schedule.CreateEventMasterRequest()
.withNamespaceName("namespace1")
.withName("event-0001")
.withDescription(null)
.withMetadata(null)
.withScheduleType("absolute")
.withAbsoluteBegin(10000)
.withAbsoluteEnd(20000)
.withRelativeTriggerName("trigger-0001")
.withRepeatSetting(new Gs2Schedule.model.RepeatSetting()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(2)
.withBeginDayOfWeek("monday")
.withEndDayOfWeek("sunday")
.withBeginHour(5)
.withEndHour(6))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.create_event_master(
schedule.CreateEventMasterRequest()
.with_namespace_name(self.hash1)
.with_name('event-0001')
.with_description(None)
.with_metadata(None)
.with_schedule_type('absolute')
.with_absolute_begin(10000)
.with_absolute_end(20000)
.with_relative_trigger_name('trigger-0001')
.with_repeat_setting(
schedule.RepeatSetting()
.with_begin_day_of_month(1)
.with_end_day_of_month(2)
.with_begin_day_of_week('monday')
.with_end_day_of_week('sunday')
.with_begin_hour(5)
.with_end_hour(6))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.create_event_master({
namespaceName="namespace1",
name="event-0001",
description=nil,
metadata=nil,
scheduleType="absolute",
absoluteBegin=10000,
absoluteEnd=20000,
relativeTriggerName="trigger-0001",
repeatSetting={
beginDayOfMonth=1,
endDayOfMonth=2,
beginDayOfWeek="monday",
endDayOfWeek="sunday",
beginHour=5,
endHour=6,
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.create_event_master_async({
namespaceName="namespace1",
name="event-0001",
description=nil,
metadata=nil,
scheduleType="absolute",
absoluteBegin=10000,
absoluteEnd=20000,
relativeTriggerName="trigger-0001",
repeatSetting={
beginDayOfMonth=1,
endDayOfMonth=2,
beginDayOfWeek="monday",
endDayOfWeek="sunday",
beginHour=5,
endHour=6,
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getEventMaster
イベントマスターを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
eventName | string | ✓ | ~ 128文字 | イベントの種類名 |
Result
型 | 説明 | |
---|---|---|
item | EventMaster | イベントマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.GetEventMaster(
&schedule.GetEventMasterRequest {
NamespaceName: pointy.String("namespace1"),
EventName: pointy.String("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\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\GetEventMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getEventMaster(
(new GetEventMasterRequest())
->withNamespaceName(self::namespace1)
->withEventName("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.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.GetEventMasterRequest;
import io.gs2.schedule.result.GetEventMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
GetEventMasterResult result = client.getEventMaster(
new GetEventMasterRequest()
.withNamespaceName("namespace1")
.withEventName("event-0001")
);
EventMaster 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.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.GetEventMasterRequest;
using Gs2.Gs2Schedule.Result.GetEventMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.GetEventMasterResult> asyncResult = null;
yield return client.GetEventMaster(
new Gs2.Gs2Schedule.Request.GetEventMasterRequest()
.WithNamespaceName("namespace1")
.WithEventName("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 Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.getEventMaster(
new Gs2Schedule.GetEventMasterRequest()
.withNamespaceName("namespace1")
.withEventName("event-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.get_event_master(
schedule.GetEventMasterRequest()
.with_namespace_name(self.hash1)
.with_event_name('event-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.get_event_master({
namespaceName="namespace1",
eventName="event-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.get_event_master_async({
namespaceName="namespace1",
eventName="event-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateEventMaster
イベントマスターを更新
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
eventName | string | ✓ | ~ 128文字 | イベントの種類名 | ||
description | string | ~ 1024文字 | 説明文 | |||
metadata | string | ~ 2048文字 | メタデータ | |||
scheduleType | enum { “absolute”, “relative” } | ✓ | ~ 128文字 | イベント期間の種類 | ||
absoluteBegin | long | イベントの開始日時 (UNIX時間 単位:ミリ秒) | ||||
absoluteEnd | long | イベントの終了日時 (UNIX時間 単位:ミリ秒) | ||||
repeatType | enum { “always”, “daily”, “weekly”, “monthly” } | ✓ | “always” | ~ 128文字 | 繰り返しの種類 | |
repeatBeginDayOfMonth | int | {repeatType} == “monthly” | ✓ | 1 ~ 31 | イベントの繰り返し開始日(月の日数を超える場合は、最終日として扱われます) | |
repeatEndDayOfMonth | int | {repeatType} == “monthly” | ✓ | 1 ~ 31 | イベントの繰り返し終了日(月の日数を超える場合は、最終日として扱われます) | |
repeatBeginDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ✓ | ~ 128文字 | イベントの繰り返し開始曜日 | |
repeatEndDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ✓ | ~ 128文字 | イベントの繰り返し終了曜日 | |
repeatBeginHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ✓ | ~ 23 | イベントの繰り返し開始時間(単位:時) | |
repeatEndHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ✓ | ~ 24 | イベントの繰り返し終了時間(単位:時) | |
relativeTriggerName | string | {scheduleType} == “relative” | ✓ | ~ 128文字 | イベントのトリガー名 | |
repeatSetting | RepeatSetting | ✓ | 繰り返し設定 |
scheduleType に指定する列挙型の定義
定義 | 説明 |
---|---|
absolute | 固定期間 |
relative | プレイヤー別期間 |
repeatType に指定する列挙型の定義
定義 | 説明 |
---|---|
always | イベント期間 常時 |
daily | イベント期間のうち 毎日X時~X時 |
weekly | イベント期間のうち 毎週X曜日 X時~X時 |
monthly | イベント期間のうち 毎月X日 X時~X時 |
repeatBeginDayOfWeek に指定する列挙型の定義
定義 | 説明 |
---|---|
sunday | 日曜日 |
monday | 月曜日 |
tuesday | 火曜日 |
wednesday | 水曜日 |
thursday | 木曜日 |
friday | 金曜日 |
saturday | 土曜日 |
repeatEndDayOfWeek に指定する列挙型の定義
定義 | 説明 |
---|---|
sunday | 日曜日 |
monday | 月曜日 |
tuesday | 火曜日 |
wednesday | 水曜日 |
thursday | 木曜日 |
friday | 金曜日 |
saturday | 土曜日 |
Result
型 | 説明 | |
---|---|---|
item | EventMaster | 更新したイベントマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.UpdateEventMaster(
&schedule.UpdateEventMasterRequest {
NamespaceName: pointy.String("namespace1"),
EventName: pointy.String("event-0001"),
Description: pointy.String("description1"),
Metadata: pointy.String("{\"hoge\": \"fuga\"}"),
ScheduleType: pointy.String("absolute"),
AbsoluteBegin: pointy.Int64(20000),
AbsoluteEnd: pointy.Int64(30000),
RelativeTriggerName: pointy.String("trigger-0001"),
RepeatSetting: &schedule.RepeatSetting{
BeginDayOfMonth: pointy.Int32(1),
EndDayOfMonth: pointy.Int32(2),
BeginDayOfWeek: pointy.String("monday"),
EndDayOfWeek: pointy.String("sunday"),
BeginHour: pointy.Int32(5),
EndHour: pointy.Int32(6),
},
}
)
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\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\UpdateEventMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateEventMaster(
(new UpdateEventMasterRequest())
->withNamespaceName(self::namespace1)
->withEventName("event-0001")
->withDescription("description1")
->withMetadata("{\"hoge\": \"fuga\"}")
->withScheduleType("absolute")
->withAbsoluteBegin(20000)
->withAbsoluteEnd(30000)
->withRelativeTriggerName("trigger-0001")
->withRepeatSetting((new \Gs2\Schedule\Model\RepeatSetting())
->withBeginDayOfMonth(1)
->withEndDayOfMonth(2)
->withBeginDayOfWeek("monday")
->withEndDayOfWeek("sunday")
->withBeginHour(5)
->withEndHour(6))
);
$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.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.UpdateEventMasterRequest;
import io.gs2.schedule.result.UpdateEventMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
UpdateEventMasterResult result = client.updateEventMaster(
new UpdateEventMasterRequest()
.withNamespaceName("namespace1")
.withEventName("event-0001")
.withDescription("description1")
.withMetadata("{\"hoge\": \"fuga\"}")
.withScheduleType("absolute")
.withAbsoluteBegin(20000L)
.withAbsoluteEnd(30000L)
.withRelativeTriggerName("trigger-0001")
.withRepeatSetting(new io.gs2.schedule.model.RepeatSetting()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(2)
.withBeginDayOfWeek("monday")
.withEndDayOfWeek("sunday")
.withBeginHour(5)
.withEndHour(6))
);
EventMaster 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.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.UpdateEventMasterRequest;
using Gs2.Gs2Schedule.Result.UpdateEventMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.UpdateEventMasterResult> asyncResult = null;
yield return client.UpdateEventMaster(
new Gs2.Gs2Schedule.Request.UpdateEventMasterRequest()
.WithNamespaceName("namespace1")
.WithEventName("event-0001")
.WithDescription("description1")
.WithMetadata("{\"hoge\": \"fuga\"}")
.WithScheduleType("absolute")
.WithAbsoluteBegin(20000L)
.WithAbsoluteEnd(30000L)
.WithRelativeTriggerName("trigger-0001")
.WithRepeatSetting(new Gs2.Gs2Schedule.Model.RepeatSetting()
.WithBeginDayOfMonth(1)
.WithEndDayOfMonth(2)
.WithBeginDayOfWeek("monday")
.WithEndDayOfWeek("sunday")
.WithBeginHour(5)
.WithEndHour(6)),
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 Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.updateEventMaster(
new Gs2Schedule.UpdateEventMasterRequest()
.withNamespaceName("namespace1")
.withEventName("event-0001")
.withDescription("description1")
.withMetadata("{\"hoge\": \"fuga\"}")
.withScheduleType("absolute")
.withAbsoluteBegin(20000)
.withAbsoluteEnd(30000)
.withRelativeTriggerName("trigger-0001")
.withRepeatSetting(new Gs2Schedule.model.RepeatSetting()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(2)
.withBeginDayOfWeek("monday")
.withEndDayOfWeek("sunday")
.withBeginHour(5)
.withEndHour(6))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.update_event_master(
schedule.UpdateEventMasterRequest()
.with_namespace_name(self.hash1)
.with_event_name('event-0001')
.with_description('description1')
.with_metadata('{"hoge": "fuga"}')
.with_schedule_type('absolute')
.with_absolute_begin(20000)
.with_absolute_end(30000)
.with_relative_trigger_name('trigger-0001')
.with_repeat_setting(
schedule.RepeatSetting()
.with_begin_day_of_month(1)
.with_end_day_of_month(2)
.with_begin_day_of_week('monday')
.with_end_day_of_week('sunday')
.with_begin_hour(5)
.with_end_hour(6))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.update_event_master({
namespaceName="namespace1",
eventName="event-0001",
description="description1",
metadata="{\"hoge\": \"fuga\"}",
scheduleType="absolute",
absoluteBegin=20000,
absoluteEnd=30000,
relativeTriggerName="trigger-0001",
repeatSetting={
beginDayOfMonth=1,
endDayOfMonth=2,
beginDayOfWeek="monday",
endDayOfWeek="sunday",
beginHour=5,
endHour=6,
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.update_event_master_async({
namespaceName="namespace1",
eventName="event-0001",
description="description1",
metadata="{\"hoge\": \"fuga\"}",
scheduleType="absolute",
absoluteBegin=20000,
absoluteEnd=30000,
relativeTriggerName="trigger-0001",
repeatSetting={
beginDayOfMonth=1,
endDayOfMonth=2,
beginDayOfWeek="monday",
endDayOfWeek="sunday",
beginHour=5,
endHour=6,
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteEventMaster
イベントマスターを削除
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
eventName | string | ✓ | ~ 128文字 | イベントの種類名 |
Result
型 | 説明 | |
---|---|---|
item | EventMaster | 削除したイベントマスター |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.DeleteEventMaster(
&schedule.DeleteEventMasterRequest {
NamespaceName: pointy.String("namespace1"),
EventName: pointy.String("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\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DeleteEventMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteEventMaster(
(new DeleteEventMasterRequest())
->withNamespaceName(self::namespace1)
->withEventName("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.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DeleteEventMasterRequest;
import io.gs2.schedule.result.DeleteEventMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
DeleteEventMasterResult result = client.deleteEventMaster(
new DeleteEventMasterRequest()
.withNamespaceName("namespace1")
.withEventName("event-0001")
);
EventMaster 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.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DeleteEventMasterRequest;
using Gs2.Gs2Schedule.Result.DeleteEventMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DeleteEventMasterResult> asyncResult = null;
yield return client.DeleteEventMaster(
new Gs2.Gs2Schedule.Request.DeleteEventMasterRequest()
.WithNamespaceName("namespace1")
.WithEventName("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 Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.deleteEventMaster(
new Gs2Schedule.DeleteEventMasterRequest()
.withNamespaceName("namespace1")
.withEventName("event-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.delete_event_master(
schedule.DeleteEventMasterRequest()
.with_namespace_name(self.hash1)
.with_event_name('event-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.delete_event_master({
namespaceName="namespace1",
eventName="event-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.delete_event_master_async({
namespaceName="namespace1",
eventName="event-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
describeTriggers
トリガーの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 |
Result
型 | 説明 | |
---|---|---|
items | List<Trigger> | トリガーのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.DescribeTriggers(
&schedule.DescribeTriggersRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("accessToken-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DescribeTriggersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeTriggers(
(new DescribeTriggersRequest())
->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.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DescribeTriggersRequest;
import io.gs2.schedule.result.DescribeTriggersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
DescribeTriggersResult result = client.describeTriggers(
new DescribeTriggersRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
List<Trigger> 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.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DescribeTriggersRequest;
using Gs2.Gs2Schedule.Result.DescribeTriggersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DescribeTriggersResult> asyncResult = null;
yield return client.DescribeTriggers(
new Gs2.Gs2Schedule.Request.DescribeTriggersRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("accessToken-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.describeTriggers(
new Gs2Schedule.DescribeTriggersRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.describe_triggers(
schedule.DescribeTriggersRequest()
.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('schedule')
api_result = client.describe_triggers({
namespaceName="namespace1",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('schedule')
api_result_handler = client.describe_triggers_async({
namespaceName="namespace1",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
describeTriggersByUserId
ユーザIDを指定してトリガーの一覧を取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
userId | string | ✓ | ~ 128文字 | ユーザーID | ||
pageToken | string | ~ 1024文字 | データの取得を開始する位置を指定するトークン | |||
limit | int | ✓ | 30 | 1 ~ 1000 | データの取得件数 | |
timeOffsetToken | string | ~ 1024文字 | タイムオフセットトークン |
Result
型 | 説明 | |
---|---|---|
items | List<Trigger> | トリガーのリスト |
nextPageToken | string | リストの続きを取得するためのページトークン |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.DescribeTriggersByUserId(
&schedule.DescribeTriggersByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DescribeTriggersByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeTriggersByUserId(
(new DescribeTriggersByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DescribeTriggersByUserIdRequest;
import io.gs2.schedule.result.DescribeTriggersByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
DescribeTriggersByUserIdResult result = client.describeTriggersByUserId(
new DescribeTriggersByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<Trigger> 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.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DescribeTriggersByUserIdRequest;
using Gs2.Gs2Schedule.Result.DescribeTriggersByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DescribeTriggersByUserIdResult> asyncResult = null;
yield return client.DescribeTriggersByUserId(
new Gs2.Gs2Schedule.Request.DescribeTriggersByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.describeTriggersByUserId(
new Gs2Schedule.DescribeTriggersByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.describe_triggers_by_user_id(
schedule.DescribeTriggersByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.describe_triggers_by_user_id({
namespaceName="namespace1",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('schedule')
api_result_handler = client.describe_triggers_by_user_id_async({
namespaceName="namespace1",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
getTrigger
トリガーを取得
Request
型 | 有効化条件 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | ||
accessToken | string | ✓ | ~ 128文字 | ユーザーID | ||
triggerName | string | ✓ | ~ 128文字 | トリガーの名前 |
Result
型 | 説明 | |
---|---|---|
item | Trigger | トリガー |
実装例
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
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 := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.GetTrigger(
&schedule.GetTriggerRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("accessToken-0001"),
TriggerName: pointy.String("trigger1"),
}
)
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\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\GetTriggerRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getTrigger(
(new GetTriggerRequest())
->withNamespaceName(self::namespace1)
->withAccessToken(self::$accessToken0001)
->withTriggerName("trigger1")
);
$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.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.GetTriggerRequest;
import io.gs2.schedule.result.GetTriggerResult;
Gs2RestSession session = new Gs2RestSession