NAV
go python java php typescript csharp GS2-Script

GS2-Schedule

GS2 SDK のリファレンス

GS2 SDK リファレンス

モデル

Namespace

ネームスペース

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

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

説明
namespaceId string ネームスペースGRN
name string ネームスペース名
description string 説明文
logSetting LogSetting ログの出力設定
createdAt long 作成日時
updatedAt long 最終更新日時

EventMaster

イベントマスター

イベントの期間は絶対期間と相対期間の2種類存在します。
絶対期間は 2021年1月1日 00:00(UTC) ~ 2021年1月7日 23:59(UTC) のような固定の期間で、
相対期間は トリガーを引いたタイミングから 24時間 のようなゲームプレイヤー毎に異なる期間をイベント期間とするものです。

イベントには開催期間だけでなく、繰り返しが設定できるようになっており
イベント期間のうち、月曜日の 10:00 ~ 11:00 だけをイベント期間とするような設定も可能です。

説明
eventId string イベントマスターGRN
name string イベントの種類名
description string 説明文
metadata string メタデータ
scheduleType enum ['absolute', 'relative'] イベント期間の種類
repeatType enum ['always', 'daily', 'weekly', 'monthly'] 繰り返しの種類
absoluteBegin long イベントの開始日時
absoluteEnd long イベントの終了日時
repeatBeginDayOfMonth int イベントの繰り返し開始日
repeatEndDayOfMonth int イベントの繰り返し終了日
repeatBeginDayOfWeek enum ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] イベントの繰り返し開始曜日
repeatEndDayOfWeek enum ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] イベントの繰り返し終了曜日
repeatBeginHour int イベントの繰り返し開始時間
repeatEndHour int イベントの繰り返し終了時間
relativeTriggerName string イベントの開始トリガー名
relativeDuration int イベントの開催期間(秒)
createdAt long 作成日時
updatedAt long 最終更新日時

Trigger

トリガー

トリガーはゲームプレイヤー毎に異なるイベント開催期間を実現する際に、イベントの開始の起点となるタイミングを定義するエンティティです。

説明
triggerId string トリガーGRN
name string トリガーの名前
userId string ユーザーID
createdAt long 作成日時
expiresAt long トリガーの有効期限

Event

イベント

イベントの期間は絶対期間と相対期間の2種類存在します。
絶対期間は 2021年1月1日 00:00(UTC) ~ 2021年1月7日 23:59(UTC) のような固定の期間で、
相対期間は トリガーを引いたタイミングから 24時間 のようなゲームプレイヤー毎に異なる期間をイベント期間とするものです。

イベントには開催期間だけでなく、繰り返しが設定できるようになっており
イベント期間のうち、月曜日の 10:00 ~ 11:00 だけをイベント期間とするような設定も可能です。

説明
eventId string イベントGRN
name string イベントの種類名
metadata string メタデータ
scheduleType enum ['absolute', 'relative'] イベント期間の種類
repeatType enum ['always', 'daily', 'weekly', 'monthly'] 繰り返しの種類
absoluteBegin long イベントの開始日時
absoluteEnd long イベントの終了日時
repeatBeginDayOfMonth int イベントの繰り返し開始日
repeatEndDayOfMonth int イベントの繰り返し終了日
repeatBeginDayOfWeek enum ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] イベントの繰り返し開始曜日
repeatEndDayOfWeek enum ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'] イベントの繰り返し終了曜日
repeatBeginHour int イベントの繰り返し開始時間
repeatEndHour int イベントの繰り返し終了時間
relativeTriggerName string イベントの開始トリガー
relativeDuration int イベントの開催期間(秒)

CurrentEventMaster

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

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

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

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

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

GitHubCheckoutSetting

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

LogSetting

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

メソッド

describeNamespaces

describeNamespaces

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeNamespaces(
    new DescribeNamespacesRequest()
        .withPageToken(null)
        .withLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

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

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

Request

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

Result

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

createNamespace

createNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createNamespace(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

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

Request

必須 デフォルト 値の制限 説明
name string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
logSetting LogSetting ログの出力設定

Result

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

getNamespaceStatus

getNamespaceStatus

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespaceStatus(
    new GetNamespaceStatusRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
status = result.status;

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

Request

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

Result

説明
status string

getNamespace

getNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespace(
    new GetNamespaceRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを取得

Request

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

Result

説明
item Namespace ネームスペース

updateNamespace

updateNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateNamespace(
    new 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
logSetting LogSetting ログの出力設定

Result

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

deleteNamespace

deleteNamespace

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteNamespace(
    new DeleteNamespaceRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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
    # エラー発生時
    fail(api_result['statusCode'], api_result['message'])
end

result = api_result.result
item = result.item;

ネームスペースを削除

Request

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

Result

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

describeEventMasters

describeEventMasters

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

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

イベントマスターの一覧を取得

Request

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

Result

説明
items EventMaster[] イベントマスターのリスト
nextPageToken string リストの続きを取得するためのページトークン

createEventMaster

createEventMaster

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),
        RepeatType: nil,
        RepeatBeginDayOfMonth: pointy.Int32(1),
        RepeatEndDayOfMonth: pointy.Int32(2),
        RepeatBeginDayOfWeek: pointy.String("monday"),
        RepeatEndDayOfWeek: pointy.String("sunday"),
        RepeatBeginHour: pointy.Int32(5),
        RepeatEndHour: pointy.Int32(6),
        RelativeTriggerName: pointy.String("trigger-0001"),
        RelativeDuration: pointy.Int32(10000),
    }
)
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)
            ->withRepeatType(null)
            ->withRepeatBeginDayOfMonth(1)
            ->withRepeatEndDayOfMonth(2)
            ->withRepeatBeginDayOfWeek("monday")
            ->withRepeatEndDayOfWeek("sunday")
            ->withRepeatBeginHour(5)
            ->withRepeatEndHour(6)
            ->withRelativeTriggerName("trigger-0001")
            ->withRelativeDuration(10000)
    );
    $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)
            .withRepeatType(null)
            .withRepeatBeginDayOfMonth(1)
            .withRepeatEndDayOfMonth(2)
            .withRepeatBeginDayOfWeek("monday")
            .withRepeatEndDayOfWeek("sunday")
            .withRepeatBeginHour(5)
            .withRepeatEndHour(6)
            .withRelativeTriggerName("trigger-0001")
            .withRelativeDuration(10000)
    );
    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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createEventMaster(
    new CreateEventMasterRequest()
        .withNamespaceName("namespace1")
        .withName("event-0001")
        .withDescription(null)
        .withMetadata(null)
        .withScheduleType("absolute")
        .withAbsoluteBegin(10000L)
        .withAbsoluteEnd(20000L)
        .withRepeatType(null)
        .withRepeatBeginDayOfMonth(1)
        .withRepeatEndDayOfMonth(2)
        .withRepeatBeginDayOfWeek("monday")
        .withRepeatEndDayOfWeek("sunday")
        .withRepeatBeginHour(5)
        .withRepeatEndHour(6)
        .withRelativeTriggerName("trigger-0001")
        .withRelativeDuration(10000),
    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)
            .withRepeatType(null)
            .withRepeatBeginDayOfMonth(1)
            .withRepeatEndDayOfMonth(2)
            .withRepeatBeginDayOfWeek("monday")
            .withRepeatEndDayOfWeek("sunday")
            .withRepeatBeginHour(5)
            .withRepeatEndHour(6)
            .withRelativeTriggerName("trigger-0001")
            .withRelativeDuration(10000)
    );
    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_repeat_type(None)
            .with_repeat_begin_day_of_month(1)
            .with_repeat_end_day_of_month(2)
            .with_repeat_begin_day_of_week('monday')
            .with_repeat_end_day_of_week('sunday')
            .with_repeat_begin_hour(5)
            .with_repeat_end_hour(6)
            .with_relative_trigger_name('trigger-0001')
            .with_relative_duration(10000)
    )
    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,
    repeatType=nil,
    repeatBeginDayOfMonth=1,
    repeatEndDayOfMonth=2,
    repeatBeginDayOfWeek='monday',
    repeatEndDayOfWeek='sunday',
    repeatBeginHour=5,
    repeatEndHour=6,
    relativeTriggerName='trigger-0001',
    relativeDuration=10000,
})

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

result = api_result.result
item = result.item;

イベントマスターを新規作成

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
name string ~ 128文字 イベントの種類名
description string ~ 1024文字 説明文
metadata string ~ 2048文字 メタデータ
scheduleType enum ['absolute', 'relative'] ~ 128文字 イベント期間の種類
absoluteBegin long {scheduleType} == "absolute" イベントの開始日時
absoluteEnd long {scheduleType} == "absolute" イベントの終了日時
repeatType enum ['always', 'daily', 'weekly', 'monthly'] {scheduleType} == "absolute" "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"] ~ 23 イベントの繰り返し終了時間
relativeTriggerName string {scheduleType} == "relative" ~ 128文字 イベントの開始トリガー名
relativeDuration int {scheduleType} == "relative" ~ 2147483646 イベントの開催期間(秒)

Result

説明
item EventMaster 作成したイベントマスター

getEventMaster

getEventMaster

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

result = api_result.result
item = result.item;

イベントマスターを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
eventName string ~ 128文字 イベントの種類名

Result

説明
item EventMaster イベントマスター

updateEventMaster

updateEventMaster

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),
        RepeatType: nil,
        RepeatBeginDayOfMonth: pointy.Int32(1),
        RepeatEndDayOfMonth: pointy.Int32(2),
        RepeatBeginDayOfWeek: pointy.String("monday"),
        RepeatEndDayOfWeek: pointy.String("sunday"),
        RepeatBeginHour: pointy.Int32(5),
        RepeatEndHour: pointy.Int32(6),
        RelativeTriggerName: pointy.String("trigger-0001"),
        RelativeDuration: pointy.Int32(10000),
    }
)
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)
            ->withRepeatType(null)
            ->withRepeatBeginDayOfMonth(1)
            ->withRepeatEndDayOfMonth(2)
            ->withRepeatBeginDayOfWeek("monday")
            ->withRepeatEndDayOfWeek("sunday")
            ->withRepeatBeginHour(5)
            ->withRepeatEndHour(6)
            ->withRelativeTriggerName("trigger-0001")
            ->withRelativeDuration(10000)
    );
    $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)
            .withRepeatType(null)
            .withRepeatBeginDayOfMonth(1)
            .withRepeatEndDayOfMonth(2)
            .withRepeatBeginDayOfWeek("monday")
            .withRepeatEndDayOfWeek("sunday")
            .withRepeatBeginHour(5)
            .withRepeatEndHour(6)
            .withRelativeTriggerName("trigger-0001")
            .withRelativeDuration(10000)
    );
    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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateEventMaster(
    new UpdateEventMasterRequest()
        .withNamespaceName("namespace1")
        .withEventName("event-0001")
        .withDescription("description1")
        .withMetadata("{\"hoge\": \"fuga\"}")
        .withScheduleType("absolute")
        .withAbsoluteBegin(20000L)
        .withAbsoluteEnd(30000L)
        .withRepeatType(null)
        .withRepeatBeginDayOfMonth(1)
        .withRepeatEndDayOfMonth(2)
        .withRepeatBeginDayOfWeek("monday")
        .withRepeatEndDayOfWeek("sunday")
        .withRepeatBeginHour(5)
        .withRepeatEndHour(6)
        .withRelativeTriggerName("trigger-0001")
        .withRelativeDuration(10000),
    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)
            .withRepeatType(null)
            .withRepeatBeginDayOfMonth(1)
            .withRepeatEndDayOfMonth(2)
            .withRepeatBeginDayOfWeek("monday")
            .withRepeatEndDayOfWeek("sunday")
            .withRepeatBeginHour(5)
            .withRepeatEndHour(6)
            .withRelativeTriggerName("trigger-0001")
            .withRelativeDuration(10000)
    );
    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_repeat_type(None)
            .with_repeat_begin_day_of_month(1)
            .with_repeat_end_day_of_month(2)
            .with_repeat_begin_day_of_week('monday')
            .with_repeat_end_day_of_week('sunday')
            .with_repeat_begin_hour(5)
            .with_repeat_end_hour(6)
            .with_relative_trigger_name('trigger-0001')
            .with_relative_duration(10000)
    )
    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,
    repeatType=nil,
    repeatBeginDayOfMonth=1,
    repeatEndDayOfMonth=2,
    repeatBeginDayOfWeek='monday',
    repeatEndDayOfWeek='sunday',
    repeatBeginHour=5,
    repeatEndHour=6,
    relativeTriggerName='trigger-0001',
    relativeDuration=10000,
})

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

result = api_result.result
item = result.item;

イベントマスターを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
eventName string ~ 128文字 イベントの種類名
description string ~ 1024文字 説明文
metadata string ~ 2048文字 メタデータ
scheduleType enum ['absolute', 'relative'] ~ 128文字 イベント期間の種類
absoluteBegin long {scheduleType} == "absolute" イベントの開始日時
absoluteEnd long {scheduleType} == "absolute" イベントの終了日時
repeatType enum ['always', 'daily', 'weekly', 'monthly'] {scheduleType} == "absolute" "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"] ~ 23 イベントの繰り返し終了時間
relativeTriggerName string {scheduleType} == "relative" ~ 128文字 イベントの開始トリガー名
relativeDuration int {scheduleType} == "relative" ~ 2147483646 イベントの開催期間(秒)

Result

説明
item EventMaster 更新したイベントマスター

deleteEventMaster

deleteEventMaster

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

result = api_result.result
item = result.item;

イベントマスターを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
eventName string ~ 128文字 イベントの種類名

Result

説明
item EventMaster 削除したイベントマスター

describeTriggers

describeTriggers

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("$access_token_0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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("$access_token_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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeTriggers(
    new DescribeTriggersRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withPageToken(null)
        .withLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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("$access_token_0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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='$access_token_0001',
    pageToken=nil,
    limit=nil,
})

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

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

トリガーの一覧を取得

Request

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

Result

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

describeTriggersByUserId

describeTriggersByUserId

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

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

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

ユーザIDを指定してトリガーの一覧を取得

Request

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

Result

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

getTrigger

getTrigger

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("$access_token_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(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);

try {
    GetTriggerResult result = client.getTrigger(
        new GetTriggerRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withTriggerName("trigger1")
    );
    Trigger 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.GetTriggerRequest;
using Gs2.Gs2Schedule.Result.GetTriggerResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getTrigger(
    new GetTriggerRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withTriggerName("trigger1"),
    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.getTrigger(
        new Gs2Schedule.GetTriggerRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withTriggerName("trigger1")
    );
    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_trigger(
        schedule.GetTriggerRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_trigger_name('trigger1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('schedule')

api_result = client.get_trigger({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    triggerName='trigger1',
})

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

result = api_result.result
item = result.item;

トリガーを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
triggerName string ~ 128文字 トリガーの名前

Result

説明
item Trigger トリガー

getTriggerByUserId

getTriggerByUserId

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.GetTriggerByUserId(
    &schedule.GetTriggerByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-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\GetTriggerByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getTriggerByUserId(
        (new GetTriggerByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->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.GetTriggerByUserIdRequest;
import io.gs2.schedule.result.GetTriggerByUserIdResult;

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

try {
    GetTriggerByUserIdResult result = client.getTriggerByUserId(
        new GetTriggerByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withTriggerName("trigger1")
    );
    Trigger 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.GetTriggerByUserIdRequest;
using Gs2.Gs2Schedule.Result.GetTriggerByUserIdResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getTriggerByUserId(
    new GetTriggerByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001")
        .withTriggerName("trigger1"),
    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.getTriggerByUserId(
        new Gs2Schedule.GetTriggerByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withTriggerName("trigger1")
    );
    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_trigger_by_user_id(
        schedule.GetTriggerByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_trigger_name('trigger1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('schedule')

api_result = client.get_trigger_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    triggerName='trigger1',
})

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

result = api_result.result
item = result.item;

ユーザIDを指定してトリガーを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
triggerName string ~ 128文字 トリガーの名前

Result

説明
item Trigger トリガー

triggerByUserId

triggerByUserId

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.TriggerByUserId(
    &schedule.TriggerByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        TriggerName: pointy.String("trigger1"),
        UserId: pointy.String("user-0001"),
        TriggerStrategy: pointy.String("renew"),
        Ttl: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\TriggerByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->triggerByUserId(
        (new TriggerByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withTriggerName("trigger1")
            ->withUserId("user-0001")
            ->withTriggerStrategy("renew")
            ->withTtl(null)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.TriggerByUserIdRequest;
import io.gs2.schedule.result.TriggerByUserIdResult;

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

try {
    TriggerByUserIdResult result = client.triggerByUserId(
        new TriggerByUserIdRequest()
            .withNamespaceName("namespace1")
            .withTriggerName("trigger1")
            .withUserId("user-0001")
            .withTriggerStrategy("renew")
            .withTtl(null)
    );
    Trigger 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.TriggerByUserIdRequest;
using Gs2.Gs2Schedule.Result.TriggerByUserIdResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.triggerByUserId(
    new TriggerByUserIdRequest()
        .withNamespaceName("namespace1")
        .withTriggerName("trigger1")
        .withUserId("user-0001")
        .withTriggerStrategy("renew")
        .withTtl(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.triggerByUserId(
        new Gs2Schedule.TriggerByUserIdRequest()
            .withNamespaceName("namespace1")
            .withTriggerName("trigger1")
            .withUserId("user-0001")
            .withTriggerStrategy("renew")
            .withTtl(null)
    );
    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.trigger_by_user_id(
        schedule.TriggerByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_trigger_name('trigger1')
            .with_user_id('user-0001')
            .with_trigger_strategy('renew')
            .with_ttl(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('schedule')

api_result = client.trigger_by_user_id({
    namespaceName='namespace1',
    triggerName='trigger1',
    userId='user-0001',
    triggerStrategy='renew',
    ttl=nil,
})

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

result = api_result.result
item = result.item;

ユーザIDを指定してトリガーを登録

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
triggerName string ~ 256文字 トリガーの名前
userId string ~ 128文字 ユーザーID
triggerStrategy enum ['renew', 'drop'] ~ 128文字 トリガーの引き方の方針
ttl int ~ 2147483646 トリガーの有効期限(秒)

Result

説明
item Trigger 引いたトリガー

deleteTrigger

deleteTrigger

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.DeleteTrigger(
    &schedule.DeleteTriggerRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_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\DeleteTriggerRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteTrigger(
        (new DeleteTriggerRequest())
            ->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.DeleteTriggerRequest;
import io.gs2.schedule.result.DeleteTriggerResult;

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

try {
    DeleteTriggerResult result = client.deleteTrigger(
        new DeleteTriggerRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withTriggerName("trigger1")
    );
    Trigger 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.DeleteTriggerRequest;
using Gs2.Gs2Schedule.Result.DeleteTriggerResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteTrigger(
    new DeleteTriggerRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withTriggerName("trigger1"),
    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.deleteTrigger(
        new Gs2Schedule.DeleteTriggerRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withTriggerName("trigger1")
    );
    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_trigger(
        schedule.DeleteTriggerRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_trigger_name('trigger1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('schedule')

api_result = client.delete_trigger({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    triggerName='trigger1',
})

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

result = api_result.result
item = result.item;

トリガーを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
triggerName string ~ 128文字 トリガーの名前

Result

説明
item Trigger 削除したトリガー

deleteTriggerByUserId

deleteTriggerByUserId

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.DeleteTriggerByUserId(
    &schedule.DeleteTriggerByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-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\DeleteTriggerByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteTriggerByUserId(
        (new DeleteTriggerByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
            ->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.DeleteTriggerByUserIdRequest;
import io.gs2.schedule.result.DeleteTriggerByUserIdResult;

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

try {
    DeleteTriggerByUserIdResult result = client.deleteTriggerByUserId(
        new DeleteTriggerByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withTriggerName("trigger1")
    );
    Trigger 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.DeleteTriggerByUserIdRequest;
using Gs2.Gs2Schedule.Result.DeleteTriggerByUserIdResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteTriggerByUserId(
    new DeleteTriggerByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001")
        .withTriggerName("trigger1"),
    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.deleteTriggerByUserId(
        new Gs2Schedule.DeleteTriggerByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
            .withTriggerName("trigger1")
    );
    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_trigger_by_user_id(
        schedule.DeleteTriggerByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
            .with_trigger_name('trigger1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('schedule')

api_result = client.delete_trigger_by_user_id({
    namespaceName='namespace1',
    userId='user-0001',
    triggerName='trigger1',
})

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

result = api_result.result
item = result.item;

ユーザIDを指定してトリガーを削除

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
triggerName string ~ 128文字 トリガーの名前

Result

説明
item Trigger 削除したトリガー

describeEvents

describeEvents

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.DescribeEvents(
    &schedule.DescribeEventsRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DescribeEventsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeEvents(
        (new DescribeEventsRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DescribeEventsRequest;
import io.gs2.schedule.result.DescribeEventsResult;

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

try {
    DescribeEventsResult result = client.describeEvents(
        new DescribeEventsRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
    );
    List<Event> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DescribeEventsRequest;
using Gs2.Gs2Schedule.Result.DescribeEventsResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeEvents(
    new DescribeEventsRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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.describeEvents(
        new Gs2Schedule.DescribeEventsRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
    );
    const items = result.getItems();
} 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_events(
        schedule.DescribeEventsRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)

client = gs2('schedule')

api_result = client.describe_events({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
})

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

result = api_result.result
items = result.items;

イベントの一覧を取得

Request

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

Result

説明
items Event[] イベントのリスト

describeEventsByUserId

describeEventsByUserId

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.DescribeEventsByUserId(
    &schedule.DescribeEventsByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        UserId: pointy.String("user-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DescribeEventsByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeEventsByUserId(
        (new DescribeEventsByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withUserId("user-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DescribeEventsByUserIdRequest;
import io.gs2.schedule.result.DescribeEventsByUserIdResult;

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

try {
    DescribeEventsByUserIdResult result = client.describeEventsByUserId(
        new DescribeEventsByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
    );
    List<Event> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DescribeEventsByUserIdRequest;
using Gs2.Gs2Schedule.Result.DescribeEventsByUserIdResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeEventsByUserId(
    new DescribeEventsByUserIdRequest()
        .withNamespaceName("namespace1")
        .withUserId("user-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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.describeEventsByUserId(
        new Gs2Schedule.DescribeEventsByUserIdRequest()
            .withNamespaceName("namespace1")
            .withUserId("user-0001")
    );
    const items = result.getItems();
} 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_events_by_user_id(
        schedule.DescribeEventsByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_user_id('user-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)

client = gs2('schedule')

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

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

result = api_result.result
items = result.items;

ユーザIDを指定してイベントの一覧を取得

Request

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

Result

説明
items Event[] イベントのリスト

describeRawEvents

describeRawEvents

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.DescribeRawEvents(
    &schedule.DescribeRawEventsRequest {
        NamespaceName: pointy.String("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DescribeRawEventsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeRawEvents(
        (new DescribeRawEventsRequest())
            ->withNamespaceName(self::namespace1)
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DescribeRawEventsRequest;
import io.gs2.schedule.result.DescribeRawEventsResult;

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

try {
    DescribeRawEventsResult result = client.describeRawEvents(
        new DescribeRawEventsRequest()
            .withNamespaceName("namespace1")
    );
    List<Event> items = result.getItems();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DescribeRawEventsRequest;
using Gs2.Gs2Schedule.Result.DescribeRawEventsResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeRawEvents(
    new DescribeRawEventsRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as 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.describeRawEvents(
        new Gs2Schedule.DescribeRawEventsRequest()
            .withNamespaceName("namespace1")
    );
    const items = result.getItems();
} 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_raw_events(
        schedule.DescribeRawEventsRequest()
            .with_namespace_name(self.hash1)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)

client = gs2('schedule')

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

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

result = api_result.result
items = result.items;

イベントの一覧を取得

Request

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

Result

説明
items Event[] イベントのリスト

getEvent

getEvent

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.GetEvent(
    &schedule.GetEventRequest {
        NamespaceName: pointy.String("namespace1"),
        EventName: pointy.String("event-0001"),
        AccessToken: pointy.String("$access_token_0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\GetEventRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getEvent(
        (new GetEventRequest())
            ->withNamespaceName(self::namespace1)
            ->withEventName("event-0001")
            ->withAccessToken(self::$accessToken0001)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.GetEventRequest;
import io.gs2.schedule.result.GetEventResult;

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

try {
    GetEventResult result = client.getEvent(
        new GetEventRequest()
            .withNamespaceName("namespace1")
            .withEventName("event-0001")
            .withAccessToken("$access_token_0001")
    );
    Event 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.GetEventRequest;
using Gs2.Gs2Schedule.Result.GetEventResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getEvent(
    new GetEventRequest()
        .withNamespaceName("namespace1")
        .withEventName("event-0001")
        .withAccessToken("$access_token_0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.getEvent(
        new Gs2Schedule.GetEventRequest()
            .withNamespaceName("namespace1")
            .withEventName("event-0001")
            .withAccessToken("$access_token_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(
        schedule.GetEventRequest()
            .with_namespace_name(self.hash1)
            .with_event_name('event-0001')
            .with_access_token(self.access_token_0001)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('schedule')

api_result = client.get_event({
    namespaceName='namespace1',
    eventName='event-0001',
    accessToken='$access_token_0001',
})

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

result = api_result.result
item = result.item;

イベントを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
eventName string ~ 128文字 イベントの種類名
accessToken string ~ 128文字 ユーザーID

Result

説明
item Event イベント

getEventByUserId

getEventByUserId

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.GetEventByUserId(
    &schedule.GetEventByUserIdRequest {
        NamespaceName: pointy.String("namespace1"),
        EventName: pointy.String("event-0001"),
        UserId: pointy.String("user-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\GetEventByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getEventByUserId(
        (new GetEventByUserIdRequest())
            ->withNamespaceName(self::namespace1)
            ->withEventName("event-0001")
            ->withUserId("user-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.GetEventByUserIdRequest;
import io.gs2.schedule.result.GetEventByUserIdResult;

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

try {
    GetEventByUserIdResult result = client.getEventByUserId(
        new GetEventByUserIdRequest()
            .withNamespaceName("namespace1")
            .withEventName("event-0001")
            .withUserId("user-0001")
    );
    Event 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.GetEventByUserIdRequest;
using Gs2.Gs2Schedule.Result.GetEventByUserIdResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getEventByUserId(
    new GetEventByUserIdRequest()
        .withNamespaceName("namespace1")
        .withEventName("event-0001")
        .withUserId("user-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.getEventByUserId(
        new Gs2Schedule.GetEventByUserIdRequest()
            .withNamespaceName("namespace1")
            .withEventName("event-0001")
            .withUserId("user-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_by_user_id(
        schedule.GetEventByUserIdRequest()
            .with_namespace_name(self.hash1)
            .with_event_name('event-0001')
            .with_user_id('user-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('schedule')

api_result = client.get_event_by_user_id({
    namespaceName='namespace1',
    eventName='event-0001',
    userId='user-0001',
})

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

result = api_result.result
item = result.item;

ユーザIDを指定してイベントを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
eventName string ~ 128文字 イベントの種類名
userId string ~ 128文字 ユーザーID

Result

説明
item Event イベント

getRawEvent

getRawEvent

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.GetRawEvent(
    &schedule.GetRawEventRequest {
        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\GetRawEventRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getRawEvent(
        (new GetRawEventRequest())
            ->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.GetRawEventRequest;
import io.gs2.schedule.result.GetRawEventResult;

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

try {
    GetRawEventResult result = client.getRawEvent(
        new GetRawEventRequest()
            .withNamespaceName("namespace1")
            .withEventName("event-0001")
    );
    Event 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.GetRawEventRequest;
using Gs2.Gs2Schedule.Result.GetRawEventResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getRawEvent(
    new GetRawEventRequest()
        .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.getRawEvent(
        new Gs2Schedule.GetRawEventRequest()
            .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_raw_event(
        schedule.GetRawEventRequest()
            .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_raw_event({
    namespaceName='namespace1',
    eventName='event-0001',
})

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

result = api_result.result
item = result.item;

イベントを取得

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
eventName string ~ 128文字 イベントの種類名

Result

説明
item Event イベント

exportMaster

exportMaster

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

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

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

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

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

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

client = gs2('schedule')

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

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

result = api_result.result
item = result.item;

現在有効なイベントスケジュールマスターのマスターデータをエクスポート

Request

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

Result

説明
item CurrentEventMaster 現在有効なイベントスケジュールマスター

getCurrentEventMaster

getCurrentEventMaster

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.GetCurrentEventMaster(
    &schedule.GetCurrentEventMasterRequest {
        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\GetCurrentEventMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getCurrentEventMaster(
        (new GetCurrentEventMasterRequest())
            ->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.GetCurrentEventMasterRequest;
import io.gs2.schedule.result.GetCurrentEventMasterResult;

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

try {
    GetCurrentEventMasterResult result = client.getCurrentEventMaster(
        new GetCurrentEventMasterRequest()
            .withNamespaceName("namespace1")
    );
    CurrentEventMaster 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.GetCurrentEventMasterRequest;
using Gs2.Gs2Schedule.Result.GetCurrentEventMasterResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getCurrentEventMaster(
    new GetCurrentEventMasterRequest()
        .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.getCurrentEventMaster(
        new Gs2Schedule.GetCurrentEventMasterRequest()
            .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_current_event_master(
        schedule.GetCurrentEventMasterRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('schedule')

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

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

result = api_result.result
item = result.item;

現在有効なイベントスケジュールマスターを取得

Request

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

Result

説明
item CurrentEventMaster 現在有効なイベントスケジュールマスター

updateCurrentEventMaster

updateCurrentEventMaster

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.UpdateCurrentEventMaster(
    &schedule.UpdateCurrentEventMasterRequest {
        NamespaceName: pointy.String("namespace1"),
        Settings: pointy.String("{\n  \"version\": \"2019-03-31\",\n  \"events\": [\n    {\n      \"name\": \"event-0001\",\n      \"metadata\": \"EVENT_0001\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 10000,\n      \"absoluteEnd\": 20000\n    },\n    {\n      \"name\": \"event-0002\",\n      \"metadata\": \"EVENT_0002\",\n      \"scheduleType\": \"relative\",\n      \"relativeTriggerName\": \"trigger-0001\",\n      \"relativeDuration\": 30000\n    },\n    {\n      \"name\": \"daily-0001\",\n      \"metadata\": \"EVENT_0003\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569369600000,\n      \"absoluteEnd\": 1569456000000,\n      \"repeatType\": \"daily\",\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"daily-0002\",\n      \"metadata\": \"EVENT_0004\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569369600000,\n      \"absoluteEnd\": 1569456000000,\n      \"repeatType\": \"daily\",\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 1\n    },\n    {\n      \"name\": \"weekly-0001\",\n      \"metadata\": \"EVENT_0005\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569888000000,\n      \"absoluteEnd\": 1570406400000,\n      \"repeatType\": \"weekly\",\n      \"repeatBeginDayOfWeek\": \"tuesday\",\n      \"repeatEndDayOfWeek\": \"wednesday\",\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"weekly-0002\",\n      \"metadata\": \"EVENT_0006\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569888000000,\n      \"absoluteEnd\": 1570406400000,\n      \"repeatType\": \"weekly\",\n      \"repeatBeginDayOfWeek\": \"wednesday\",\n      \"repeatEndDayOfWeek\": \"tuesday\",\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 1\n    },\n    {\n      \"name\": \"monthly-0001\",\n      \"metadata\": \"EVENT_0007\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1570406400000,\n      \"absoluteEnd\": 1575158400000,\n      \"repeatType\": \"monthly\",\n      \"repeatBeginDayOfMonth\": 10,\n      \"repeatEndDayOfMonth\": 15,\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"monthly-0002\",\n      \"metadata\": \"EVENT_0008\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1570406400000,\n      \"absoluteEnd\": 1575158400000,\n      \"repeatType\": \"monthly\",\n      \"repeatBeginDayOfMonth\": 16,\n      \"repeatEndDayOfMonth\": 9,\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 0\n    }\n  ]\n}"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\UpdateCurrentEventMasterRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentEventMaster(
        (new UpdateCurrentEventMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withSettings("{\n  \"version\": \"2019-03-31\",\n  \"events\": [\n    {\n      \"name\": \"event-0001\",\n      \"metadata\": \"EVENT_0001\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 10000,\n      \"absoluteEnd\": 20000\n    },\n    {\n      \"name\": \"event-0002\",\n      \"metadata\": \"EVENT_0002\",\n      \"scheduleType\": \"relative\",\n      \"relativeTriggerName\": \"trigger-0001\",\n      \"relativeDuration\": 30000\n    },\n    {\n      \"name\": \"daily-0001\",\n      \"metadata\": \"EVENT_0003\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569369600000,\n      \"absoluteEnd\": 1569456000000,\n      \"repeatType\": \"daily\",\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"daily-0002\",\n      \"metadata\": \"EVENT_0004\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569369600000,\n      \"absoluteEnd\": 1569456000000,\n      \"repeatType\": \"daily\",\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 1\n    },\n    {\n      \"name\": \"weekly-0001\",\n      \"metadata\": \"EVENT_0005\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569888000000,\n      \"absoluteEnd\": 1570406400000,\n      \"repeatType\": \"weekly\",\n      \"repeatBeginDayOfWeek\": \"tuesday\",\n      \"repeatEndDayOfWeek\": \"wednesday\",\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"weekly-0002\",\n      \"metadata\": \"EVENT_0006\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569888000000,\n      \"absoluteEnd\": 1570406400000,\n      \"repeatType\": \"weekly\",\n      \"repeatBeginDayOfWeek\": \"wednesday\",\n      \"repeatEndDayOfWeek\": \"tuesday\",\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 1\n    },\n    {\n      \"name\": \"monthly-0001\",\n      \"metadata\": \"EVENT_0007\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1570406400000,\n      \"absoluteEnd\": 1575158400000,\n      \"repeatType\": \"monthly\",\n      \"repeatBeginDayOfMonth\": 10,\n      \"repeatEndDayOfMonth\": 15,\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"monthly-0002\",\n      \"metadata\": \"EVENT_0008\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1570406400000,\n      \"absoluteEnd\": 1575158400000,\n      \"repeatType\": \"monthly\",\n      \"repeatBeginDayOfMonth\": 16,\n      \"repeatEndDayOfMonth\": 9,\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 0\n    }\n  ]\n}")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.UpdateCurrentEventMasterRequest;
import io.gs2.schedule.result.UpdateCurrentEventMasterResult;

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

try {
    UpdateCurrentEventMasterResult result = client.updateCurrentEventMaster(
        new UpdateCurrentEventMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n  \"version\": \"2019-03-31\",\n  \"events\": [\n    {\n      \"name\": \"event-0001\",\n      \"metadata\": \"EVENT_0001\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 10000,\n      \"absoluteEnd\": 20000\n    },\n    {\n      \"name\": \"event-0002\",\n      \"metadata\": \"EVENT_0002\",\n      \"scheduleType\": \"relative\",\n      \"relativeTriggerName\": \"trigger-0001\",\n      \"relativeDuration\": 30000\n    },\n    {\n      \"name\": \"daily-0001\",\n      \"metadata\": \"EVENT_0003\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569369600000,\n      \"absoluteEnd\": 1569456000000,\n      \"repeatType\": \"daily\",\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"daily-0002\",\n      \"metadata\": \"EVENT_0004\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569369600000,\n      \"absoluteEnd\": 1569456000000,\n      \"repeatType\": \"daily\",\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 1\n    },\n    {\n      \"name\": \"weekly-0001\",\n      \"metadata\": \"EVENT_0005\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569888000000,\n      \"absoluteEnd\": 1570406400000,\n      \"repeatType\": \"weekly\",\n      \"repeatBeginDayOfWeek\": \"tuesday\",\n      \"repeatEndDayOfWeek\": \"wednesday\",\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"weekly-0002\",\n      \"metadata\": \"EVENT_0006\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569888000000,\n      \"absoluteEnd\": 1570406400000,\n      \"repeatType\": \"weekly\",\n      \"repeatBeginDayOfWeek\": \"wednesday\",\n      \"repeatEndDayOfWeek\": \"tuesday\",\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 1\n    },\n    {\n      \"name\": \"monthly-0001\",\n      \"metadata\": \"EVENT_0007\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1570406400000,\n      \"absoluteEnd\": 1575158400000,\n      \"repeatType\": \"monthly\",\n      \"repeatBeginDayOfMonth\": 10,\n      \"repeatEndDayOfMonth\": 15,\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"monthly-0002\",\n      \"metadata\": \"EVENT_0008\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1570406400000,\n      \"absoluteEnd\": 1575158400000,\n      \"repeatType\": \"monthly\",\n      \"repeatBeginDayOfMonth\": 16,\n      \"repeatEndDayOfMonth\": 9,\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 0\n    }\n  ]\n}")
    );
    CurrentEventMaster 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.UpdateCurrentEventMasterRequest;
using Gs2.Gs2Schedule.Result.UpdateCurrentEventMasterResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCurrentEventMaster(
    new UpdateCurrentEventMasterRequest()
        .withNamespaceName("namespace1")
        .withSettings("{\n  \"version\": \"2019-03-31\",\n  \"events\": [\n    {\n      \"name\": \"event-0001\",\n      \"metadata\": \"EVENT_0001\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 10000,\n      \"absoluteEnd\": 20000\n    },\n    {\n      \"name\": \"event-0002\",\n      \"metadata\": \"EVENT_0002\",\n      \"scheduleType\": \"relative\",\n      \"relativeTriggerName\": \"trigger-0001\",\n      \"relativeDuration\": 30000\n    },\n    {\n      \"name\": \"daily-0001\",\n      \"metadata\": \"EVENT_0003\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569369600000,\n      \"absoluteEnd\": 1569456000000,\n      \"repeatType\": \"daily\",\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"daily-0002\",\n      \"metadata\": \"EVENT_0004\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569369600000,\n      \"absoluteEnd\": 1569456000000,\n      \"repeatType\": \"daily\",\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 1\n    },\n    {\n      \"name\": \"weekly-0001\",\n      \"metadata\": \"EVENT_0005\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569888000000,\n      \"absoluteEnd\": 1570406400000,\n      \"repeatType\": \"weekly\",\n      \"repeatBeginDayOfWeek\": \"tuesday\",\n      \"repeatEndDayOfWeek\": \"wednesday\",\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"weekly-0002\",\n      \"metadata\": \"EVENT_0006\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569888000000,\n      \"absoluteEnd\": 1570406400000,\n      \"repeatType\": \"weekly\",\n      \"repeatBeginDayOfWeek\": \"wednesday\",\n      \"repeatEndDayOfWeek\": \"tuesday\",\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 1\n    },\n    {\n      \"name\": \"monthly-0001\",\n      \"metadata\": \"EVENT_0007\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1570406400000,\n      \"absoluteEnd\": 1575158400000,\n      \"repeatType\": \"monthly\",\n      \"repeatBeginDayOfMonth\": 10,\n      \"repeatEndDayOfMonth\": 15,\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"monthly-0002\",\n      \"metadata\": \"EVENT_0008\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1570406400000,\n      \"absoluteEnd\": 1575158400000,\n      \"repeatType\": \"monthly\",\n      \"repeatBeginDayOfMonth\": 16,\n      \"repeatEndDayOfMonth\": 9,\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 0\n    }\n  ]\n}"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.updateCurrentEventMaster(
        new Gs2Schedule.UpdateCurrentEventMasterRequest()
            .withNamespaceName("namespace1")
            .withSettings("{\n  \"version\": \"2019-03-31\",\n  \"events\": [\n    {\n      \"name\": \"event-0001\",\n      \"metadata\": \"EVENT_0001\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 10000,\n      \"absoluteEnd\": 20000\n    },\n    {\n      \"name\": \"event-0002\",\n      \"metadata\": \"EVENT_0002\",\n      \"scheduleType\": \"relative\",\n      \"relativeTriggerName\": \"trigger-0001\",\n      \"relativeDuration\": 30000\n    },\n    {\n      \"name\": \"daily-0001\",\n      \"metadata\": \"EVENT_0003\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569369600000,\n      \"absoluteEnd\": 1569456000000,\n      \"repeatType\": \"daily\",\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"daily-0002\",\n      \"metadata\": \"EVENT_0004\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569369600000,\n      \"absoluteEnd\": 1569456000000,\n      \"repeatType\": \"daily\",\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 1\n    },\n    {\n      \"name\": \"weekly-0001\",\n      \"metadata\": \"EVENT_0005\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569888000000,\n      \"absoluteEnd\": 1570406400000,\n      \"repeatType\": \"weekly\",\n      \"repeatBeginDayOfWeek\": \"tuesday\",\n      \"repeatEndDayOfWeek\": \"wednesday\",\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"weekly-0002\",\n      \"metadata\": \"EVENT_0006\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1569888000000,\n      \"absoluteEnd\": 1570406400000,\n      \"repeatType\": \"weekly\",\n      \"repeatBeginDayOfWeek\": \"wednesday\",\n      \"repeatEndDayOfWeek\": \"tuesday\",\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 1\n    },\n    {\n      \"name\": \"monthly-0001\",\n      \"metadata\": \"EVENT_0007\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1570406400000,\n      \"absoluteEnd\": 1575158400000,\n      \"repeatType\": \"monthly\",\n      \"repeatBeginDayOfMonth\": 10,\n      \"repeatEndDayOfMonth\": 15,\n      \"repeatBeginHour\": 1,\n      \"repeatEndHour\": 2\n    },\n    {\n      \"name\": \"monthly-0002\",\n      \"metadata\": \"EVENT_0008\",\n      \"scheduleType\": \"absolute\",\n      \"absoluteBegin\": 1570406400000,\n      \"absoluteEnd\": 1575158400000,\n      \"repeatType\": \"monthly\",\n      \"repeatBeginDayOfMonth\": 16,\n      \"repeatEndDayOfMonth\": 9,\n      \"repeatBeginHour\": 3,\n      \"repeatEndHour\": 0\n    }\n  ]\n}")
    );
    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_current_event_master(
        schedule.UpdateCurrentEventMasterRequest()
            .with_namespace_name(self.hash1)
            .with_settings('{\n  "version": "2019-03-31",\n  "events": [\n    {\n      "name": "event-0001",\n      "metadata": "EVENT_0001",\n      "scheduleType": "absolute",\n      "absoluteBegin": 10000,\n      "absoluteEnd": 20000\n    },\n    {\n      "name": "event-0002",\n      "metadata": "EVENT_0002",\n      "scheduleType": "relative",\n      "relativeTriggerName": "trigger-0001",\n      "relativeDuration": 30000\n    },\n    {\n      "name": "daily-0001",\n      "metadata": "EVENT_0003",\n      "scheduleType": "absolute",\n      "absoluteBegin": 1569369600000,\n      "absoluteEnd": 1569456000000,\n      "repeatType": "daily",\n      "repeatBeginHour": 1,\n      "repeatEndHour": 2\n    },\n    {\n      "name": "daily-0002",\n      "metadata": "EVENT_0004",\n      "scheduleType": "absolute",\n      "absoluteBegin": 1569369600000,\n      "absoluteEnd": 1569456000000,\n      "repeatType": "daily",\n      "repeatBeginHour": 3,\n      "repeatEndHour": 1\n    },\n    {\n      "name": "weekly-0001",\n      "metadata": "EVENT_0005",\n      "scheduleType": "absolute",\n      "absoluteBegin": 1569888000000,\n      "absoluteEnd": 1570406400000,\n      "repeatType": "weekly",\n      "repeatBeginDayOfWeek": "tuesday",\n      "repeatEndDayOfWeek": "wednesday",\n      "repeatBeginHour": 1,\n      "repeatEndHour": 2\n    },\n    {\n      "name": "weekly-0002",\n      "metadata": "EVENT_0006",\n      "scheduleType": "absolute",\n      "absoluteBegin": 1569888000000,\n      "absoluteEnd": 1570406400000,\n      "repeatType": "weekly",\n      "repeatBeginDayOfWeek": "wednesday",\n      "repeatEndDayOfWeek": "tuesday",\n      "repeatBeginHour": 3,\n      "repeatEndHour": 1\n    },\n    {\n      "name": "monthly-0001",\n      "metadata": "EVENT_0007",\n      "scheduleType": "absolute",\n      "absoluteBegin": 1570406400000,\n      "absoluteEnd": 1575158400000,\n      "repeatType": "monthly",\n      "repeatBeginDayOfMonth": 10,\n      "repeatEndDayOfMonth": 15,\n      "repeatBeginHour": 1,\n      "repeatEndHour": 2\n    },\n    {\n      "name": "monthly-0002",\n      "metadata": "EVENT_0008",\n      "scheduleType": "absolute",\n      "absoluteBegin": 1570406400000,\n      "absoluteEnd": 1575158400000,\n      "repeatType": "monthly",\n      "repeatBeginDayOfMonth": 16,\n      "repeatEndDayOfMonth": 9,\n      "repeatBeginHour": 3,\n      "repeatEndHour": 0\n    }\n  ]\n}')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('schedule')

api_result = client.update_current_event_master({
    namespaceName='namespace1',
    settings='{\n  "version": "2019-03-31",\n  "events": [\n    {\n      "name": "event-0001",\n      "metadata": "EVENT_0001",\n      "scheduleType": "absolute",\n      "absoluteBegin": 10000,\n      "absoluteEnd": 20000\n    },\n    {\n      "name": "event-0002",\n      "metadata": "EVENT_0002",\n      "scheduleType": "relative",\n      "relativeTriggerName": "trigger-0001",\n      "relativeDuration": 30000\n    },\n    {\n      "name": "daily-0001",\n      "metadata": "EVENT_0003",\n      "scheduleType": "absolute",\n      "absoluteBegin": 1569369600000,\n      "absoluteEnd": 1569456000000,\n      "repeatType": "daily",\n      "repeatBeginHour": 1,\n      "repeatEndHour": 2\n    },\n    {\n      "name": "daily-0002",\n      "metadata": "EVENT_0004",\n      "scheduleType": "absolute",\n      "absoluteBegin": 1569369600000,\n      "absoluteEnd": 1569456000000,\n      "repeatType": "daily",\n      "repeatBeginHour": 3,\n      "repeatEndHour": 1\n    },\n    {\n      "name": "weekly-0001",\n      "metadata": "EVENT_0005",\n      "scheduleType": "absolute",\n      "absoluteBegin": 1569888000000,\n      "absoluteEnd": 1570406400000,\n      "repeatType": "weekly",\n      "repeatBeginDayOfWeek": "tuesday",\n      "repeatEndDayOfWeek": "wednesday",\n      "repeatBeginHour": 1,\n      "repeatEndHour": 2\n    },\n    {\n      "name": "weekly-0002",\n      "metadata": "EVENT_0006",\n      "scheduleType": "absolute",\n      "absoluteBegin": 1569888000000,\n      "absoluteEnd": 1570406400000,\n      "repeatType": "weekly",\n      "repeatBeginDayOfWeek": "wednesday",\n      "repeatEndDayOfWeek": "tuesday",\n      "repeatBeginHour": 3,\n      "repeatEndHour": 1\n    },\n    {\n      "name": "monthly-0001",\n      "metadata": "EVENT_0007",\n      "scheduleType": "absolute",\n      "absoluteBegin": 1570406400000,\n      "absoluteEnd": 1575158400000,\n      "repeatType": "monthly",\n      "repeatBeginDayOfMonth": 10,\n      "repeatEndDayOfMonth": 15,\n      "repeatBeginHour": 1,\n      "repeatEndHour": 2\n    },\n    {\n      "name": "monthly-0002",\n      "metadata": "EVENT_0008",\n      "scheduleType": "absolute",\n      "absoluteBegin": 1570406400000,\n      "absoluteEnd": 1575158400000,\n      "repeatType": "monthly",\n      "repeatBeginDayOfMonth": 16,\n      "repeatEndDayOfMonth": 9,\n      "repeatBeginHour": 3,\n      "repeatEndHour": 0\n    }\n  ]\n}',
})

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

result = api_result.result
item = result.item;

現在有効なイベントスケジュールマスターを更新

Request

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

Result

説明
item CurrentEventMaster 更新した現在有効なイベントスケジュールマスター

updateCurrentEventMasterFromGitHub

updateCurrentEventMasterFromGitHub

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.UpdateCurrentEventMasterFromGitHub(
    &schedule.UpdateCurrentEventMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace1"),
        CheckoutSetting: {'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'},
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\UpdateCurrentEventMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateCurrentEventMasterFromGitHub(
        (new UpdateCurrentEventMasterFromGitHubRequest())
            ->withNamespaceName(self::namespace1)
            ->withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.UpdateCurrentEventMasterFromGitHubRequest;
import io.gs2.schedule.result.UpdateCurrentEventMasterFromGitHubResult;

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

try {
    UpdateCurrentEventMasterFromGitHubResult result = client.updateCurrentEventMasterFromGitHub(
        new UpdateCurrentEventMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    CurrentEventMaster 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.UpdateCurrentEventMasterFromGitHubRequest;
using Gs2.Gs2Schedule.Result.UpdateCurrentEventMasterFromGitHubResult;

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.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateCurrentEventMasterFromGitHub(
    new UpdateCurrentEventMasterFromGitHubRequest()
        .withNamespaceName("namespace1")
        .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'}),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.updateCurrentEventMasterFromGitHub(
        new Gs2Schedule.UpdateCurrentEventMasterFromGitHubRequest()
            .withNamespaceName("namespace1")
            .withCheckoutSetting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    );
    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_current_event_master_from_git_hub(
        schedule.UpdateCurrentEventMasterFromGitHubRequest()
            .with_namespace_name(self.hash1)
            .with_checkout_setting({'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'})
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('schedule')

api_result = client.update_current_event_master_from_git_hub({
    namespaceName='namespace1',
    checkoutSetting={'apiKeyId': '$gitHubApiKey1.apiKeyId', 'repositoryName': 'gs2io/master-data', 'sourcePath': 'path/to/file.json', 'referenceType': 'branch', 'branchName': 'develop'},
})

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

result = api_result.result
item = result.item;

現在有効なイベントスケジュールマスターを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
checkoutSetting GitHubCheckoutSetting GitHubからマスターデータをチェックアウトしてくる設定

Result

説明
item CurrentEventMaster 更新した現在有効なイベントスケジュールマスター