API Reference of GS2-Schedule SDK
Model
Namespace
Namespace
Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.
Therefore, it is necessary to create a namespace before starting to use each service.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024 chars | Namespace GRN | ||
name | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
logSetting | LogSetting | Log output settings | ||||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
EventMaster
Event Master
There are two types of event durations: absolute and relative. Absolute periods are fixed periods, such as January 1, 2021 00:00(UTC) to January 7, 2021 23:59(UTC). A relative period is an event period that varies from one game player to another, such as 24 hours from the time the trigger is pulled.
The event can be set to repeat itself as well as the duration of the event. An event period can be set up so that only Monday from 10:00 to 11:00 is included in the event period.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
eventId | string | ✓ | ~ 1024 chars | Event Master GRN | ||
name | string | ✓ | ~ 128 chars | Event Type Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
scheduleType | enum { “absolute”, “relative” } | ✓ | ~ 128 chars | Type of Event Period | ||
absoluteBegin | long | Event start date and time (Unix time unit:milliseconds) | ||||
absoluteEnd | long | Event end date and time (Unix time unit:milliseconds) | ||||
relativeTriggerName | string | {scheduleType} == “relative” | ✓ | ~ 128 chars | Event Start Trigger Name | |
repeatSetting | RepeatSetting | ✓ | Repeat setting | |||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
Enumeration type definition to specify as scheduleType
Enumerator String Definition | Description |
---|---|
absolute | Fixed period |
relative | Period by Player |
Trigger
Trigger
A trigger is an entity that defines the starting point for the beginning of an event when realizing different event durations for different game players.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
triggerId | string | ✓ | ~ 1024 chars | Trigger Name | ||
name | string | ✓ | ~ 128 chars | Trigger Name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
expiresAt | long | ✓ | Trigger Expiration Date (Unix time unit:milliseconds) | |||
revision | long | 0 | ~ 9223372036854775805 | Revision |
Event
Event
Two types of event durations exist: absolute and relative. Absolute periods are fixed periods, such as January 1, 2021 00:00(UTC) to January 7, 2021 23:59(UTC). A relative period is an event period that varies from one game player to another, such as 24 hours from the time the trigger is pulled.
The event can be set to repeat itself as well as the duration of the event. An event period can be set up so that only Monday from 10:00 to 11:00 is included in the event period.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
eventId | string | ✓ | ~ 1024 chars | GS2-Schedule Event GRN | ||
name | string | ✓ | ~ 128 chars | Event Type Name | ||
metadata | string | ~ 2048 chars | metadata | |||
scheduleType | enum { “absolute”, “relative” } | ✓ | ~ 128 chars | Type of Event Period | ||
absoluteBegin | long | Event start date and time (Unix time unit:milliseconds) | ||||
absoluteEnd | long | Event end date and time (Unix time unit:milliseconds) | ||||
relativeTriggerName | string | {scheduleType} == “relative” | ✓ | ~ 128 chars | Event Start Trigger Name | |
repeatSetting | RepeatSetting | ✓ | Repeat setting |
Enumeration type definition to specify as scheduleType
Enumerator String Definition | Description |
---|---|
absolute | Fixed period |
relative | Period by Player |
RepeatSetting
Repeat Setting
There are two types of event durations: absolute and relative.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
repeatType | enum { “always”, “daily”, “weekly”, “monthly”, “custom” } | ✓ | “always” | ~ 128 chars | Type of repetition | |
beginDayOfMonth | int | {repeatType} == “monthly” | ✓ | 1 ~ 31 | Event repeat start date (If the value exceeds the days of the month, it is treated as the last day.) | |
endDayOfMonth | int | {repeatType} == “monthly” | ✓ | 1 ~ 31 | Event repeat end date (If the value exceeds the days of the month, it is treated as the last day.) | |
beginDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ✓ | ~ 128 chars | Repeat start day of event | |
endDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ✓ | ~ 128 chars | Repeat event end day of the week | |
beginHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ✓ | ~ 23 | Event repetition start time (in hours) | |
endHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ✓ | ~ 24 | Event repetition end time (in hours) | |
anchorTimestamp | long | {repeatType} == “custom” | ✓ | Anchor date to start the cycle (Unix time unit:milliseconds) | ||
activeDays | int | {repeatType} == “custom” | ✓ | 1 ~ 2147483646.0 | Number of active days in the cycle | |
inactiveDays | int | {repeatType} == “custom” | ✓ | 1 ~ 2147483646.0 | Number of inactive days in the cycle |
Enumeration type definition to specify as repeatType
Enumerator String Definition | Description |
---|---|
always | Event period Always |
daily | Every day during the event period from X:00 to X:00 |
weekly | Every X days of the week from X:00 to X:00 during the event period |
monthly | Xth day of each month during the event period from X:00 to X:00 |
custom | Starting from the reference date, active for X days and inactive for Y days during the event period |
Enumeration type definition to specify as beginDayOfWeek
Enumerator String Definition | Description |
---|---|
sunday | Sunday |
monday | Monday |
tuesday | Tuesday |
wednesday | Wednesday |
thursday | Thuesday |
friday | Friday |
saturday | Saturday |
Enumeration type definition to specify as endDayOfWeek
Enumerator String Definition | Description |
---|---|
sunday | Sunday |
monday | Monday |
tuesday | Tuesday |
wednesday | Wednesday |
thursday | Thuesday |
friday | Friday |
saturday | Saturday |
RepeatSchedule
State of repeating schedule
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
repeatCount | int | ✓ | ~ 2147483646 | Number of times to repeat | ||
currentRepeatStartAt | long | Start date and time of repeating event (Unix time unit:milliseconds) | ||||
currentRepeatEndAt | long | End date and time of repeating event (Unix time unit:milliseconds) | ||||
lastRepeatEndAt | long | End date and time of last event (Unix time unit:milliseconds) | ||||
nextRepeatStartAt | long | Start date and time of next event (Unix time unit:milliseconds) |
CurrentEventMaster
Currently available master data
GS2 uses JSON format files for master data management. By uploading the file, you can actually reflect the settings on the server.
We provide a master data editor on the management console as a way to create JSON files, but you can also create JSON files using the The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.
Note
Please refer to Master Data Reference of GS2-Schedule for the JSON file format.Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceId | string | ✓ | ~ 1024 chars | Currently available Event Master GRN | ||
settings | string | ✓ | ~ 5242880 chars | Master data |
GitHubCheckoutSetting
Setup to check out master data from GitHub
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
apiKeyId | string | ✓ | ~ 1024 chars | GitHub API key GRN | ||
repositoryName | string | ✓ | ~ 1024 chars | Repository Name | ||
sourcePath | string | ✓ | ~ 1024 chars | Source code file path | ||
referenceType | enum { “commit_hash”, “branch”, “tag” } | ✓ | ~ 128 chars | Source of code | ||
commitHash | string | {referenceType} == “commit_hash” | ✓ | ~ 1024 chars | Commit hash | |
branchName | string | {referenceType} == “branch” | ✓ | ~ 1024 chars | Branch Name | |
tagName | string | {referenceType} == “tag” | ✓ | ~ 1024 chars | Tag Name |
Enumeration type definition to specify as referenceType
Enumerator String Definition | Description |
---|---|
commit_hash | Commit hash |
branch | Branch |
tag | Tag |
LogSetting
Log setting
This type manages log output settings. This type holds the identifier of the log namespace used to output log data. The log namespace ID specifies the GS2-Log namespace to aggregate and store the log data. Through this setting, API request and response log data under this namespace will be output to the target GS2-Log. GS2-Log provides logs in real time, which can be used for system monitoring, analysis, debugging, etc.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
loggingNamespaceId | string | ✓ | ~ 1024 chars | Namespace GRN |
Methods
describeNamespaces
Get list of namespaces
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<Namespace> | List of Namespace |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&schedule.DescribeNamespacesRequest {
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DescribeNamespacesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeNamespaces(
(new DescribeNamespacesRequest())
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DescribeNamespacesRequest;
import io.gs2.schedule.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
DescribeNamespacesResult result = client.describeNamespaces(
new DescribeNamespacesRequest()
.withPageToken(null)
.withLimit(null)
);
List<Namespace> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DescribeNamespacesRequest;
using Gs2.Gs2Schedule.Result.DescribeNamespacesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Schedule.Request.DescribeNamespacesRequest()
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2Schedule.DescribeNamespacesRequest()
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.describe_namespaces(
schedule.DescribeNamespacesRequest()
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.describe_namespaces({
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('schedule')
api_result_handler = client.describe_namespaces_async({
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createNamespace
Create a new namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
logSetting | LogSetting | Log output settings |
Result
Type | Description | |
---|---|---|
item | Namespace | Namespace created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.CreateNamespace(
&schedule.CreateNamespaceRequest {
Name: pointy.String("namespace1"),
Description: nil,
LogSetting: &schedule.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\CreateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createNamespace(
(new CreateNamespaceRequest())
->withName(self::namespace1)
->withDescription(null)
->withLogSetting((new \Gs2\Schedule\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.CreateNamespaceRequest;
import io.gs2.schedule.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withLogSetting(new io.gs2.schedule.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.CreateNamespaceRequest;
using Gs2.Gs2Schedule.Result.CreateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Schedule.Request.CreateNamespaceRequest()
.WithName("namespace1")
.WithDescription(null)
.WithLogSetting(new Gs2.Gs2Schedule.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.createNamespace(
new Gs2Schedule.CreateNamespaceRequest()
.withName("namespace1")
.withDescription(null)
.withLogSetting(new Gs2Schedule.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.create_namespace(
schedule.CreateNamespaceRequest()
.with_name(self.hash1)
.with_description(None)
.with_log_setting(
schedule.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.create_namespace({
name="namespace1",
description=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.create_namespace_async({
name="namespace1",
description=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getNamespaceStatus
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
status | string |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.GetNamespaceStatus(
&schedule.GetNamespaceStatusRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\GetNamespaceStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getNamespaceStatus(
(new GetNamespaceStatusRequest())
->withNamespaceName(self::namespace1)
);
$status = $result->getStatus();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.GetNamespaceStatusRequest;
import io.gs2.schedule.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
GetNamespaceStatusResult result = client.getNamespaceStatus(
new GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
String status = result.getStatus();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Schedule.Result.GetNamespaceStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Schedule.Request.GetNamespaceStatusRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2Schedule.GetNamespaceStatusRequest()
.withNamespaceName("namespace1")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.get_namespace_status(
schedule.GetNamespaceStatusRequest()
.with_namespace_name(self.hash1)
)
status = result.status
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.get_namespace_status({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
client = gs2('schedule')
api_result_handler = client.get_namespace_status_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
getNamespace
Get namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | Namespace | Namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.GetNamespace(
&schedule.GetNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\GetNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getNamespace(
(new GetNamespaceRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.GetNamespaceRequest;
import io.gs2.schedule.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
GetNamespaceResult result = client.getNamespace(
new GetNamespaceRequest()
.withNamespaceName("namespace1")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.GetNamespaceRequest;
using Gs2.Gs2Schedule.Result.GetNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Schedule.Request.GetNamespaceRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.getNamespace(
new Gs2Schedule.GetNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.get_namespace(
schedule.GetNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.get_namespace({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.get_namespace_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateNamespace
Update namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
description | string | ~ 1024 chars | Description | |||
logSetting | LogSetting | Log output settings |
Result
Type | Description | |
---|---|---|
item | Namespace | Updated namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.UpdateNamespace(
&schedule.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
Description: pointy.String("description1"),
LogSetting: &schedule.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\UpdateNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateNamespace(
(new UpdateNamespaceRequest())
->withNamespaceName(self::namespace1)
->withDescription("description1")
->withLogSetting((new \Gs2\Schedule\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.UpdateNamespaceRequest;
import io.gs2.schedule.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withLogSetting(new io.gs2.schedule.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.UpdateNamespaceRequest;
using Gs2.Gs2Schedule.Result.UpdateNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Schedule.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace1")
.WithDescription("description1")
.WithLogSetting(new Gs2.Gs2Schedule.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001")),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2Schedule.UpdateNamespaceRequest()
.withNamespaceName("namespace1")
.withDescription("description1")
.withLogSetting(new Gs2Schedule.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.update_namespace(
schedule.UpdateNamespaceRequest()
.with_namespace_name(self.hash1)
.with_description('description1')
.with_log_setting(
schedule.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.update_namespace({
namespaceName="namespace1",
description="description1",
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.update_namespace_async({
namespaceName="namespace1",
description="description1",
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteNamespace
Delete namespace
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | Namespace | Deleted namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.DeleteNamespace(
&schedule.DeleteNamespaceRequest {
NamespaceName: pointy.String("namespace1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DeleteNamespaceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteNamespace(
(new DeleteNamespaceRequest())
->withNamespaceName(self::namespace1)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DeleteNamespaceRequest;
import io.gs2.schedule.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
DeleteNamespaceResult result = client.deleteNamespace(
new DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DeleteNamespaceRequest;
using Gs2.Gs2Schedule.Result.DeleteNamespaceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Schedule.Request.DeleteNamespaceRequest()
.WithNamespaceName("namespace1"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2Schedule.DeleteNamespaceRequest()
.withNamespaceName("namespace1")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.delete_namespace(
schedule.DeleteNamespaceRequest()
.with_namespace_name(self.hash1)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.delete_namespace({
namespaceName="namespace1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.delete_namespace_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
dumpUserDataByUserId
Get dump data of the data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.DumpUserDataByUserId(
&schedule.DumpUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DumpUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->dumpUserDataByUserId(
(new DumpUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DumpUserDataByUserIdRequest;
import io.gs2.schedule.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
new DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Schedule.Result.DumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2Schedule.Request.DumpUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.dumpUserDataByUserId(
new Gs2Schedule.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.dump_user_data_by_user_id(
schedule.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('schedule')
api_result_handler = client.dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
checkDumpUserDataByUserId
Check if the dump of the data associated with the specified user ID is complete
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
url | string | URL of output data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
&schedule.CheckDumpUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\CheckDumpUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->checkDumpUserDataByUserId(
(new CheckDumpUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$url = $result->getUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.schedule.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
CheckDumpUserDataByUserIdResult result = client.checkDumpUserDataByUserId(
new CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
String url = result.getUrl();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Schedule.Result.CheckDumpUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2Schedule.Request.CheckDumpUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.checkDumpUserDataByUserId(
new Gs2Schedule.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.check_dump_user_data_by_user_id(
schedule.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.check_dump_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
client = gs2('schedule')
api_result_handler = client.check_dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
cleanUserDataByUserId
Get clean data of the data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.CleanUserDataByUserId(
&schedule.CleanUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\CleanUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->cleanUserDataByUserId(
(new CleanUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.CleanUserDataByUserIdRequest;
import io.gs2.schedule.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
new CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Schedule.Result.CleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2Schedule.Request.CleanUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.cleanUserDataByUserId(
new Gs2Schedule.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.clean_user_data_by_user_id(
schedule.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.clean_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('schedule')
api_result_handler = client.clean_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
checkCleanUserDataByUserId
Check if the clean of the data associated with the specified user ID is complete
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
&schedule.CheckCleanUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\CheckCleanUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->checkCleanUserDataByUserId(
(new CheckCleanUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.schedule.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
new CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Schedule.Result.CheckCleanUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2Schedule.Request.CheckCleanUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.checkCleanUserDataByUserId(
new Gs2Schedule.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.check_clean_user_data_by_user_id(
schedule.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.check_clean_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('schedule')
api_result_handler = client.check_clean_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
prepareImportUserDataByUserId
Start importing data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
uploadToken | string | Token used to reflect results after upload |
uploadUrl | string | URL used to upload user data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
&schedule.PrepareImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\PrepareImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->prepareImportUserDataByUserId(
(new PrepareImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withTimeOffsetToken(null)
);
$uploadToken = $result->getUploadToken();
$uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.schedule.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
PrepareImportUserDataByUserIdResult result = client.prepareImportUserDataByUserId(
new PrepareImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
String uploadToken = result.getUploadToken();
String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Schedule.Result.PrepareImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2Schedule.Request.PrepareImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.prepareImportUserDataByUserId(
new Gs2Schedule.PrepareImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const uploadToken = result.getUploadToken();
const uploadUrl = result.getUploadUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.prepare_import_user_data_by_user_id(
schedule.PrepareImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
upload_token = result.upload_token
upload_url = result.upload_url
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.prepare_import_user_data_by_user_id({
userId="user-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('schedule')
api_result_handler = client.prepare_import_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
importUserDataByUserId
Start importing data associated with the specified user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
uploadToken | string | ✓ | ~ 1024 chars | Token received in preparation for upload | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.ImportUserDataByUserId(
&schedule.ImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
UploadToken: pointy.String("upload-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\ImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->importUserDataByUserId(
(new ImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withUploadToken("upload-0001")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.ImportUserDataByUserIdRequest;
import io.gs2.schedule.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
ImportUserDataByUserIdResult result = client.importUserDataByUserId(
new ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Schedule.Result.ImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2Schedule.Request.ImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithUploadToken("upload-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.importUserDataByUserId(
new Gs2Schedule.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.import_user_data_by_user_id(
schedule.ImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_upload_token('upload-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('schedule')
api_result_handler = client.import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
checkImportUserDataByUserId
Check if the import of the data associated with the specified user ID is complete
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
userId | string | ✓ | ~ 128 chars | User Id | ||
uploadToken | string | ✓ | ~ 1024 chars | Token received in preparation for upload | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
url | string | URL of log data |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
&schedule.CheckImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
UploadToken: pointy.String("upload-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\CheckImportUserDataByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->checkImportUserDataByUserId(
(new CheckImportUserDataByUserIdRequest())
->withUserId("user-0001")
->withUploadToken("upload-0001")
->withTimeOffsetToken(null)
);
$url = $result->getUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.CheckImportUserDataByUserIdRequest;
import io.gs2.schedule.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
CheckImportUserDataByUserIdResult result = client.checkImportUserDataByUserId(
new CheckImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
String url = result.getUrl();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Schedule.Result.CheckImportUserDataByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2Schedule.Request.CheckImportUserDataByUserIdRequest()
.WithUserId("user-0001")
.WithUploadToken("upload-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var url = result.Url;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.checkImportUserDataByUserId(
new Gs2Schedule.CheckImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.check_import_user_data_by_user_id(
schedule.CheckImportUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_upload_token('upload-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.check_import_user_data_by_user_id({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
client = gs2('schedule')
api_result_handler = client.check_import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
url = result.url;
describeEventMasters
Get list of event masters
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<EventMaster> | List of Event masters |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.DescribeEventMasters(
&schedule.DescribeEventMastersRequest {
NamespaceName: pointy.String("namespace1"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DescribeEventMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeEventMasters(
(new DescribeEventMastersRequest())
->withNamespaceName(self::namespace1)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DescribeEventMastersRequest;
import io.gs2.schedule.result.DescribeEventMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
DescribeEventMastersResult result = client.describeEventMasters(
new DescribeEventMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
List<EventMaster> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DescribeEventMastersRequest;
using Gs2.Gs2Schedule.Result.DescribeEventMastersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DescribeEventMastersResult> asyncResult = null;
yield return client.DescribeEventMasters(
new Gs2.Gs2Schedule.Request.DescribeEventMastersRequest()
.WithNamespaceName("namespace1")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.describeEventMasters(
new Gs2Schedule.DescribeEventMastersRequest()
.withNamespaceName("namespace1")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.describe_event_masters(
schedule.DescribeEventMastersRequest()
.with_namespace_name(self.hash1)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.describe_event_masters({
namespaceName="namespace1",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('schedule')
api_result_handler = client.describe_event_masters_async({
namespaceName="namespace1",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createEventMaster
Create a new event master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
name | string | ✓ | ~ 128 chars | Event Type Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
scheduleType | enum { “absolute”, “relative” } | ✓ | ~ 128 chars | Type of Event Period | ||
absoluteBegin | long | Event start date and time (Unix time unit:milliseconds) | ||||
absoluteEnd | long | Event end date and time (Unix time unit:milliseconds) | ||||
repeatType | enum { “always”, “daily”, “weekly”, “monthly” } | ✓ | “always” | ~ 128 chars | Type of repetition | |
repeatBeginDayOfMonth | int | {repeatType} == “monthly” | ✓ | 1 ~ 31 | Event repeat start date (If the value exceeds the days of the month, it is treated as the last day.) | |
repeatEndDayOfMonth | int | {repeatType} == “monthly” | ✓ | 1 ~ 31 | Event repeat end date (If the value exceeds the days of the month, it is treated as the last day.) | |
repeatBeginDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ✓ | ~ 128 chars | Repeat start day of event | |
repeatEndDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ✓ | ~ 128 chars | Repeat event end day of the week | |
repeatBeginHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ✓ | ~ 23 | Event repetition start time (in hours) | |
repeatEndHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ✓ | ~ 24 | Event repetition end time (in hours) | |
relativeTriggerName | string | {scheduleType} == “relative” | ✓ | ~ 128 chars | Event Start Trigger Name | |
repeatSetting | RepeatSetting | ✓ | Repeat setting |
Enumeration type definition to specify as scheduleType
Enumerator String Definition | Description |
---|---|
absolute | Fixed period |
relative | Period by Player |
Enumeration type definition to specify as repeatType
Enumerator String Definition | Description |
---|---|
always | Event period Always |
daily | Every day during the event period from X:00 to X:00 |
weekly | Every X days of the week from X:00 to X:00 during the event period |
monthly | Xth day of each month during the event period from X:00 to X:00 |
Enumeration type definition to specify as repeatBeginDayOfWeek
Enumerator String Definition | Description |
---|---|
sunday | Sunday |
monday | Monday |
tuesday | Tuesday |
wednesday | Wednesday |
thursday | Thuesday |
friday | Friday |
saturday | Saturday |
Enumeration type definition to specify as repeatEndDayOfWeek
Enumerator String Definition | Description |
---|---|
sunday | Sunday |
monday | Monday |
tuesday | Tuesday |
wednesday | Wednesday |
thursday | Thuesday |
friday | Friday |
saturday | Saturday |
Result
Type | Description | |
---|---|---|
item | EventMaster | Created Event Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.CreateEventMaster(
&schedule.CreateEventMasterRequest {
NamespaceName: pointy.String("namespace1"),
Name: pointy.String("event-0001"),
Description: nil,
Metadata: nil,
ScheduleType: pointy.String("absolute"),
AbsoluteBegin: pointy.Int64(10000),
AbsoluteEnd: pointy.Int64(20000),
RelativeTriggerName: pointy.String("trigger-0001"),
RepeatSetting: &schedule.RepeatSetting{
BeginDayOfMonth: pointy.Int32(1),
EndDayOfMonth: pointy.Int32(2),
BeginDayOfWeek: pointy.String("monday"),
EndDayOfWeek: pointy.String("sunday"),
BeginHour: pointy.Int32(5),
EndHour: pointy.Int32(6),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\CreateEventMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createEventMaster(
(new CreateEventMasterRequest())
->withNamespaceName(self::namespace1)
->withName("event-0001")
->withDescription(null)
->withMetadata(null)
->withScheduleType("absolute")
->withAbsoluteBegin(10000)
->withAbsoluteEnd(20000)
->withRelativeTriggerName("trigger-0001")
->withRepeatSetting((new \Gs2\Schedule\Model\RepeatSetting())
->withBeginDayOfMonth(1)
->withEndDayOfMonth(2)
->withBeginDayOfWeek("monday")
->withEndDayOfWeek("sunday")
->withBeginHour(5)
->withEndHour(6))
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.CreateEventMasterRequest;
import io.gs2.schedule.result.CreateEventMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
CreateEventMasterResult result = client.createEventMaster(
new CreateEventMasterRequest()
.withNamespaceName("namespace1")
.withName("event-0001")
.withDescription(null)
.withMetadata(null)
.withScheduleType("absolute")
.withAbsoluteBegin(10000L)
.withAbsoluteEnd(20000L)
.withRelativeTriggerName("trigger-0001")
.withRepeatSetting(new io.gs2.schedule.model.RepeatSetting()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(2)
.withBeginDayOfWeek("monday")
.withEndDayOfWeek("sunday")
.withBeginHour(5)
.withEndHour(6))
);
EventMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.CreateEventMasterRequest;
using Gs2.Gs2Schedule.Result.CreateEventMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.CreateEventMasterResult> asyncResult = null;
yield return client.CreateEventMaster(
new Gs2.Gs2Schedule.Request.CreateEventMasterRequest()
.WithNamespaceName("namespace1")
.WithName("event-0001")
.WithDescription(null)
.WithMetadata(null)
.WithScheduleType("absolute")
.WithAbsoluteBegin(10000L)
.WithAbsoluteEnd(20000L)
.WithRelativeTriggerName("trigger-0001")
.WithRepeatSetting(new Gs2.Gs2Schedule.Model.RepeatSetting()
.WithBeginDayOfMonth(1)
.WithEndDayOfMonth(2)
.WithBeginDayOfWeek("monday")
.WithEndDayOfWeek("sunday")
.WithBeginHour(5)
.WithEndHour(6)),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.createEventMaster(
new Gs2Schedule.CreateEventMasterRequest()
.withNamespaceName("namespace1")
.withName("event-0001")
.withDescription(null)
.withMetadata(null)
.withScheduleType("absolute")
.withAbsoluteBegin(10000)
.withAbsoluteEnd(20000)
.withRelativeTriggerName("trigger-0001")
.withRepeatSetting(new Gs2Schedule.model.RepeatSetting()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(2)
.withBeginDayOfWeek("monday")
.withEndDayOfWeek("sunday")
.withBeginHour(5)
.withEndHour(6))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.create_event_master(
schedule.CreateEventMasterRequest()
.with_namespace_name(self.hash1)
.with_name('event-0001')
.with_description(None)
.with_metadata(None)
.with_schedule_type('absolute')
.with_absolute_begin(10000)
.with_absolute_end(20000)
.with_relative_trigger_name('trigger-0001')
.with_repeat_setting(
schedule.RepeatSetting()
.with_begin_day_of_month(1)
.with_end_day_of_month(2)
.with_begin_day_of_week('monday')
.with_end_day_of_week('sunday')
.with_begin_hour(5)
.with_end_hour(6))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.create_event_master({
namespaceName="namespace1",
name="event-0001",
description=nil,
metadata=nil,
scheduleType="absolute",
absoluteBegin=10000,
absoluteEnd=20000,
relativeTriggerName="trigger-0001",
repeatSetting={
beginDayOfMonth=1,
endDayOfMonth=2,
beginDayOfWeek="monday",
endDayOfWeek="sunday",
beginHour=5,
endHour=6,
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.create_event_master_async({
namespaceName="namespace1",
name="event-0001",
description=nil,
metadata=nil,
scheduleType="absolute",
absoluteBegin=10000,
absoluteEnd=20000,
relativeTriggerName="trigger-0001",
repeatSetting={
beginDayOfMonth=1,
endDayOfMonth=2,
beginDayOfWeek="monday",
endDayOfWeek="sunday",
beginHour=5,
endHour=6,
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getEventMaster
Get Event Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
eventName | string | ✓ | ~ 128 chars | Event Type Name |
Result
Type | Description | |
---|---|---|
item | EventMaster | Event master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.GetEventMaster(
&schedule.GetEventMasterRequest {
NamespaceName: pointy.String("namespace1"),
EventName: pointy.String("event-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\GetEventMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getEventMaster(
(new GetEventMasterRequest())
->withNamespaceName(self::namespace1)
->withEventName("event-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.GetEventMasterRequest;
import io.gs2.schedule.result.GetEventMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
GetEventMasterResult result = client.getEventMaster(
new GetEventMasterRequest()
.withNamespaceName("namespace1")
.withEventName("event-0001")
);
EventMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.GetEventMasterRequest;
using Gs2.Gs2Schedule.Result.GetEventMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.GetEventMasterResult> asyncResult = null;
yield return client.GetEventMaster(
new Gs2.Gs2Schedule.Request.GetEventMasterRequest()
.WithNamespaceName("namespace1")
.WithEventName("event-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.getEventMaster(
new Gs2Schedule.GetEventMasterRequest()
.withNamespaceName("namespace1")
.withEventName("event-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.get_event_master(
schedule.GetEventMasterRequest()
.with_namespace_name(self.hash1)
.with_event_name('event-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.get_event_master({
namespaceName="namespace1",
eventName="event-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.get_event_master_async({
namespaceName="namespace1",
eventName="event-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateEventMaster
Update Event Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
eventName | string | ✓ | ~ 128 chars | Event Type Name | ||
description | string | ~ 1024 chars | Description | |||
metadata | string | ~ 2048 chars | metadata | |||
scheduleType | enum { “absolute”, “relative” } | ✓ | ~ 128 chars | Type of Event Period | ||
absoluteBegin | long | Event start date and time (Unix time unit:milliseconds) | ||||
absoluteEnd | long | Event end date and time (Unix time unit:milliseconds) | ||||
repeatType | enum { “always”, “daily”, “weekly”, “monthly” } | ✓ | “always” | ~ 128 chars | Type of repetition | |
repeatBeginDayOfMonth | int | {repeatType} == “monthly” | ✓ | 1 ~ 31 | Event repeat start date (If the value exceeds the days of the month, it is treated as the last day.) | |
repeatEndDayOfMonth | int | {repeatType} == “monthly” | ✓ | 1 ~ 31 | Event repeat end date (If the value exceeds the days of the month, it is treated as the last day.) | |
repeatBeginDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ✓ | ~ 128 chars | Repeat start day of event | |
repeatEndDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ✓ | ~ 128 chars | Repeat event end day of the week | |
repeatBeginHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ✓ | ~ 23 | Event repetition start time (in hours) | |
repeatEndHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ✓ | ~ 24 | Event repetition end time (in hours) | |
relativeTriggerName | string | {scheduleType} == “relative” | ✓ | ~ 128 chars | Event Start Trigger Name | |
repeatSetting | RepeatSetting | ✓ | Repeat setting |
Enumeration type definition to specify as scheduleType
Enumerator String Definition | Description |
---|---|
absolute | Fixed period |
relative | Period by Player |
Enumeration type definition to specify as repeatType
Enumerator String Definition | Description |
---|---|
always | Event period Always |
daily | Every day during the event period from X:00 to X:00 |
weekly | Every X days of the week from X:00 to X:00 during the event period |
monthly | Xth day of each month during the event period from X:00 to X:00 |
Enumeration type definition to specify as repeatBeginDayOfWeek
Enumerator String Definition | Description |
---|---|
sunday | Sunday |
monday | Monday |
tuesday | Tuesday |
wednesday | Wednesday |
thursday | Thuesday |
friday | Friday |
saturday | Saturday |
Enumeration type definition to specify as repeatEndDayOfWeek
Enumerator String Definition | Description |
---|---|
sunday | Sunday |
monday | Monday |
tuesday | Tuesday |
wednesday | Wednesday |
thursday | Thuesday |
friday | Friday |
saturday | Saturday |
Result
Type | Description | |
---|---|---|
item | EventMaster | Updated Event Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.UpdateEventMaster(
&schedule.UpdateEventMasterRequest {
NamespaceName: pointy.String("namespace1"),
EventName: pointy.String("event-0001"),
Description: pointy.String("description1"),
Metadata: pointy.String("{\"hoge\": \"fuga\"}"),
ScheduleType: pointy.String("absolute"),
AbsoluteBegin: pointy.Int64(20000),
AbsoluteEnd: pointy.Int64(30000),
RelativeTriggerName: pointy.String("trigger-0001"),
RepeatSetting: &schedule.RepeatSetting{
BeginDayOfMonth: pointy.Int32(1),
EndDayOfMonth: pointy.Int32(2),
BeginDayOfWeek: pointy.String("monday"),
EndDayOfWeek: pointy.String("sunday"),
BeginHour: pointy.Int32(5),
EndHour: pointy.Int32(6),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\UpdateEventMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateEventMaster(
(new UpdateEventMasterRequest())
->withNamespaceName(self::namespace1)
->withEventName("event-0001")
->withDescription("description1")
->withMetadata("{\"hoge\": \"fuga\"}")
->withScheduleType("absolute")
->withAbsoluteBegin(20000)
->withAbsoluteEnd(30000)
->withRelativeTriggerName("trigger-0001")
->withRepeatSetting((new \Gs2\Schedule\Model\RepeatSetting())
->withBeginDayOfMonth(1)
->withEndDayOfMonth(2)
->withBeginDayOfWeek("monday")
->withEndDayOfWeek("sunday")
->withBeginHour(5)
->withEndHour(6))
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.UpdateEventMasterRequest;
import io.gs2.schedule.result.UpdateEventMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
UpdateEventMasterResult result = client.updateEventMaster(
new UpdateEventMasterRequest()
.withNamespaceName("namespace1")
.withEventName("event-0001")
.withDescription("description1")
.withMetadata("{\"hoge\": \"fuga\"}")
.withScheduleType("absolute")
.withAbsoluteBegin(20000L)
.withAbsoluteEnd(30000L)
.withRelativeTriggerName("trigger-0001")
.withRepeatSetting(new io.gs2.schedule.model.RepeatSetting()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(2)
.withBeginDayOfWeek("monday")
.withEndDayOfWeek("sunday")
.withBeginHour(5)
.withEndHour(6))
);
EventMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.UpdateEventMasterRequest;
using Gs2.Gs2Schedule.Result.UpdateEventMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.UpdateEventMasterResult> asyncResult = null;
yield return client.UpdateEventMaster(
new Gs2.Gs2Schedule.Request.UpdateEventMasterRequest()
.WithNamespaceName("namespace1")
.WithEventName("event-0001")
.WithDescription("description1")
.WithMetadata("{\"hoge\": \"fuga\"}")
.WithScheduleType("absolute")
.WithAbsoluteBegin(20000L)
.WithAbsoluteEnd(30000L)
.WithRelativeTriggerName("trigger-0001")
.WithRepeatSetting(new Gs2.Gs2Schedule.Model.RepeatSetting()
.WithBeginDayOfMonth(1)
.WithEndDayOfMonth(2)
.WithBeginDayOfWeek("monday")
.WithEndDayOfWeek("sunday")
.WithBeginHour(5)
.WithEndHour(6)),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.updateEventMaster(
new Gs2Schedule.UpdateEventMasterRequest()
.withNamespaceName("namespace1")
.withEventName("event-0001")
.withDescription("description1")
.withMetadata("{\"hoge\": \"fuga\"}")
.withScheduleType("absolute")
.withAbsoluteBegin(20000)
.withAbsoluteEnd(30000)
.withRelativeTriggerName("trigger-0001")
.withRepeatSetting(new Gs2Schedule.model.RepeatSetting()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(2)
.withBeginDayOfWeek("monday")
.withEndDayOfWeek("sunday")
.withBeginHour(5)
.withEndHour(6))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.update_event_master(
schedule.UpdateEventMasterRequest()
.with_namespace_name(self.hash1)
.with_event_name('event-0001')
.with_description('description1')
.with_metadata('{"hoge": "fuga"}')
.with_schedule_type('absolute')
.with_absolute_begin(20000)
.with_absolute_end(30000)
.with_relative_trigger_name('trigger-0001')
.with_repeat_setting(
schedule.RepeatSetting()
.with_begin_day_of_month(1)
.with_end_day_of_month(2)
.with_begin_day_of_week('monday')
.with_end_day_of_week('sunday')
.with_begin_hour(5)
.with_end_hour(6))
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.update_event_master({
namespaceName="namespace1",
eventName="event-0001",
description="description1",
metadata="{\"hoge\": \"fuga\"}",
scheduleType="absolute",
absoluteBegin=20000,
absoluteEnd=30000,
relativeTriggerName="trigger-0001",
repeatSetting={
beginDayOfMonth=1,
endDayOfMonth=2,
beginDayOfWeek="monday",
endDayOfWeek="sunday",
beginHour=5,
endHour=6,
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.update_event_master_async({
namespaceName="namespace1",
eventName="event-0001",
description="description1",
metadata="{\"hoge\": \"fuga\"}",
scheduleType="absolute",
absoluteBegin=20000,
absoluteEnd=30000,
relativeTriggerName="trigger-0001",
repeatSetting={
beginDayOfMonth=1,
endDayOfMonth=2,
beginDayOfWeek="monday",
endDayOfWeek="sunday",
beginHour=5,
endHour=6,
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteEventMaster
Delete Event Master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
eventName | string | ✓ | ~ 128 chars | Event Type Name |
Result
Type | Description | |
---|---|---|
item | EventMaster | Deleted Event Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.DeleteEventMaster(
&schedule.DeleteEventMasterRequest {
NamespaceName: pointy.String("namespace1"),
EventName: pointy.String("event-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DeleteEventMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteEventMaster(
(new DeleteEventMasterRequest())
->withNamespaceName(self::namespace1)
->withEventName("event-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DeleteEventMasterRequest;
import io.gs2.schedule.result.DeleteEventMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
DeleteEventMasterResult result = client.deleteEventMaster(
new DeleteEventMasterRequest()
.withNamespaceName("namespace1")
.withEventName("event-0001")
);
EventMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DeleteEventMasterRequest;
using Gs2.Gs2Schedule.Result.DeleteEventMasterResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DeleteEventMasterResult> asyncResult = null;
yield return client.DeleteEventMaster(
new Gs2.Gs2Schedule.Request.DeleteEventMasterRequest()
.WithNamespaceName("namespace1")
.WithEventName("event-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.deleteEventMaster(
new Gs2Schedule.DeleteEventMasterRequest()
.withNamespaceName("namespace1")
.withEventName("event-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.delete_event_master(
schedule.DeleteEventMasterRequest()
.with_namespace_name(self.hash1)
.with_event_name('event-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.delete_event_master({
namespaceName="namespace1",
eventName="event-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.delete_event_master_async({
namespaceName="namespace1",
eventName="event-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
describeTriggers
Get list of triggers
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<Trigger> | List of Triggers |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.DescribeTriggers(
&schedule.DescribeTriggersRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("accessToken-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DescribeTriggersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeTriggers(
(new DescribeTriggersRequest())
->withNamespaceName(self::namespace1)
->withAccessToken(self::$accessToken0001)
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DescribeTriggersRequest;
import io.gs2.schedule.result.DescribeTriggersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
DescribeTriggersResult result = client.describeTriggers(
new DescribeTriggersRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
List<Trigger> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DescribeTriggersRequest;
using Gs2.Gs2Schedule.Result.DescribeTriggersResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DescribeTriggersResult> asyncResult = null;
yield return client.DescribeTriggers(
new Gs2.Gs2Schedule.Request.DescribeTriggersRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("accessToken-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.describeTriggers(
new Gs2Schedule.DescribeTriggersRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.describe_triggers(
schedule.DescribeTriggersRequest()
.with_namespace_name(self.hash1)
.with_access_token(self.access_token_0001)
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.describe_triggers({
namespaceName="namespace1",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('schedule')
api_result_handler = client.describe_triggers_async({
namespaceName="namespace1",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
describeTriggersByUserId
Get list of triggers by user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired | |
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
items | List<Trigger> | List of Triggers |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.DescribeTriggersByUserId(
&schedule.DescribeTriggersByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DescribeTriggersByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeTriggersByUserId(
(new DescribeTriggersByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withPageToken(null)
->withLimit(null)
->withTimeOffsetToken(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DescribeTriggersByUserIdRequest;
import io.gs2.schedule.result.DescribeTriggersByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
DescribeTriggersByUserIdResult result = client.describeTriggersByUserId(
new DescribeTriggersByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<Trigger> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DescribeTriggersByUserIdRequest;
using Gs2.Gs2Schedule.Result.DescribeTriggersByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DescribeTriggersByUserIdResult> asyncResult = null;
yield return client.DescribeTriggersByUserId(
new Gs2.Gs2Schedule.Request.DescribeTriggersByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithPageToken(null)
.WithLimit(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.describeTriggersByUserId(
new Gs2Schedule.DescribeTriggersByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.describe_triggers_by_user_id(
schedule.DescribeTriggersByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_page_token(None)
.with_limit(None)
.with_time_offset_token(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.describe_triggers_by_user_id({
namespaceName="namespace1",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('schedule')
api_result_handler = client.describe_triggers_by_user_id_async({
namespaceName="namespace1",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
getTrigger
Get Trigger
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
triggerName | string | ✓ | ~ 128 chars | Trigger Name |
Result
Type | Description | |
---|---|---|
item | Trigger | Trigger |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/schedule"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := schedule.Gs2ScheduleRestClient{
Session: &session,
}
result, err := client.GetTrigger(
&schedule.GetTriggerRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("accessToken-0001"),
TriggerName: pointy.String("trigger1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\GetTriggerRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getTrigger(
(new GetTriggerRequest())
->withNamespaceName(self::namespace1)
->withAccessToken(self::$accessToken0001)
->withTriggerName("trigger1")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.GetTriggerRequest;
import io.gs2.schedule.result.GetTriggerResult;
Gs2RestSession session = new Gs2RestSession(
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("accessToken-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.Gs2Schedule.Result.GetTriggerResult> asyncResult = null;
yield return client.GetTrigger(
new Gs2.Gs2Schedule.Request.GetTriggerRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("accessToken-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("accessToken-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="accessToken-0001",
triggerName="trigger1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.get_trigger_async({
namespaceName="namespace1",
accessToken="accessToken-0001",
triggerName="trigger1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getTriggerByUserId
Get trigger by specifying user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
triggerName | string | ✓ | ~ 128 chars | Trigger Name | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | Trigger | Trigger |
Implementation Example
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"),
TimeOffsetToken: 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\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")
->withTimeOffsetToken(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.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")
.withTimeOffsetToken(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.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.Gs2Schedule.Result.GetTriggerByUserIdResult> asyncResult = null;
yield return client.GetTriggerByUserId(
new Gs2.Gs2Schedule.Request.GetTriggerByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithTriggerName("trigger1")
.WithTimeOffsetToken(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.getTriggerByUserId(
new Gs2Schedule.GetTriggerByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withTriggerName("trigger1")
.withTimeOffsetToken(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.get_trigger_by_user_id(
schedule.GetTriggerByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_trigger_name('trigger1')
.with_time_offset_token(None)
)
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",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.get_trigger_by_user_id_async({
namespaceName="namespace1",
userId="user-0001",
triggerName="trigger1",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
triggerByUserId
Trigger by specifying a user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
triggerName | string | ✓ | ~ 128 chars | Trigger Name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
triggerStrategy | enum { “renew”, “extend”, “drop” } | ✓ | ~ 128 chars | Trigger Pulling Policy | ||
ttl | int | ✓ | ~ 2147483646 | Trigger expiration time (seconds) | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Enumeration type definition to specify as triggerStrategy
Enumerator String Definition | Description |
---|---|
renew | Redraw with a new period if the trigger has already been pulled |
extend | Extend the period if the trigger has already been pulled |
drop | Ignore if the trigger has already been pulled |
Result
Type | Description | |
---|---|---|
item | Trigger | Pulled Trigger |
Implementation Example
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: pointy.Int32(300),
TimeOffsetToken: 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(300)
->withTimeOffsetToken(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(300)
.withTimeOffsetToken(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.Gs2Schedule.Result.TriggerByUserIdResult> asyncResult = null;
yield return client.TriggerByUserId(
new Gs2.Gs2Schedule.Request.TriggerByUserIdRequest()
.WithNamespaceName("namespace1")
.WithTriggerName("trigger1")
.WithUserId("user-0001")
.WithTriggerStrategy("renew")
.WithTtl(300)
.WithTimeOffsetToken(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(300)
.withTimeOffsetToken(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(300)
.with_time_offset_token(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=300,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.trigger_by_user_id_async({
namespaceName="namespace1",
triggerName="trigger1",
userId="user-0001",
triggerStrategy="renew",
ttl=300,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
triggerByStampSheet
Execute trigger as acquire action
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stampSheet | string | ✓ | ~ 5242880 chars | Transaction | ||
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
item | Trigger | Pulled Trigger |
Implementation Example
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.TriggerByStampSheet(
&schedule.TriggerByStampSheetRequest {
StampSheet: pointy.String("stampSheet"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\TriggerByStampSheetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->triggerByStampSheet(
(new TriggerByStampSheetRequest())
->withStampSheet(self::stampSheet)
->withKeyId(self::key-0001)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.TriggerByStampSheetRequest;
import io.gs2.schedule.result.TriggerByStampSheetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
TriggerByStampSheetResult result = client.triggerByStampSheet(
new TriggerByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-0001")
);
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.TriggerByStampSheetRequest;
using Gs2.Gs2Schedule.Result.TriggerByStampSheetResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.TriggerByStampSheetResult> asyncResult = null;
yield return client.TriggerByStampSheet(
new Gs2.Gs2Schedule.Request.TriggerByStampSheetRequest()
.WithStampSheet("stampSheet")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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.triggerByStampSheet(
new Gs2Schedule.TriggerByStampSheetRequest()
.withStampSheet("stampSheet")
.withKeyId("key-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.trigger_by_stamp_sheet(
schedule.TriggerByStampSheetRequest()
.with_stamp_sheet(self.stamp_sheet)
.with_key_id(self.key1.key_id)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.trigger_by_stamp_sheet({
stampSheet="stampSheet",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.trigger_by_stamp_sheet_async({
stampSheet="stampSheet",
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteTrigger
Delete Trigger
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
triggerName | string | ✓ | ~ 128 chars | Trigger Name |
Result
Type | Description | |
---|---|---|
item | Trigger | Deleted Trigger |
Implementation Example
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("accessToken-0001"),
TriggerName: pointy.String("trigger1"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\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("accessToken-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.Gs2Schedule.Result.DeleteTriggerResult> asyncResult = null;
yield return client.DeleteTrigger(
new Gs2.Gs2Schedule.Request.DeleteTriggerRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("accessToken-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("accessToken-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="accessToken-0001",
triggerName="trigger1",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.delete_trigger_async({
namespaceName="namespace1",
accessToken="accessToken-0001",
triggerName="trigger1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteTriggerByUserId
Delete trigger by specifying user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
triggerName | string | ✓ | ~ 128 chars | Trigger Name | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | Trigger | Deleted Trigger |
Implementation Example
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"),
TimeOffsetToken: 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\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")
->withTimeOffsetToken(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.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")
.withTimeOffsetToken(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.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.Gs2Schedule.Result.DeleteTriggerByUserIdResult> asyncResult = null;
yield return client.DeleteTriggerByUserId(
new Gs2.Gs2Schedule.Request.DeleteTriggerByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithTriggerName("trigger1")
.WithTimeOffsetToken(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.deleteTriggerByUserId(
new Gs2Schedule.DeleteTriggerByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withTriggerName("trigger1")
.withTimeOffsetToken(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.delete_trigger_by_user_id(
schedule.DeleteTriggerByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_trigger_name('trigger1')
.with_time_offset_token(None)
)
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",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.delete_trigger_by_user_id_async({
namespaceName="namespace1",
userId="user-0001",
triggerName="trigger1",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
verifyTrigger
Verify the elapsed time since the trigger was pulled
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
triggerName | string | ✓ | ~ 128 chars | Trigger Name | ||
verifyType | enum { “notTriggerd”, “elapsed”, “notElapsed” } | ✓ | ~ 128 chars | Type of verification | ||
elapsedMinutes | int | {verifyType} in [“elapsed”, “notElapsed”] | ✓ | ~ 2147483646 | Elapsed time (minutes) |
Enumeration type definition to specify as verifyType
Enumerator String Definition | Description |
---|---|
notTriggerd | Trigger not pulled |
elapsed | Elapsed time |
notElapsed | Not elapsed time |
Result
Type | Description |
---|
Implementation Example
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.VerifyTrigger(
&schedule.VerifyTriggerRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("accessToken-0001"),
TriggerName: pointy.String("trigger-0001"),
VerifyType: pointy.String("elapsed"),
ElapsedMinutes: pointy.Int32(60),
}
)
if err != nil {
panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\VerifyTriggerRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyTrigger(
(new VerifyTriggerRequest())
->withNamespaceName(self::namespace1)
->withAccessToken(self::$accessToken0001)
->withTriggerName("trigger-0001")
->withVerifyType("elapsed")
->withElapsedMinutes(60)
);
} 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.VerifyTriggerRequest;
import io.gs2.schedule.result.VerifyTriggerResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
VerifyTriggerResult result = client.verifyTrigger(
new VerifyTriggerRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withTriggerName("trigger-0001")
.withVerifyType("elapsed")
.withElapsedMinutes(60)
);
} 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.VerifyTriggerRequest;
using Gs2.Gs2Schedule.Result.VerifyTriggerResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.VerifyTriggerResult> asyncResult = null;
yield return client.VerifyTrigger(
new Gs2.Gs2Schedule.Request.VerifyTriggerRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("accessToken-0001")
.WithTriggerName("trigger-0001")
.WithVerifyType("elapsed")
.WithElapsedMinutes(60),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.verifyTrigger(
new Gs2Schedule.VerifyTriggerRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withTriggerName("trigger-0001")
.withVerifyType("elapsed")
.withElapsedMinutes(60)
);
} 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.verify_trigger(
schedule.VerifyTriggerRequest()
.with_namespace_name(self.hash1)
.with_access_token(self.access_token_0001)
.with_trigger_name('trigger-0001')
.with_verify_type('elapsed')
.with_elapsed_minutes(60)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.verify_trigger({
namespaceName="namespace1",
accessToken="accessToken-0001",
triggerName="trigger-0001",
verifyType="elapsed",
elapsedMinutes=60,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('schedule')
api_result_handler = client.verify_trigger_async({
namespaceName="namespace1",
accessToken="accessToken-0001",
triggerName="trigger-0001",
verifyType="elapsed",
elapsedMinutes=60,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
verifyTriggerByUserId
Verify the elapsed time since the trigger was pulled by specifying the user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
triggerName | string | ✓ | ~ 128 chars | Trigger Name | ||
verifyType | enum { “notTriggerd”, “elapsed”, “notElapsed” } | ✓ | ~ 128 chars | Type of verification | ||
elapsedMinutes | int | {verifyType} in [“elapsed”, “notElapsed”] | ✓ | ~ 2147483646 | Elapsed time (minutes) | |
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Enumeration type definition to specify as verifyType
Enumerator String Definition | Description |
---|---|
notTriggerd | Trigger not pulled |
elapsed | Elapsed time |
notElapsed | Not elapsed time |
Result
Type | Description |
---|
Implementation Example
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.VerifyTriggerByUserId(
&schedule.VerifyTriggerByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
TriggerName: pointy.String("trigger-0001"),
VerifyType: pointy.String("elapsed"),
ElapsedMinutes: pointy.Int32(60),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\VerifyTriggerByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyTriggerByUserId(
(new VerifyTriggerByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withTriggerName("trigger-0001")
->withVerifyType("elapsed")
->withElapsedMinutes(60)
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.VerifyTriggerByUserIdRequest;
import io.gs2.schedule.result.VerifyTriggerByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
VerifyTriggerByUserIdResult result = client.verifyTriggerByUserId(
new VerifyTriggerByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withTriggerName("trigger-0001")
.withVerifyType("elapsed")
.withElapsedMinutes(60)
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.VerifyTriggerByUserIdRequest;
using Gs2.Gs2Schedule.Result.VerifyTriggerByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.VerifyTriggerByUserIdResult> asyncResult = null;
yield return client.VerifyTriggerByUserId(
new Gs2.Gs2Schedule.Request.VerifyTriggerByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithTriggerName("trigger-0001")
.WithVerifyType("elapsed")
.WithElapsedMinutes(60)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.verifyTriggerByUserId(
new Gs2Schedule.VerifyTriggerByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withTriggerName("trigger-0001")
.withVerifyType("elapsed")
.withElapsedMinutes(60)
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.verify_trigger_by_user_id(
schedule.VerifyTriggerByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_trigger_name('trigger-0001')
.with_verify_type('elapsed')
.with_elapsed_minutes(60)
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.verify_trigger_by_user_id({
namespaceName="namespace1",
userId="user-0001",
triggerName="trigger-0001",
verifyType="elapsed",
elapsedMinutes=60,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('schedule')
api_result_handler = client.verify_trigger_by_user_id_async({
namespaceName="namespace1",
userId="user-0001",
triggerName="trigger-0001",
verifyType="elapsed",
elapsedMinutes=60,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
deleteTriggerByStampTask
Execute trigger as consume action
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stampTask | string | ✓ | ~ 5242880 chars | Consume Action | ||
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
item | Trigger | Deleted Trigger |
newContextStack | string | Request of context in which consume action execution results are recorded |
Implementation Example
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.DeleteTriggerByStampTask(
&schedule.DeleteTriggerByStampTaskRequest {
StampTask: pointy.String("stampTask"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\DeleteTriggerByStampTaskRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteTriggerByStampTask(
(new DeleteTriggerByStampTaskRequest())
->withStampTask(self::stampTask)
->withKeyId(self::key-0001)
);
$item = $result->getItem();
$newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.DeleteTriggerByStampTaskRequest;
import io.gs2.schedule.result.DeleteTriggerByStampTaskResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
DeleteTriggerByStampTaskResult result = client.deleteTriggerByStampTask(
new DeleteTriggerByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
Trigger item = result.getItem();
String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.DeleteTriggerByStampTaskRequest;
using Gs2.Gs2Schedule.Result.DeleteTriggerByStampTaskResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.DeleteTriggerByStampTaskResult> asyncResult = null;
yield return client.DeleteTriggerByStampTask(
new Gs2.Gs2Schedule.Request.DeleteTriggerByStampTaskRequest()
.WithStampTask("stampTask")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var newContextStack = result.NewContextStack;
import Gs2Core from '@/gs2/core';
import * as 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.deleteTriggerByStampTask(
new Gs2Schedule.DeleteTriggerByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
const item = result.getItem();
const newContextStack = result.getNewContextStack();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import 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_stamp_task(
schedule.DeleteTriggerByStampTaskRequest()
.with_stamp_task(self.stamp_task)
.with_key_id(self.key1.key_id)
)
item = result.item
new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.delete_trigger_by_stamp_task({
stampTask="stampTask",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
newContextStack = result.newContextStack;
client = gs2('schedule')
api_result_handler = client.delete_trigger_by_stamp_task_async({
stampTask="stampTask",
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
newContextStack = result.newContextStack;
verifyTriggerByStampTask
Execute trigger as verify action to verify the elapsed time since the trigger was pulled
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stampTask | string | ✓ | ~ 5242880 chars | Verify Action | ||
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
newContextStack | string | Request of context in which verify action execution results are recorded |
Implementation Example
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.VerifyTriggerByStampTask(
&schedule.VerifyTriggerByStampTaskRequest {
StampTask: pointy.String("stampTask"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\VerifyTriggerByStampTaskRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyTriggerByStampTask(
(new VerifyTriggerByStampTaskRequest())
->withStampTask(self::stampTask)
->withKeyId(self::key-0001)
);
$newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.VerifyTriggerByStampTaskRequest;
import io.gs2.schedule.result.VerifyTriggerByStampTaskResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
VerifyTriggerByStampTaskResult result = client.verifyTriggerByStampTask(
new VerifyTriggerByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.VerifyTriggerByStampTaskRequest;
using Gs2.Gs2Schedule.Result.VerifyTriggerByStampTaskResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.VerifyTriggerByStampTaskResult> asyncResult = null;
yield return client.VerifyTriggerByStampTask(
new Gs2.Gs2Schedule.Request.VerifyTriggerByStampTaskRequest()
.WithStampTask("stampTask")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.verifyTriggerByStampTask(
new Gs2Schedule.VerifyTriggerByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
const newContextStack = result.getNewContextStack();
} 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.verify_trigger_by_stamp_task(
schedule.VerifyTriggerByStampTaskRequest()
.with_stamp_task(self.stamp_task)
.with_key_id(self.key1.key_id)
)
new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.verify_trigger_by_stamp_task({
stampTask="stampTask",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
newContextStack = result.newContextStack;
client = gs2('schedule')
api_result_handler = client.verify_trigger_by_stamp_task_async({
stampTask="stampTask",
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
newContextStack = result.newContextStack;
describeEvents
Get list of events
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | User Id |
Result
Type | Description | |
---|---|---|
items | List<Event> | List of Events |
Implementation Example
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("accessToken-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("accessToken-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.Gs2Schedule.Result.DescribeEventsResult> asyncResult = null;
yield return client.DescribeEvents(
new Gs2.Gs2Schedule.Request.DescribeEventsRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("accessToken-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("accessToken-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="accessToken-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('schedule')
api_result_handler = client.describe_events_async({
namespaceName="namespace1",
accessToken="accessToken-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
describeEventsByUserId
Get list of events by specifying a user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
items | List<Event> | List of Events |
Implementation Example
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"),
TimeOffsetToken: nil,
}
)
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")
->withTimeOffsetToken(null)
);
$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")
.withTimeOffsetToken(null)
);
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.Gs2Schedule.Result.DescribeEventsByUserIdResult> asyncResult = null;
yield return client.DescribeEventsByUserId(
new Gs2.Gs2Schedule.Request.DescribeEventsByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithTimeOffsetToken(null),
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")
.withTimeOffsetToken(null)
);
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')
.with_time_offset_token(None)
)
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",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('schedule')
api_result_handler = client.describe_events_by_user_id_async({
namespaceName="namespace1",
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
describeRawEvents
Get list of events
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
items | List<Event> | List of Events |
Implementation Example
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.Gs2Schedule.Result.DescribeRawEventsResult> asyncResult = null;
yield return client.DescribeRawEvents(
new Gs2.Gs2Schedule.Request.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
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('schedule')
api_result_handler = client.describe_raw_events_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
getEvent
Get Event
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
eventName | string | ✓ | ~ 128 chars | Event Type Name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
isInSchedule | bool | ✓ | true | Are only current events eligible for acquisition |
Result
Type | Description | |
---|---|---|
item | Event | Event |
inSchedule | bool? | Whether in schedule |
scheduleStartAt | long | Schedule start time (Unix time unit:milliseconds) |
scheduleEndAt | long | Schedule end time (Unix time unit:milliseconds) |
repeatSchedule | RepeatSchedule | Repeat Schedule |
Implementation Example
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("accessToken-0001"),
IsInSchedule: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
inSchedule := result.InSchedule
scheduleStartAt := result.ScheduleStartAt
scheduleEndAt := result.ScheduleEndAt
repeatSchedule := result.RepeatSchedule
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)
->withIsInSchedule(null)
);
$item = $result->getItem();
$inSchedule = $result->getInSchedule();
$scheduleStartAt = $result->getScheduleStartAt();
$scheduleEndAt = $result->getScheduleEndAt();
$repeatSchedule = $result->getRepeatSchedule();
} 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("accessToken-0001")
.withIsInSchedule(null)
);
Event item = result.getItem();
boolean inSchedule = result.getInSchedule();
long scheduleStartAt = result.getScheduleStartAt();
long scheduleEndAt = result.getScheduleEndAt();
RepeatSchedule repeatSchedule = result.getRepeatSchedule();
} 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.Gs2Schedule.Result.GetEventResult> asyncResult = null;
yield return client.GetEvent(
new Gs2.Gs2Schedule.Request.GetEventRequest()
.WithNamespaceName("namespace1")
.WithEventName("event-0001")
.WithAccessToken("accessToken-0001")
.WithIsInSchedule(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var inSchedule = result.InSchedule;
var scheduleStartAt = result.ScheduleStartAt;
var scheduleEndAt = result.ScheduleEndAt;
var repeatSchedule = result.RepeatSchedule;
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("accessToken-0001")
.withIsInSchedule(null)
);
const item = result.getItem();
const inSchedule = result.getInSchedule();
const scheduleStartAt = result.getScheduleStartAt();
const scheduleEndAt = result.getScheduleEndAt();
const repeatSchedule = result.getRepeatSchedule();
} 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)
.with_is_in_schedule(None)
)
item = result.item
in_schedule = result.in_schedule
schedule_start_at = result.schedule_start_at
schedule_end_at = result.schedule_end_at
repeat_schedule = result.repeat_schedule
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.get_event({
namespaceName="namespace1",
eventName="event-0001",
accessToken="accessToken-0001",
isInSchedule=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
inSchedule = result.inSchedule;
scheduleStartAt = result.scheduleStartAt;
scheduleEndAt = result.scheduleEndAt;
repeatSchedule = result.repeatSchedule;
client = gs2('schedule')
api_result_handler = client.get_event_async({
namespaceName="namespace1",
eventName="event-0001",
accessToken="accessToken-0001",
isInSchedule=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
inSchedule = result.inSchedule;
scheduleStartAt = result.scheduleStartAt;
scheduleEndAt = result.scheduleEndAt;
repeatSchedule = result.repeatSchedule;
getEventByUserId
Get event by specifying user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
eventName | string | ✓ | ~ 128 chars | Event Type Name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
isInSchedule | bool | ✓ | true | Are only current events eligible for acquisition | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
Type | Description | |
---|---|---|
item | Event | Event |
inSchedule | bool? | Whether in schedule |
scheduleStartAt | long | Schedule start time (Unix time unit:milliseconds) |
scheduleEndAt | long | Schedule end time (Unix time unit:milliseconds) |
repeatSchedule | RepeatSchedule | Repeat Schedule |
Implementation Example
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"),
IsInSchedule: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
inSchedule := result.InSchedule
scheduleStartAt := result.ScheduleStartAt
scheduleEndAt := result.ScheduleEndAt
repeatSchedule := result.RepeatSchedule
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")
->withIsInSchedule(null)
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$inSchedule = $result->getInSchedule();
$scheduleStartAt = $result->getScheduleStartAt();
$scheduleEndAt = $result->getScheduleEndAt();
$repeatSchedule = $result->getRepeatSchedule();
} 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")
.withIsInSchedule(null)
.withTimeOffsetToken(null)
);
Event item = result.getItem();
boolean inSchedule = result.getInSchedule();
long scheduleStartAt = result.getScheduleStartAt();
long scheduleEndAt = result.getScheduleEndAt();
RepeatSchedule repeatSchedule = result.getRepeatSchedule();
} 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.Gs2Schedule.Result.GetEventByUserIdResult> asyncResult = null;
yield return client.GetEventByUserId(
new Gs2.Gs2Schedule.Request.GetEventByUserIdRequest()
.WithNamespaceName("namespace1")
.WithEventName("event-0001")
.WithUserId("user-0001")
.WithIsInSchedule(null)
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var inSchedule = result.InSchedule;
var scheduleStartAt = result.ScheduleStartAt;
var scheduleEndAt = result.ScheduleEndAt;
var repeatSchedule = result.RepeatSchedule;
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")
.withIsInSchedule(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
const inSchedule = result.getInSchedule();
const scheduleStartAt = result.getScheduleStartAt();
const scheduleEndAt = result.getScheduleEndAt();
const repeatSchedule = result.getRepeatSchedule();
} 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')
.with_is_in_schedule(None)
.with_time_offset_token(None)
)
item = result.item
in_schedule = result.in_schedule
schedule_start_at = result.schedule_start_at
schedule_end_at = result.schedule_end_at
repeat_schedule = result.repeat_schedule
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",
isInSchedule=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
inSchedule = result.inSchedule;
scheduleStartAt = result.scheduleStartAt;
scheduleEndAt = result.scheduleEndAt;
repeatSchedule = result.repeatSchedule;
client = gs2('schedule')
api_result_handler = client.get_event_by_user_id_async({
namespaceName="namespace1",
eventName="event-0001",
userId="user-0001",
isInSchedule=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
inSchedule = result.inSchedule;
scheduleStartAt = result.scheduleStartAt;
scheduleEndAt = result.scheduleEndAt;
repeatSchedule = result.repeatSchedule;
getRawEvent
Get Event
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
eventName | string | ✓ | ~ 128 chars | Event Type Name |
Result
Type | Description | |
---|---|---|
item | Event | Event |
Implementation Example
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.Gs2Schedule.Result.GetRawEventResult> asyncResult = null;
yield return client.GetRawEvent(
new Gs2.Gs2Schedule.Request.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
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.get_raw_event_async({
namespaceName="namespace1",
eventName="event-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
verifyEvent
Verify if it is the event holding period
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | ||
eventName | string | ✓ | ~ 128 chars | Event Type Name | ||
verifyType | enum { “inSchedule”, “notInSchedule” } | ✓ | ~ 128 chars | Type of verification |
Enumeration type definition to specify as verifyType
Enumerator String Definition | Description |
---|---|
inSchedule | In schedule |
notInSchedule | Not in schedule |
Result
Type | Description |
---|
Implementation Example
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.VerifyEvent(
&schedule.VerifyEventRequest {
NamespaceName: pointy.String("namespace1"),
AccessToken: pointy.String("accessToken-0001"),
EventName: pointy.String("event-0001"),
VerifyType: pointy.String("inSchedule"),
}
)
if err != nil {
panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\VerifyEventRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyEvent(
(new VerifyEventRequest())
->withNamespaceName(self::namespace1)
->withAccessToken(self::$accessToken0001)
->withEventName("event-0001")
->withVerifyType("inSchedule")
);
} 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.VerifyEventRequest;
import io.gs2.schedule.result.VerifyEventResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
VerifyEventResult result = client.verifyEvent(
new VerifyEventRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withEventName("event-0001")
.withVerifyType("inSchedule")
);
} 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.VerifyEventRequest;
using Gs2.Gs2Schedule.Result.VerifyEventResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.VerifyEventResult> asyncResult = null;
yield return client.VerifyEvent(
new Gs2.Gs2Schedule.Request.VerifyEventRequest()
.WithNamespaceName("namespace1")
.WithAccessToken("accessToken-0001")
.WithEventName("event-0001")
.WithVerifyType("inSchedule"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.verifyEvent(
new Gs2Schedule.VerifyEventRequest()
.withNamespaceName("namespace1")
.withAccessToken("accessToken-0001")
.withEventName("event-0001")
.withVerifyType("inSchedule")
);
} 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.verify_event(
schedule.VerifyEventRequest()
.with_namespace_name(self.hash1)
.with_access_token(self.access_token_0001)
.with_event_name('event-0001')
.with_verify_type('inSchedule')
)
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.verify_event({
namespaceName="namespace1",
accessToken="accessToken-0001",
eventName="event-0001",
verifyType="inSchedule",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('schedule')
api_result_handler = client.verify_event_async({
namespaceName="namespace1",
accessToken="accessToken-0001",
eventName="event-0001",
verifyType="inSchedule",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
verifyEventByUserId
Verify if it is the event holding period by specifying user ID
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
userId | string | ✓ | ~ 128 chars | User Id | ||
eventName | string | ✓ | ~ 128 chars | Event Type Name | ||
verifyType | enum { “inSchedule”, “notInSchedule” } | ✓ | ~ 128 chars | Type of verification | ||
timeOffsetToken | string | ~ 1024 chars | Time offset token |
Enumeration type definition to specify as verifyType
Enumerator String Definition | Description |
---|---|
inSchedule | In schedule |
notInSchedule | Not in schedule |
Result
Type | Description |
---|
Implementation Example
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.VerifyEventByUserId(
&schedule.VerifyEventByUserIdRequest {
NamespaceName: pointy.String("namespace1"),
UserId: pointy.String("user-0001"),
EventName: pointy.String("event-0001"),
VerifyType: pointy.String("inSchedule"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\VerifyEventByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyEventByUserId(
(new VerifyEventByUserIdRequest())
->withNamespaceName(self::namespace1)
->withUserId("user-0001")
->withEventName("event-0001")
->withVerifyType("inSchedule")
->withTimeOffsetToken(null)
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.VerifyEventByUserIdRequest;
import io.gs2.schedule.result.VerifyEventByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
VerifyEventByUserIdResult result = client.verifyEventByUserId(
new VerifyEventByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withEventName("event-0001")
.withVerifyType("inSchedule")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.VerifyEventByUserIdRequest;
using Gs2.Gs2Schedule.Result.VerifyEventByUserIdResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.VerifyEventByUserIdResult> asyncResult = null;
yield return client.VerifyEventByUserId(
new Gs2.Gs2Schedule.Request.VerifyEventByUserIdRequest()
.WithNamespaceName("namespace1")
.WithUserId("user-0001")
.WithEventName("event-0001")
.WithVerifyType("inSchedule")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Schedule from '@/gs2/schedule';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Schedule.Gs2ScheduleRestClient(session);
try {
const result = await client.verifyEventByUserId(
new Gs2Schedule.VerifyEventByUserIdRequest()
.withNamespaceName("namespace1")
.withUserId("user-0001")
.withEventName("event-0001")
.withVerifyType("inSchedule")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import schedule
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = schedule.Gs2ScheduleRestClient(session)
try:
result = client.verify_event_by_user_id(
schedule.VerifyEventByUserIdRequest()
.with_namespace_name(self.hash1)
.with_user_id('user-0001')
.with_event_name('event-0001')
.with_verify_type('inSchedule')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.verify_event_by_user_id({
namespaceName="namespace1",
userId="user-0001",
eventName="event-0001",
verifyType="inSchedule",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('schedule')
api_result_handler = client.verify_event_by_user_id_async({
namespaceName="namespace1",
userId="user-0001",
eventName="event-0001",
verifyType="inSchedule",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
verifyEventByStampTask
Execute verification of whether it is the event holding period as a verify action
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stampTask | string | ✓ | ~ 5242880 chars | Verify Action | ||
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
newContextStack | string | Request of context in which verify action execution results are recorded |
Implementation Example
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.VerifyEventByStampTask(
&schedule.VerifyEventByStampTaskRequest {
StampTask: pointy.String("stampTask"),
KeyId: pointy.String("key-0001"),
}
)
if err != nil {
panic("error occurred")
}
newContextStack := result.NewContextStack
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Schedule\Gs2ScheduleRestClient;
use Gs2\Schedule\Request\VerifyEventByStampTaskRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->verifyEventByStampTask(
(new VerifyEventByStampTaskRequest())
->withStampTask(self::stampTask)
->withKeyId(self::key-0001)
);
$newContextStack = $result->getNewContextStack();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.schedule.rest.Gs2ScheduleRestClient;
import io.gs2.schedule.request.VerifyEventByStampTaskRequest;
import io.gs2.schedule.result.VerifyEventByStampTaskResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2ScheduleRestClient client = new Gs2ScheduleRestClient(session);
try {
VerifyEventByStampTaskResult result = client.verifyEventByStampTask(
new VerifyEventByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
String newContextStack = result.getNewContextStack();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Schedule.Gs2ScheduleRestClient;
using Gs2.Gs2Schedule.Request.VerifyEventByStampTaskRequest;
using Gs2.Gs2Schedule.Result.VerifyEventByStampTaskResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2ScheduleRestClient(session);
AsyncResult<Gs2.Gs2Schedule.Result.VerifyEventByStampTaskResult> asyncResult = null;
yield return client.VerifyEventByStampTask(
new Gs2.Gs2Schedule.Request.VerifyEventByStampTaskRequest()
.WithStampTask("stampTask")
.WithKeyId("key-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var newContextStack = result.NewContextStack;
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.verifyEventByStampTask(
new Gs2Schedule.VerifyEventByStampTaskRequest()
.withStampTask("stampTask")
.withKeyId("key-0001")
);
const newContextStack = result.getNewContextStack();
} 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.verify_event_by_stamp_task(
schedule.VerifyEventByStampTaskRequest()
.with_stamp_task(self.stamp_task)
.with_key_id(self.key1.key_id)
)
new_context_stack = result.new_context_stack
except core.Gs2Exception as e:
exit(1)
client = gs2('schedule')
api_result = client.verify_event_by_stamp_task({
stampTask="stampTask",
keyId="key-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
newContextStack = result.newContextStack;
client = gs2('schedule')
api_result_handler = client.verify_event_by_stamp_task_async({
stampTask="stampTask",
keyId="key-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
newContextStack = result.newContextStack;
exportMaster
Export master data for the currently available event schedule master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | CurrentEventMaster | Currently available event schedule master |
Implementation Example
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.Gs2Schedule.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
new Gs2.Gs2Schedule.Request.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
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.export_master_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
getCurrentEventMaster
Get the currently available event schedule master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
item | CurrentEventMaster | Currently available event schedule master |
Implementation Example
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.Gs2Schedule.Result.GetCurrentEventMasterResult> asyncResult = null;
yield return client.GetCurrentEventMaster(
new Gs2.Gs2Schedule.Request.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
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.get_current_event_master_async({
namespaceName="namespace1",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateCurrentEventMaster
Update the currently available event schedule master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
settings | string | ✓ | ~ 5242880 chars | Master data |
Result
Type | Description | |
---|---|---|
item | CurrentEventMaster | Updated and currently available event schedule master |
Implementation Example
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 },\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 },\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 },\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.Gs2Schedule.Result.UpdateCurrentEventMasterResult> asyncResult = null;
yield return client.UpdateCurrentEventMaster(
new Gs2.Gs2Schedule.Request.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 },\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 },\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 },\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 },\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
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.update_current_event_master_async({
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 },\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}",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateCurrentEventMasterFromGitHub
Update the currently available event schedule master
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | ||
checkoutSetting | GitHubCheckoutSetting | ✓ | Setup to check out master data from GitHub |
Result
Type | Description | |
---|---|---|
item | CurrentEventMaster | Currently available event schedule master |
Implementation Example
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: &schedule.GitHubCheckoutSetting{
ApiKeyId: pointy.String("$gitHubApiKey1.apiKeyId"),
RepositoryName: pointy.String("gs2io/master-data"),
SourcePath: pointy.String("path/to/file.json"),
ReferenceType: pointy.String("branch"),
BranchName: pointy.String("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((new GitHubCheckoutSetting())
->withApiKeyId(self::$gitHubApiKey1.apiKeyId)
->withRepositoryName("gs2io/master-data")
->withSourcePath("path/to/file.json")
->withReferenceType("branch")
->withBranchName("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(new GitHubCheckoutSetting()
.withApiKeyId("$gitHubApiKey1.apiKeyId")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("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.Gs2Schedule.Result.UpdateCurrentEventMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentEventMasterFromGitHub(
new Gs2.Gs2Schedule.Request.UpdateCurrentEventMasterFromGitHubRequest()
.WithNamespaceName("namespace1")
.WithCheckoutSetting(new Gs2.Gs2Schedule.Model.GitHubCheckoutSetting()
.WithApiKeyId("$gitHubApiKey1.apiKeyId")
.WithRepositoryName("gs2io/master-data")
.WithSourcePath("path/to/file.json")
.WithReferenceType("branch")
.WithBranchName("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(new Gs2Schedule.model.GitHubCheckoutSetting()
.withApiKeyId("$gitHubApiKey1.apiKeyId")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("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(schedule.GitHubCheckoutSetting()
.with_api_key_id(self.git_hub_api_key1.api_key_id)
.with_repository_name('gs2io/master-data')
.with_source_path('path/to/file.json')
.with_reference_type('branch')
.with_branch_name('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={
api_key_id="$gitHubApiKey1.apiKeyId",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('schedule')
api_result_handler = client.update_current_event_master_from_git_hub_async({
namespaceName="namespace1",
checkoutSetting={
api_key_id="$gitHubApiKey1.apiKeyId",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;