API Reference of GS2-JobQueue SDK

Specification of models and API references for GS2-SDK for various programming languages

Model

Namespace

Namespace

A namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the namespace differs, the data is treated as a completely independent data space.

Therefore, you must create a namespace before you can start using each service.

TypeConditionRequiredDefaultValue LimitsDescription
namespaceIdstring
~ 1024 charsNamespace GRN
namestring
~ 128 charsNamespace name
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction settings
enableAutoRunbool
falseAutomatically execute registered jobs on the server side
runNotificationNotificationSetting
Push notification when a job in the job queue is executed
pushNotificationNotificationSetting!{enableAutoRun}Push notification when a job is registered in the job queue
If enableAutoRun is “false”, then enabled
logSettingLogSettingLog output settings
createdAtlong
NowDatetime of creation
Unix time, milliseconds
updatedAtlong
NowDatetime of last update
Unix time, milliseconds
revisionlong00 ~ 9223372036854775805Revision

Job

Job

A job queue is a mechanism for delaying the execution of a process rather than completing it immediately. For example, when a character is acquired, the process that must be executed immediately is to store the character in the possession. On the other hand, a process that does not have to be executed immediately is the process of registering the character to the dictionary.

By processing these processes that do not need to be processed immediately via a job queue, the design can be made more resilient to failures. This is because even if the dictionary service is stopped due to some failure, the game can continue without being registered in the dictionary. Even if the process packed in the job queue fails, it can be retried after the failure is resolved, resulting in a correct state.

GS2 recommends this kind of result matching process, and in various situations, job queues are used for delayed processing.

TypeConditionRequiredDefaultValue LimitsDescription
jobIdstring
~ 1024 charsJob GRN
namestring
UUID~ 36 charsJob Name
userIdstring
~ 128 charsUser Id
scriptIdstring
~ 1024 charsScript GRN
argsstring
~ 5242880 charsargument
currentRetryCountint
00 ~ 100Current retry count
maxTryCountint
31 ~ 100Maximum number of attempts
createdAtlong
NowDatetime of creation
Unix time, milliseconds
updatedAtlong
NowDatetime of last update
Unix time, milliseconds

JobResult

Job execution results

TypeConditionRequiredDefaultValue LimitsDescription
jobResultIdstring
~ 1024 charsJob execution result GRN
jobIdstring
~ 1024 charsJob GRN
scriptIdstring~ 1024 charsScript GRN
argsstring~ 5242880 charsargument
tryNumberint
0 ~ 10000Number of attempts
statusCodeint
0 ~ 1000status code
resultstring
~ 5242880 charsResponse Content
tryAtlong
NowDatetime of creation
Unix time, milliseconds

NotificationSetting

Push notification settings

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

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

TypeConditionRequiredDefaultValue LimitsDescription
gatewayNamespaceIdstring
“grn:gs2:{region}:{ownerId}:gateway:default”~ 1024 charsGS2-Gateway namespace to use for push notifications
Specify the GS2-Gateway namespace ID in GRN format starting with “grn:gs2:”.
enableTransferMobileNotificationbool?falseForwarding to mobile push notification
When this notification is sent, if the destination device is offline, specify whether to forward it to mobile push notification.
soundstring{enableTransferMobileNotification} == true~ 1024 charsSound file name to be used for mobile push notifications
The sound file name specified here is used when sending mobile push notifications, and you can send notifications with a special sound.

If enableTransferMobileNotification is true, then enabled
enableString Enum
enum {
  “Enabled”,
  “Disabled”
}
“Enabled”~ 128 charsWhether to enable push notifications
Enumerator String DefinitionDescription
“Enabled”Enabled
“Disabled”Disabled

LogSetting

Log Export Settings

Manages log data export settings. This type holds the GS2-Log namespace identifier (Namespace ID) used to export log data. Specify the GS2-Log namespace where log data is collected and stored in the GRN format for the Log Namespace ID (loggingNamespaceId). Configuring this setting ensures that log data for API requests and responses occurring within the specified namespace is output to the target GS2-Log namespace. GS2-Log provides real-time logs that can be used for system monitoring, analysis, and debugging.

TypeConditionRequiredDefaultValue LimitsDescription
loggingNamespaceIdstring
~ 1024 charsGS2-Log namespace GRN to output logs

TransactionSetting

Transaction settings

Transaction settings control how transactions are executed, their consistency, asynchronous processing, and conflict avoidance mechanisms. Combining features like AutoRun, AtomicCommit, Distributor, batch application of script results, and asynchronous acquisition actions via JobQueue enables robust transaction management tailored to game logic.

TypeConditionRequiredDefaultValue LimitsDescription
enableAutoRunbool
falseWhether to automatically execute issued transactions on the server side
enableAtomicCommitbool{enableAutoRun} == true
falseWhether to commit the execution of transactions atomically
If enableAutoRun is true, then required
transactionUseDistributorbool{enableAtomicCommit} == true
falseWhether to execute transactions asynchronously
If enableAtomicCommit is true, then required
commitScriptResultInUseDistributorbool{transactionUseDistributor} == true
falseWhether to execute the commit processing of the script result asynchronously
If transactionUseDistributor is true, then required
acquireActionUseJobQueuebool{enableAtomicCommit} == true
falseWhether to use GS2-JobQueue to execute the acquire action
If enableAtomicCommit is true, then required
distributorNamespaceIdstring
“grn:gs2:{region}:{ownerId}:distributor:default”~ 1024 charsGS2-Distributor namespace used for transaction execution
queueNamespaceIdstring
“grn:gs2:{region}:{ownerId}:queue:default”~ 1024 charsNamespace in GS2-JobQueue used to run the transaction

JobEntry

Register Job

TypeConditionRequiredDefaultValue LimitsDescription
scriptIdstring
~ 1024 charsScript GRN
argsstring
“{}”~ 131072 charsargument
maxTryCountint
30 ~ 100Maximum number of attempts

JobResultBody

Job execution results

TypeConditionRequiredDefaultValue LimitsDescription
tryNumberint
1 ~ 10000Number of attempts
statusCodeint
0 ~ 1000status code
resultstring
~ 5242880 charsResponse Content
tryAtlong
NowDatetime of creation
Unix time, milliseconds

Methods

describeNamespaces

Get list of namespaces

Request

TypeConditionRequiredDefaultValue LimitsDescription
namePrefixstring~ 64 charsFilter by namespace name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint
301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<Namespace>List of Namespace
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &job_queue.DescribeNamespacesRequest {
        NamePrefix: nil,
        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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\DescribeNamespacesRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->describeNamespaces(
        (new DescribeNamespacesRequest())
            ->withNamePrefix(null)
            ->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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.DescribeNamespacesRequest;
import io.gs2.jobQueue.result.DescribeNamespacesResult;

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

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

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2JobQueue.Request.DescribeNamespacesRequest()
        .WithNamePrefix(null)
        .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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.describeNamespaces(
        new Gs2JobQueue.DescribeNamespacesRequest()
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.describe_namespaces(
        job_queue.DescribeNamespacesRequest()
            .with_name_prefix(None)
            .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('job_queue')

api_result = client.describe_namespaces({
    namePrefix=nil,
    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('job_queue')

api_result_handler = client.describe_namespaces_async({
    namePrefix=nil,
    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

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsNamespace name
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction settings
enableAutoRunbool
falseAutomatically execute registered jobs on the server side
pushNotificationNotificationSetting!{enableAutoRun}Push notification when a job is registered in the job queue
If !{enableAutoRun is “true”, then enabled
runNotificationNotificationSetting
Push notification when a job in the job queue is executed
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceNamespace created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &job_queue.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSetting: nil,
        EnableAutoRun: nil,
        PushNotification: nil,
        RunNotification: nil,
        LogSetting: &jobQueue.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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withEnableAutoRun(null)
            ->withPushNotification(null)
            ->withRunNotification(null)
            ->withLogSetting((new \Gs2\JobQueue\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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.CreateNamespaceRequest;
import io.gs2.jobQueue.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withEnableAutoRun(null)
            .withPushNotification(null)
            .withRunNotification(null)
            .withLogSetting(new io.gs2.jobQueue.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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2JobQueue.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithEnableAutoRun(null)
        .WithPushNotification(null)
        .WithRunNotification(null)
        .WithLogSetting(new Gs2.Gs2JobQueue.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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.createNamespace(
        new Gs2JobQueue.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withEnableAutoRun(null)
            .withPushNotification(null)
            .withRunNotification(null)
            .withLogSetting(new Gs2JobQueue.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 job_queue

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

try:
    result = client.create_namespace(
        job_queue.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting(None)
            .with_enable_auto_run(None)
            .with_push_notification(None)
            .with_run_notification(None)
            .with_log_setting(
                job_queue.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('job_queue')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    enableAutoRun=nil,
    pushNotification=nil,
    runNotification=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('job_queue')

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    enableAutoRun=nil,
    pushNotification=nil,
    runNotification=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

Get namespace status

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name

Result

TypeDescription
statusstring

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &job_queue.GetNamespaceStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\GetNamespaceStatusRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName("namespace-0001")
    );
    $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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.GetNamespaceStatusRequest;
import io.gs2.jobQueue.result.GetNamespaceStatusResult;

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

try {
    GetNamespaceStatusResult result = client.getNamespaceStatus(
        new GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2JobQueue.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace-0001"),
    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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.getNamespaceStatus(
        new Gs2JobQueue.GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.get_namespace_status(
        job_queue.GetNamespaceStatusRequest()
            .with_namespace_name('namespace-0001')
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

api_result = client.get_namespace_status({
    namespaceName="namespace-0001",
})

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('job_queue')

api_result_handler = client.get_namespace_status_async({
    namespaceName="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
status = result.status;

getNamespace

Get namespace

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name

Result

TypeDescription
itemNamespaceNamespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &job_queue.GetNamespaceRequest {
        NamespaceName: pointy.String("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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\GetNamespaceRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName("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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.GetNamespaceRequest;
import io.gs2.jobQueue.result.GetNamespaceResult;

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

try {
    GetNamespaceResult result = client.getNamespace(
        new GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2JobQueue.Request.GetNamespaceRequest()
        .WithNamespaceName("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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.getNamespace(
        new Gs2JobQueue.GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.get_namespace(
        job_queue.GetNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

api_result = client.get_namespace({
    namespaceName="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('job_queue')

api_result_handler = client.get_namespace_async({
    namespaceName="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;

updateNamespace

Update namespace

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction settings
enableAutoRunbool
falseAutomatically execute registered jobs on the server side
pushNotificationNotificationSetting!{enableAutoRun}Push notification when a job is registered in the job queue
If !{enableAutoRun is “true”, then enabled
runNotificationNotificationSetting
Push notification when a job in the job queue is executed
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceUpdated namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &job_queue.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        EnableAutoRun: nil,
        PushNotification: nil,
        RunNotification: nil,
        LogSetting: &jobQueue.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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withEnableAutoRun(null)
            ->withPushNotification(null)
            ->withRunNotification(null)
            ->withLogSetting((new \Gs2\JobQueue\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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.UpdateNamespaceRequest;
import io.gs2.jobQueue.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withEnableAutoRun(null)
            .withPushNotification(null)
            .withRunNotification(null)
            .withLogSetting(new io.gs2.jobQueue.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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2JobQueue.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithEnableAutoRun(null)
        .WithPushNotification(null)
        .WithRunNotification(null)
        .WithLogSetting(new Gs2.Gs2JobQueue.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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.updateNamespace(
        new Gs2JobQueue.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withEnableAutoRun(null)
            .withPushNotification(null)
            .withRunNotification(null)
            .withLogSetting(new Gs2JobQueue.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 job_queue

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

try:
    result = client.update_namespace(
        job_queue.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(None)
            .with_enable_auto_run(None)
            .with_push_notification(None)
            .with_run_notification(None)
            .with_log_setting(
                job_queue.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('job_queue')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    enableAutoRun=nil,
    pushNotification=nil,
    runNotification=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('job_queue')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    enableAutoRun=nil,
    pushNotification=nil,
    runNotification=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;

deleteNamespace

Delete namespace

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name

Result

TypeDescription
itemNamespaceDeleted namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &job_queue.DeleteNamespaceRequest {
        NamespaceName: pointy.String("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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\DeleteNamespaceRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName("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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.DeleteNamespaceRequest;
import io.gs2.jobQueue.result.DeleteNamespaceResult;

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

try {
    DeleteNamespaceResult result = client.deleteNamespace(
        new DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2JobQueue.Request.DeleteNamespaceRequest()
        .WithNamespaceName("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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.deleteNamespace(
        new Gs2JobQueue.DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.delete_namespace(
        job_queue.DeleteNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

api_result = client.delete_namespace({
    namespaceName="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('job_queue')

api_result_handler = client.delete_namespace_async({
    namespaceName="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;

getServiceVersion

Get version of microservice

Request

TypeConditionRequiredDefaultValue LimitsDescription

Result

TypeDescription
itemstringVersion

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.GetServiceVersion(
    &job_queue.GetServiceVersionRequest {
    }
)
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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\GetServiceVersionRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->getServiceVersion(
        (new GetServiceVersionRequest())
    );
    $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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.GetServiceVersionRequest;
import io.gs2.jobQueue.result.GetServiceVersionResult;

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

try {
    GetServiceVersionResult result = client.getServiceVersion(
        new GetServiceVersionRequest()
    );
    String item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
    new Gs2.Gs2JobQueue.Request.GetServiceVersionRequest(),
    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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.getServiceVersion(
        new Gs2JobQueue.GetServiceVersionRequest()
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.get_service_version(
        job_queue.GetServiceVersionRequest()
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

api_result = client.get_service_version({
})

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('job_queue')

api_result_handler = client.get_service_version_async({
})

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &job_queue.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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\DumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.DumpUserDataByUserIdRequest;
import io.gs2.jobQueue.result.DumpUserDataByUserIdResult;

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

try {
    DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
        new DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2JobQueue.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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.dumpUserDataByUserId(
        new Gs2JobQueue.DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.dump_user_data_by_user_id(
        job_queue.DumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

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('job_queue')

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL of output data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &job_queue.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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\CheckDumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.jobQueue.result.CheckDumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2JobQueueRestClient client = new Gs2JobQueueRestClient(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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2JobQueue.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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.checkDumpUserDataByUserId(
        new Gs2JobQueue.CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.check_dump_user_data_by_user_id(
        job_queue.CheckDumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

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('job_queue')

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &job_queue.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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\CleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.CleanUserDataByUserIdRequest;
import io.gs2.jobQueue.result.CleanUserDataByUserIdResult;

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

try {
    CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
        new CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2JobQueue.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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.cleanUserDataByUserId(
        new Gs2JobQueue.CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.clean_user_data_by_user_id(
        job_queue.CleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

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('job_queue')

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &job_queue.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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\CheckCleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.jobQueue.result.CheckCleanUserDataByUserIdResult;

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

try {
    CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
        new CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2JobQueue.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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.checkCleanUserDataByUserId(
        new Gs2JobQueue.CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.check_clean_user_data_by_user_id(
        job_queue.CheckCleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

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('job_queue')

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
uploadTokenstringToken used to reflect results after upload
uploadUrlstringURL used to upload user data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &job_queue.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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\PrepareImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.jobQueue.result.PrepareImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2JobQueueRestClient client = new Gs2JobQueueRestClient(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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2JobQueue.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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.prepareImportUserDataByUserId(
        new Gs2JobQueue.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 job_queue

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

try:
    result = client.prepare_import_user_data_by_user_id(
        job_queue.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('job_queue')

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('job_queue')

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser Id
uploadTokenstring
~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &job_queue.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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\ImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.ImportUserDataByUserIdRequest;
import io.gs2.jobQueue.result.ImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2JobQueueRestClient client = new Gs2JobQueueRestClient(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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2JobQueue.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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.importUserDataByUserId(
        new Gs2JobQueue.ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.import_user_data_by_user_id(
        job_queue.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('job_queue')

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('job_queue')

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

TypeConditionRequiredDefaultValue LimitsDescription
userIdstring
~ 128 charsUser Id
uploadTokenstring
~ 1024 charsToken received in preparation for upload
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
urlstringURL of log data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &job_queue.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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\CheckImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.CheckImportUserDataByUserIdRequest;
import io.gs2.jobQueue.result.CheckImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2JobQueueRestClient client = new Gs2JobQueueRestClient(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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2JobQueue.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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.checkImportUserDataByUserId(
        new Gs2JobQueue.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 job_queue

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

try:
    result = client.check_import_user_data_by_user_id(
        job_queue.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('job_queue')

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('job_queue')

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;

describeJobsByUserId

Get list of jobs

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
userIdstring
~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint
301 ~ 1000Number of data acquired
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<Job>List of Job
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.DescribeJobsByUserId(
    &job_queue.DescribeJobsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\DescribeJobsByUserIdRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->describeJobsByUserId(
        (new DescribeJobsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.DescribeJobsByUserIdRequest;
import io.gs2.jobQueue.result.DescribeJobsByUserIdResult;

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

try {
    DescribeJobsByUserIdResult result = client.describeJobsByUserId(
        new DescribeJobsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<Job> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.DescribeJobsByUserIdResult> asyncResult = null;
yield return client.DescribeJobsByUserId(
    new Gs2.Gs2JobQueue.Request.DescribeJobsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.describeJobsByUserId(
        new Gs2JobQueue.DescribeJobsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .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 job_queue

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

try:
    result = client.describe_jobs_by_user_id(
        job_queue.DescribeJobsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .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('job_queue')

api_result = client.describe_jobs_by_user_id({
    namespaceName="namespace-0001",
    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('job_queue')

api_result_handler = client.describe_jobs_by_user_id_async({
    namespaceName="namespace-0001",
    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;

getJobByUserId

Get Job

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
userIdstring
~ 128 charsUser Id
jobNamestring
UUID~ 36 charsJob Name
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemJobJob

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.GetJobByUserId(
    &job_queue.GetJobByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        JobName: pointy.String("job1"),
        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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\GetJobByUserIdRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->getJobByUserId(
        (new GetJobByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withJobName("job1")
            ->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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.GetJobByUserIdRequest;
import io.gs2.jobQueue.result.GetJobByUserIdResult;

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

try {
    GetJobByUserIdResult result = client.getJobByUserId(
        new GetJobByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withJobName("job1")
            .withTimeOffsetToken(null)
    );
    Job item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.GetJobByUserIdResult> asyncResult = null;
yield return client.GetJobByUserId(
    new Gs2.Gs2JobQueue.Request.GetJobByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithJobName("job1")
        .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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.getJobByUserId(
        new Gs2JobQueue.GetJobByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withJobName("job1")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.get_job_by_user_id(
        job_queue.GetJobByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_job_name('job1')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

api_result = client.get_job_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    jobName="job1",
    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('job_queue')

api_result_handler = client.get_job_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    jobName="job1",
    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;

pushByUserId

Push jobs by specifying a user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
userIdstring
~ 128 charsUser Id
jobsList<JobEntry>0 ~ 10 itemsList of Jobs
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemsList<Job>List of Jobs added
autoRunbool?

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.PushByUserId(
    &job_queue.PushByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        Jobs: []jobQueue.JobEntry{
            jobQueue.JobEntry{
                ScriptId: pointy.String("script-0001"),
                Args: pointy.String("{\"hoge\": \"fuga\"}"),
            },
            jobQueue.JobEntry{
                ScriptId: pointy.String("script-0001"),
                Args: pointy.String("{\"piyo\": \"piyopiyo\"}"),
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
autoRun := result.AutoRun
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\PushByUserIdRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->pushByUserId(
        (new PushByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withJobs([
                (new \Gs2\JobQueue\Model\JobEntry())
                    ->withScriptId("script-0001")
                    ->withArgs("{\"hoge\": \"fuga\"}"),
                (new \Gs2\JobQueue\Model\JobEntry())
                    ->withScriptId("script-0001")
                    ->withArgs("{\"piyo\": \"piyopiyo\"}"),
            ])
            ->withTimeOffsetToken(null)
    );
    $items = $result->getItems();
    $autoRun = $result->getAutoRun();
} 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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.PushByUserIdRequest;
import io.gs2.jobQueue.result.PushByUserIdResult;

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

try {
    PushByUserIdResult result = client.pushByUserId(
        new PushByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withJobs(Arrays.asList(
                new io.gs2.jobQueue.model.JobEntry()
                    .withScriptId("script-0001")
                    .withArgs("{\"hoge\": \"fuga\"}"),
                new io.gs2.jobQueue.model.JobEntry()
                    .withScriptId("script-0001")
                    .withArgs("{\"piyo\": \"piyopiyo\"}")
            ))
            .withTimeOffsetToken(null)
    );
    List<Job> items = result.getItems();
    boolean autoRun = result.getAutoRun();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.PushByUserIdResult> asyncResult = null;
yield return client.PushByUserId(
    new Gs2.Gs2JobQueue.Request.PushByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithJobs(new Gs2.Gs2JobQueue.Model.JobEntry[] {
            new Gs2.Gs2JobQueue.Model.JobEntry()
                .WithScriptId("script-0001")
                .WithArgs("{\"hoge\": \"fuga\"}"),
            new Gs2.Gs2JobQueue.Model.JobEntry()
                .WithScriptId("script-0001")
                .WithArgs("{\"piyo\": \"piyopiyo\"}"),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var autoRun = result.AutoRun;
import Gs2Core from '@/gs2/core';
import * as Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.pushByUserId(
        new Gs2JobQueue.PushByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withJobs([
                new Gs2JobQueue.JobEntry()
                    .withScriptId("script-0001")
                    .withArgs("{\"hoge\": \"fuga\"}"),
                new Gs2JobQueue.JobEntry()
                    .withScriptId("script-0001")
                    .withArgs("{\"piyo\": \"piyopiyo\"}"),
            ])
            .withTimeOffsetToken(null)
    );
    const items = result.getItems();
    const autoRun = result.getAutoRun();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.push_by_user_id(
        job_queue.PushByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_jobs([
                job_queue.JobEntry()
                    .with_script_id('script-0001')
                    .with_args('{"hoge": "fuga"}'),
                job_queue.JobEntry()
                    .with_script_id('script-0001')
                    .with_args('{"piyo": "piyopiyo"}'),
            ])
            .with_time_offset_token(None)
    )
    items = result.items
    auto_run = result.auto_run
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

api_result = client.push_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    jobs={
        {
            scriptId="script-0001",
            args="{\"hoge\": \"fuga\"}",
        },
        {
            scriptId="script-0001",
            args="{\"piyo\": \"piyopiyo\"}",
        }
    },
    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;
autoRun = result.autoRun;
client = gs2('job_queue')

api_result_handler = client.push_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    jobs={
        {
            scriptId="script-0001",
            args="{\"hoge\": \"fuga\"}",
        },
        {
            scriptId="script-0001",
            args="{\"piyo\": \"piyopiyo\"}",
        }
    },
    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;
autoRun = result.autoRun;

run

Execute Job

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
accessTokenstring
~ 128 charsAccess token

Result

TypeDescription
itemJobJob
resultJobResultBodyJob execution results
isLastJobbool?

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.Run(
    &job_queue.RunRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
result := result.Result
isLastJob := result.IsLastJob
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\RunRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->run(
        (new RunRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
    );
    $item = $result->getItem();
    $result = $result->getResult();
    $isLastJob = $result->getIsLastJob();
} 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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.RunRequest;
import io.gs2.jobQueue.result.RunResult;

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

try {
    RunResult result = client.run(
        new RunRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
    );
    Job item = result.getItem();
    JobResultBody result = result.getResult();
    boolean isLastJob = result.getIsLastJob();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.RunResult> asyncResult = null;
yield return client.Run(
    new Gs2.Gs2JobQueue.Request.RunRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var result = result.Result;
var isLastJob = result.IsLastJob;
import Gs2Core from '@/gs2/core';
import * as Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.run(
        new Gs2JobQueue.RunRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
    );
    const item = result.getItem();
    const result = result.getResult();
    const isLastJob = result.getIsLastJob();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.run(
        job_queue.RunRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
    )
    item = result.item
    result = result.result
    is_last_job = result.is_last_job
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

api_result = client.run({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
})

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

result = api_result.result
item = result.item;
result = result.result;
isLastJob = result.isLastJob;
client = gs2('job_queue')

api_result_handler = client.run_async({
    namespaceName="namespace-0001",
    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
item = result.item;
result = result.result;
isLastJob = result.isLastJob;

runByUserId

Execute a job by specifying a user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
userIdstring
~ 128 charsUser Id
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemJobJob
resultJobResultBodyJob execution results
isLastJobbool?

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.RunByUserId(
    &job_queue.RunByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
result := result.Result
isLastJob := result.IsLastJob
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\RunByUserIdRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->runByUserId(
        (new RunByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $result = $result->getResult();
    $isLastJob = $result->getIsLastJob();
} 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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.RunByUserIdRequest;
import io.gs2.jobQueue.result.RunByUserIdResult;

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

try {
    RunByUserIdResult result = client.runByUserId(
        new RunByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    Job item = result.getItem();
    JobResultBody result = result.getResult();
    boolean isLastJob = result.getIsLastJob();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.RunByUserIdResult> asyncResult = null;
yield return client.RunByUserId(
    new Gs2.Gs2JobQueue.Request.RunByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var result = result.Result;
var isLastJob = result.IsLastJob;
import Gs2Core from '@/gs2/core';
import * as Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.runByUserId(
        new Gs2JobQueue.RunByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const result = result.getResult();
    const isLastJob = result.getIsLastJob();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.run_by_user_id(
        job_queue.RunByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    item = result.item
    result = result.result
    is_last_job = result.is_last_job
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

api_result = client.run_by_user_id({
    namespaceName="namespace-0001",
    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
item = result.item;
result = result.result;
isLastJob = result.isLastJob;
client = gs2('job_queue')

api_result_handler = client.run_by_user_id_async({
    namespaceName="namespace-0001",
    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
item = result.item;
result = result.result;
isLastJob = result.isLastJob;

deleteJob

Delete job

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
accessTokenstring
~ 128 charsAccess token
jobNamestring
UUID~ 36 charsJob Name

Result

TypeDescription
itemJobDeleted Job

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.DeleteJob(
    &job_queue.DeleteJobRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        JobName: pointy.String("job1"),
    }
)
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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\DeleteJobRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->deleteJob(
        (new DeleteJobRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withJobName("job1")
    );
    $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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.DeleteJobRequest;
import io.gs2.jobQueue.result.DeleteJobResult;

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

try {
    DeleteJobResult result = client.deleteJob(
        new DeleteJobRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withJobName("job1")
    );
    Job item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.DeleteJobResult> asyncResult = null;
yield return client.DeleteJob(
    new Gs2.Gs2JobQueue.Request.DeleteJobRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithJobName("job1"),
    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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.deleteJob(
        new Gs2JobQueue.DeleteJobRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withJobName("job1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.delete_job(
        job_queue.DeleteJobRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_job_name('job1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

api_result = client.delete_job({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    jobName="job1",
})

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('job_queue')

api_result_handler = client.delete_job_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    jobName="job1",
})

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;

deleteJobByUserId

Delete job by specifying user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
userIdstring
~ 128 charsUser Id
jobNamestring
UUID~ 36 charsJob Name
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemJobDeleted Job

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.DeleteJobByUserId(
    &job_queue.DeleteJobByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        JobName: pointy.String("job1"),
        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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\DeleteJobByUserIdRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->deleteJobByUserId(
        (new DeleteJobByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withJobName("job1")
            ->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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.DeleteJobByUserIdRequest;
import io.gs2.jobQueue.result.DeleteJobByUserIdResult;

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

try {
    DeleteJobByUserIdResult result = client.deleteJobByUserId(
        new DeleteJobByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withJobName("job1")
            .withTimeOffsetToken(null)
    );
    Job item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.DeleteJobByUserIdResult> asyncResult = null;
yield return client.DeleteJobByUserId(
    new Gs2.Gs2JobQueue.Request.DeleteJobByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithJobName("job1")
        .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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.deleteJobByUserId(
        new Gs2JobQueue.DeleteJobByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withJobName("job1")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.delete_job_by_user_id(
        job_queue.DeleteJobByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_job_name('job1')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

api_result = client.delete_job_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    jobName="job1",
    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('job_queue')

api_result_handler = client.delete_job_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    jobName="job1",
    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;

getJobResult

Get Job execution result

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
accessTokenstring
~ 128 charsAccess token
jobNamestring
UUID~ 36 charsJob Name
tryNumberint0 ~ 10000Number of attempts

Result

TypeDescription
itemJobResultJob execution result

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.GetJobResult(
    &job_queue.GetJobResultRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        JobName: pointy.String("job-0001"),
        TryNumber: 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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\GetJobResultRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->getJobResult(
        (new GetJobResultRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withJobName("job-0001")
            ->withTryNumber(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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.GetJobResultRequest;
import io.gs2.jobQueue.result.GetJobResultResult;

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

try {
    GetJobResultResult result = client.getJobResult(
        new GetJobResultRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withJobName("job-0001")
            .withTryNumber(null)
    );
    JobResult item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.GetJobResultResult> asyncResult = null;
yield return client.GetJobResult(
    new Gs2.Gs2JobQueue.Request.GetJobResultRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithJobName("job-0001")
        .WithTryNumber(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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.getJobResult(
        new Gs2JobQueue.GetJobResultRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withJobName("job-0001")
            .withTryNumber(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.get_job_result(
        job_queue.GetJobResultRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_job_name('job-0001')
            .with_try_number(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

api_result = client.get_job_result({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    jobName="job-0001",
    tryNumber=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('job_queue')

api_result_handler = client.get_job_result_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    jobName="job-0001",
    tryNumber=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;

getJobResultByUserId

Get job execution results by specifying user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
userIdstring
~ 128 charsUser Id
jobNamestring
UUID~ 36 charsJob Name
tryNumberint0 ~ 10000Number of attempts
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemJobResultJob execution result

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/job_queue"
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 := job_queue.Gs2JobQueueRestClient{
    Session: &session,
}
result, err := client.GetJobResultByUserId(
    &job_queue.GetJobResultByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        JobName: pointy.String("job-0001"),
        TryNumber: nil,
        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\JobQueue\Gs2JobQueueRestClient;
use Gs2\JobQueue\Request\GetJobResultByUserIdRequest;

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

$session->open();

$client = new Gs2JobQueueRestClient(
    $session
);

try {
    $result = $client->getJobResultByUserId(
        (new GetJobResultByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withJobName("job-0001")
            ->withTryNumber(null)
            ->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.jobQueue.rest.Gs2JobQueueRestClient;
import io.gs2.jobQueue.request.GetJobResultByUserIdRequest;
import io.gs2.jobQueue.result.GetJobResultByUserIdResult;

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

try {
    GetJobResultByUserIdResult result = client.getJobResultByUserId(
        new GetJobResultByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withJobName("job-0001")
            .withTryNumber(null)
            .withTimeOffsetToken(null)
    );
    JobResult item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    ),
    Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2JobQueueRestClient(session);

AsyncResult<Gs2.Gs2JobQueue.Result.GetJobResultByUserIdResult> asyncResult = null;
yield return client.GetJobResultByUserId(
    new Gs2.Gs2JobQueue.Request.GetJobResultByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithJobName("job-0001")
        .WithTryNumber(null)
        .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 Gs2JobQueue from '@/gs2/jobQueue';

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

try {
    const result = await client.getJobResultByUserId(
        new Gs2JobQueue.GetJobResultByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withJobName("job-0001")
            .withTryNumber(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import job_queue

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

try:
    result = client.get_job_result_by_user_id(
        job_queue.GetJobResultByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_job_name('job-0001')
            .with_try_number(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('job_queue')

api_result = client.get_job_result_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    jobName="job-0001",
    tryNumber=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;
client = gs2('job_queue')

api_result_handler = client.get_job_result_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    jobName="job-0001",
    tryNumber=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;