API Reference of GS2-Version 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
* Automatically configured on the server
namestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction settings
assumeUserIdstring
~ 1024 charsGS2-Identifier user GRN to be promoted if the version check is passed
acceptVersionScriptScriptSettingScript to run when version is approved
checkVersionTriggerScriptIdstring~ 1024 charsGS2-Script script GRN to perform version checking process
logSettingLogSettingLog output settings
createdAtlong
✓*
NowDatetime of creation
Unix time, milliseconds
* Automatically configured on the server
updatedAtlong
✓*
NowDatetime of last update
Unix time, milliseconds
* Automatically configured on the server
revisionlong00 ~ 9223372036854775805Revision

TransactionSetting

Transaction settings

Transaction settings control how transactions are executed, their consistency, asynchronous processing, and conflict avoidance mechanisms. Combining features like AutoRun, AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, and asynchronous acquisition actions via GS2-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
* Required if enableAutoRun is true
transactionUseDistributorbool{enableAtomicCommit} == true
✓*
falseWhether to execute transactions asynchronously
* Required if enableAtomicCommit is true
commitScriptResultInUseDistributorbool{transactionUseDistributor} == true
✓*
falseWhether to execute the commit processing of the script result asynchronously
* Required if transactionUseDistributor is true
acquireActionUseJobQueuebool{enableAtomicCommit} == true
✓*
falseWhether to use GS2-JobQueue to execute the acquire action
* Required if enableAtomicCommit is true
distributorNamespaceIdstring
“grn:gs2:{region}:{ownerId}:distributor:default”~ 1024 charsGS2-Distributor namespace GRN used for transaction execution
queueNamespaceIdstring
“grn:gs2:{region}:{ownerId}:queue:default”~ 1024 charsNamespace GRN in GS2-JobQueue used to run the transaction

ScriptSetting

Script settings

In GS2, you can associate custom scripts with microservice events and execute them. This model holds the settings for triggering script execution.

There are two main ways to execute a script: synchronous execution and asynchronous execution. Synchronous execution blocks processing until the script has finished executing. Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API.

In contrast, asynchronous execution does not block processing until the script has finished executing. Since the script result cannot be used to stop the API execution or modify the API response, asynchronous execution does not affect the API’s response flow. For this reason, asynchronous execution is generally recommended.

There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge. By using Amazon EventBridge, you can write processing in languages other than Lua.

TypeConditionRequiredDefaultValue LimitsDescription
triggerScriptIdstring~ 1024 charsGS2-Script script GRN for synchronous execution
Must be specified in GRN format starting with “grn:gs2:”.
doneTriggerTargetTypeString Enum
enum {
  “none”,
  “gs2_script”,
  “aws”
}
“none”How to execute asynchronous scripts
Specifies the type of script to use for asynchronous execution.
You can choose from “Do not use asynchronous execution scripts (none)”, “Use GS2-Script (gs2_script)”, and “Use Amazon EventBridge (aws)”.
Enumerator String DefinitionDescription
“none”None
“gs2_script”GS2-Script
“aws”Amazon EventBridge
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsGS2-Script script GRN for Asynchronous Execution
Must be specified in GRN format starting with “grn:gs2:”.

* Enabled if doneTriggerTargetType is “gs2_script”
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsGS2-JobQueue namespace GRN to execute asynchronous execution scripts
If you want to execute asynchronous execution scripts via GS2-JobQueue instead of executing them directly, specify the GS2-JobQueue namespace GRN.
There is little reason to use GS2-JobQueue, so you don’t need to specify it unless you have a specific reason.

* Enabled if doneTriggerTargetType is “gs2_script”

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
Must be specified in GRN format starting with “grn:gs2:”.

GitHubCheckoutSetting

Setup to check out master data from GitHub

TypeConditionRequiredDefaultValue LimitsDescription
apiKeyIdstring
~ 1024 charsGitHub API key GRN
repositoryNamestring
~ 1024 charsRepository Name
sourcePathstring
~ 1024 charsMaster data (JSON) file path
referenceTypeString Enum
enum {
  “commit_hash”,
  “branch”,
  “tag”
}
Source of code
Enumerator String DefinitionDescription
“commit_hash”Commit hash
“branch”Branch
“tag”Tag
commitHashstring{referenceType} == “commit_hash”
✓*
~ 1024 charsCommit hash
* Required if referenceType is “commit_hash”
branchNamestring{referenceType} == “branch”
✓*
~ 1024 charsBranch Name
* Required if referenceType is “branch”
tagNamestring{referenceType} == “tag”
✓*
~ 1024 charsTag Name
* Required if referenceType is “tag”

AcceptVersion

Approved Version

Not a version tied to data, such as an app version or asset version. Used for entities that require version control on a per-user basis, such as a version of an agreed upon Terms of Use.

TypeConditionRequiredDefaultValue LimitsDescription
acceptVersionIdstring
✓*
~ 1024 charsApproved Version GRN
* Automatically configured on the server
versionNamestring
~ 128 charsVersion Name
userIdstring
~ 128 charsUser ID
versionVersion
Version
statusString Enum
enum {
  “accept”,
  “reject”
}
“accept”Status
Enumerator String DefinitionDescription
“accept”Accepted
“reject”Rejected
createdAtlong
✓*
NowDatetime of creation
Unix time, milliseconds
* Automatically configured on the server
updatedAtlong
✓*
NowDatetime of last update
Unix time, milliseconds
* Automatically configured on the server
revisionlong00 ~ 9223372036854775805Revision

VersionModel

Version Model

You can set a warning version that accepts login but notifies you that you can upgrade, and an error version that does not accept login.

You can specify whether or not to have the client declare the current version with or without a signature. If you select signed, the client will not be able to declare a false version.

TypeConditionRequiredDefaultValue LimitsDescription
versionModelIdstring
✓*
~ 1024 charsVersion Model GRN
* Automatically configured on the server
namestring
~ 128 charsVersion Model Name
Version model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 2048 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
scopeString Enum
enum {
  “passive”,
  “active”
}
Type of version value used for judgment
Enumerator String DefinitionDescription
“passive”Sent by Client
“active”Version explicitly approved in the past
typeString Enum
enum {
  “simple”,
  “schedule”
}
“simple”Version Check Mode
Enumerator String DefinitionDescription
“simple”Simple
“schedule”Schedule Change
currentVersionVersion{type} == “simple” and {scope} == “active”
✓*
Current Version
* Required if type is “simple” and scope is “active”
warningVersionVersion{type} == “simple”
✓*
Version that prompts for version upgrade
* Required if type is “simple”
errorVersionVersion{type} == “simple”
✓*
Version that is determined to be an error by the version check
* Required if type is “simple”
scheduleVersionsList<ScheduleVersion>{type} == “schedule”0 ~ 10 itemsList of Version check content that switches over time series
* Enabled if type is “schedule”
needSignaturebool{scope} == “passive”
✓*
Whether the version value to be determined requires signature verification
* Required if scope is “passive”
signatureKeyIdstring{needSignature}
✓*
~ 1024 charsencryption key GRN
* Required if needSignature is “true”
approveRequirementString Enum
enum {
  “required”,
  “optional”
}
{scope} == “active”
✓*
“required”Requirement for approval
Enumerator String DefinitionDescription
“required”Approval required
“optional”Any approval

* Required if scope is “active”

Status

Version Status

Indicates the result of version verification.

TypeConditionRequiredDefaultValue LimitsDescription
versionModelVersionModel
Version Model
currentVersionVersionCurrent Version

TargetVersion

Version to be verified

TypeConditionRequiredDefaultValue LimitsDescription
versionNamestring
~ 128 charsVersion Model Name
Version model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
bodystring~ 1048576 charsBody
signaturestring~ 256 charsSignature
versionVersion{signature} == ""
✓*
Version
* Required if signature is “"

SignTargetVersion

Sign Target Version

TypeConditionRequiredDefaultValue LimitsDescription
regionstring
~ 128 charsRegion
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
versionNamestring
~ 128 charsVersion Model Name
Version model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
versionVersion
Version

Version

Version

TypeConditionRequiredDefaultValue LimitsDescription
majorint
0 ~ 2147483646Major version
minorint
0 ~ 2147483646Minor version
microint
0 ~ 2147483646Micro version

ScheduleVersion

Version that switches in chronological order

TypeConditionRequiredDefaultValue LimitsDescription
currentVersionVersion
Current Version
warningVersionVersion
Version that prompts for version upgrade
errorVersionVersion
Version that is determined to be an error by the version check
scheduleEventIdstring~ 1024 charsGS2-Schedule event GRN that enables version check

CurrentVersionMaster

Currently Active Master Data

Currently active master data describing the version model definitions within the namespace. GS2 uses JSON format files for managing master data. By uploading these files, the master data settings are updated on the server.

To create JSON files, GS2 provides a master data editor within the management console. Additionally, you can create tools better suited for operating your game and export JSON files in the appropriate format.

TypeConditionRequiredDefaultValue LimitsDescription
namespaceIdstring
✓*
~ 1024 charsNamespace GRN
* Automatically configured on the server
settingsstring
~ 5242880 bytes (5MB)Master Data

VersionModelMaster

Version Model Master

Version Model Master is data used to edit and manage version model within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as version model actually referenced by the game.

For version models, you can configure a warning version that accepts logins but notifies users that an upgrade is available, and an error version that does not accept logins.

You can specify whether or not to have the client declare the current version with or without a signature. If you select signed, the client will not be able to declare a false version.

TypeConditionRequiredDefaultValue LimitsDescription
versionModelIdstring
✓*
~ 1024 charsVersion Master GRN
* Automatically configured on the server
namestring
~ 128 charsVersion Model Name
Version model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
scopeString Enum
enum {
  “passive”,
  “active”
}
Type of version value used for judgment
Enumerator String DefinitionDescription
“passive”Sent by Client
“active”Version explicitly approved in the past
typeString Enum
enum {
  “simple”,
  “schedule”
}
“simple”Version Check Mode
Enumerator String DefinitionDescription
“simple”Simple
“schedule”Schedule Change
currentVersionVersion{type} == “simple” and {scope} == “active”
✓*
Current Version
* Required if type is “simple” and scope is “active”
warningVersionVersion{type} == “simple”
✓*
Version that prompts for version upgrade
* Required if type is “simple”
errorVersionVersion{type} == “simple”
✓*
Version that is determined to be an error by the version check
* Required if type is “simple”
scheduleVersionsList<ScheduleVersion>{type} == “schedule”0 ~ 10 itemsList of Version check content that switches over time series
* Enabled if type is “schedule”
needSignaturebool{scope} == “passive”
✓*
Whether the version value to be determined requires signature verification
* Required if scope is “passive”
signatureKeyIdstring{needSignature}
✓*
~ 1024 charsencryption key GRN
* Required if needSignature is “true”
approveRequirementString Enum
enum {
  “required”,
  “optional”
}
{scope} == “active”
✓*
“required”Requirement for approval
Enumerator String DefinitionDescription
“required”Approval required
“optional”Any approval

* Required if scope is “active”
createdAtlong
✓*
NowDatetime of creation
Unix time, milliseconds
* Automatically configured on the server
updatedAtlong
✓*
NowDatetime of last update
Unix time, milliseconds
* Automatically configured on the server
revisionlong00 ~ 9223372036854775805Revision

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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DescribeNamespacesRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DescribeNamespacesRequest;
import io.gs2.version.result.DescribeNamespacesResult;

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

AsyncResult<Gs2.Gs2Version.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Version.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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.describeNamespaces(
        new Gs2Version.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 version

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

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

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['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('version')

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['errorMessage'])
end

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

createNamespace

Create a new namespace

Request

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction settings
assumeUserIdstring
~ 1024 charsGS2-Identifier user GRN to be promoted if the version check is passed
acceptVersionScriptScriptSettingScript to run when version is approved
checkVersionTriggerScriptIdstring~ 1024 charsGS2-Script script GRN to perform version checking process
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceNamespace created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &version.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSetting: nil,
        AssumeUserId: pointy.String("grn:gs2::YourOwnerId:identifier:user:user-0001"),
        AcceptVersionScript: nil,
        CheckVersionTriggerScriptId: nil,
        LogSetting: &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            ->withAcceptVersionScript(null)
            ->withCheckVersionTriggerScriptId(null)
            ->withLogSetting((new \Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CreateNamespaceRequest;
import io.gs2.version.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            .withAcceptVersionScript(null)
            .withCheckVersionTriggerScriptId(null)
            .withLogSetting(new io.gs2.version.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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Version.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
        .WithAcceptVersionScript(null)
        .WithCheckVersionTriggerScriptId(null)
        .WithLogSetting(new Gs2.Gs2Version.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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.createNamespace(
        new Gs2Version.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0001")
            .withAcceptVersionScript(null)
            .withCheckVersionTriggerScriptId(null)
            .withLogSetting(new Gs2Version.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.create_namespace(
        version.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting(None)
            .with_assume_user_id('grn:gs2::YourOwnerId:identifier:user:user-0001')
            .with_accept_version_script(None)
            .with_check_version_trigger_script_id(None)
            .with_log_setting(
                version.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('version')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    assumeUserId="grn:gs2::YourOwnerId:identifier:user:user-0001",
    acceptVersionScript=nil,
    checkVersionTriggerScriptId=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['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting=nil,
    assumeUserId="grn:gs2::YourOwnerId:identifier:user:user-0001",
    acceptVersionScript=nil,
    checkVersionTriggerScriptId=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['errorMessage'])
end

result = api_result.result
item = result.item;

getNamespaceStatus

Get namespace status

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
statusstring

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\GetNamespaceStatusRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetNamespaceStatusRequest;
import io.gs2.version.result.GetNamespaceStatusResult;

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

AsyncResult<Gs2.Gs2Version.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Version.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 Gs2Version from '@/gs2/version';

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

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

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

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

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

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

result = api_result.result
status = result.status;
client = gs2('version')

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['errorMessage'])
end

result = api_result.result
status = result.status;

getNamespace

Get namespace

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemNamespaceNamespace

Implementation Example

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

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

$session->open();

$client = new Gs2VersionRestClient(
    $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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetNamespaceRequest;
import io.gs2.version.result.GetNamespaceResult;

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

AsyncResult<Gs2.Gs2Version.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Version.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 Gs2Version from '@/gs2/version';

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

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

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

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

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

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

result = api_result.result
item = result.item;
client = gs2('version')

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['errorMessage'])
end

result = api_result.result
item = result.item;

updateNamespace

Update namespace

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
transactionSettingTransactionSettingTransaction settings
assumeUserIdstring
~ 1024 charsGS2-Identifier user GRN to be promoted if the version check is passed
acceptVersionScriptScriptSettingScript to run when version is approved
checkVersionTriggerScriptIdstring~ 1024 charsGS2-Script script GRN to perform version checking process
logSettingLogSettingLog output settings

Result

TypeDescription
itemNamespaceUpdated namespace

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &version.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        AssumeUserId: pointy.String("grn:gs2::YourOwnerId:identifier:user:user-0002"),
        AcceptVersionScript: nil,
        CheckVersionTriggerScriptId: nil,
        LogSetting: &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0002")
            ->withAcceptVersionScript(null)
            ->withCheckVersionTriggerScriptId(null)
            ->withLogSetting((new \Gs2\Version\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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.UpdateNamespaceRequest;
import io.gs2.version.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0002")
            .withAcceptVersionScript(null)
            .withCheckVersionTriggerScriptId(null)
            .withLogSetting(new io.gs2.version.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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Version.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0002")
        .WithAcceptVersionScript(null)
        .WithCheckVersionTriggerScriptId(null)
        .WithLogSetting(new Gs2.Gs2Version.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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.updateNamespace(
        new Gs2Version.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withAssumeUserId("grn:gs2::YourOwnerId:identifier:user:user-0002")
            .withAcceptVersionScript(null)
            .withCheckVersionTriggerScriptId(null)
            .withLogSetting(new Gs2Version.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.update_namespace(
        version.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(None)
            .with_assume_user_id('grn:gs2::YourOwnerId:identifier:user:user-0002')
            .with_accept_version_script(None)
            .with_check_version_trigger_script_id(None)
            .with_log_setting(
                version.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('version')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    assumeUserId="grn:gs2::YourOwnerId:identifier:user:user-0002",
    acceptVersionScript=nil,
    checkVersionTriggerScriptId=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['errorMessage'])
end

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=nil,
    assumeUserId="grn:gs2::YourOwnerId:identifier:user:user-0002",
    acceptVersionScript=nil,
    checkVersionTriggerScriptId=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['errorMessage'])
end

result = api_result.result
item = result.item;

deleteNamespace

Delete namespace

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemNamespaceDeleted namespace

Implementation Example

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

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

$session->open();

$client = new Gs2VersionRestClient(
    $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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DeleteNamespaceRequest;
import io.gs2.version.result.DeleteNamespaceResult;

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

AsyncResult<Gs2.Gs2Version.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Version.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 Gs2Version from '@/gs2/version';

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

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

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

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

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

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

result = api_result.result
item = result.item;
client = gs2('version')

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['errorMessage'])
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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetServiceVersion(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\GetServiceVersionRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetServiceVersionRequest;
import io.gs2.version.result.GetServiceVersionResult;

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

AsyncResult<Gs2.Gs2Version.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
    new Gs2.Gs2Version.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 Gs2Version from '@/gs2/version';

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

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

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

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

api_result = client.get_service_version({
})

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

result = api_result.result
item = result.item;
client = gs2('version')

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['errorMessage'])
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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DumpUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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['errorMessage'])
end

result = api_result.result
client = gs2('version')

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['errorMessage'])
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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CheckDumpUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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['errorMessage'])
end

result = api_result.result
url = result.url;
client = gs2('version')

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['errorMessage'])
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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CleanUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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['errorMessage'])
end

result = api_result.result
client = gs2('version')

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['errorMessage'])
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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CheckCleanUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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['errorMessage'])
end

result = api_result.result
client = gs2('version')

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['errorMessage'])
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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\PrepareImportUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('version')

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['errorMessage'])
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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\ImportUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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['errorMessage'])
end

result = api_result.result
client = gs2('version')

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['errorMessage'])
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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &version.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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CheckImportUserDataByUserIdRequest;

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

$session->open();

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

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

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

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

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

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

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

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['errorMessage'])
end

result = api_result.result
url = result.url;
client = gs2('version')

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['errorMessage'])
end

result = api_result.result
url = result.url;

describeAcceptVersions

Get list of approved versions

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint
301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<AcceptVersion>List of Approved Versions
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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DescribeAcceptVersions(
    &version.DescribeAcceptVersionsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DescribeAcceptVersionsRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->describeAcceptVersions(
        (new DescribeAcceptVersionsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DescribeAcceptVersionsRequest;
import io.gs2.version.result.DescribeAcceptVersionsResult;

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

try {
    DescribeAcceptVersionsResult result = client.describeAcceptVersions(
        new DescribeAcceptVersionsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<AcceptVersion> 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DescribeAcceptVersionsResult> asyncResult = null;
yield return client.DescribeAcceptVersions(
    new Gs2.Gs2Version.Request.DescribeAcceptVersionsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.describeAcceptVersions(
        new Gs2Version.DescribeAcceptVersionsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.describe_accept_versions(
        version.DescribeAcceptVersionsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.describe_accept_versions({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('version')

api_result_handler = client.describe_accept_versions_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    pageToken=nil,
    limit=nil,
})

api_result = api_result_handler()  -- Call the handler to get the result

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

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

describeAcceptVersionsByUserId

Get list of approved versions

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
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<AcceptVersion>List of Approved Versions
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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DescribeAcceptVersionsByUserId(
    &version.DescribeAcceptVersionsByUserIdRequest {
        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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DescribeAcceptVersionsByUserIdRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->describeAcceptVersionsByUserId(
        (new DescribeAcceptVersionsByUserIdRequest())
            ->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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DescribeAcceptVersionsByUserIdRequest;
import io.gs2.version.result.DescribeAcceptVersionsByUserIdResult;

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

try {
    DescribeAcceptVersionsByUserIdResult result = client.describeAcceptVersionsByUserId(
        new DescribeAcceptVersionsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<AcceptVersion> 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DescribeAcceptVersionsByUserIdResult> asyncResult = null;
yield return client.DescribeAcceptVersionsByUserId(
    new Gs2.Gs2Version.Request.DescribeAcceptVersionsByUserIdRequest()
        .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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.describeAcceptVersionsByUserId(
        new Gs2Version.DescribeAcceptVersionsByUserIdRequest()
            .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 version

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

try:
    result = client.describe_accept_versions_by_user_id(
        version.DescribeAcceptVersionsByUserIdRequest()
            .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('version')

api_result = client.describe_accept_versions_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['errorMessage'])
end

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('version')

api_result_handler = client.describe_accept_versions_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['errorMessage'])
end

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

accept

Approve current version

When using this function in terms of service, if the server’s current version is updated while the user is confirming the terms of service, an error will occur. Therefore, please specify the version you are trying to agree to in the version argument.

If you do not specify a version, the approval will be made with the latest version, and if there is an argument version specified and that version meets the error version condition, an error will occur. Even if the conditions other than the error version are met, the API will succeed and the client will be considered to have approved the version specified by the client.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
versionNamestring
~ 128 charsVersion Name
accessTokenstring
~ 128 charsAccess token
versionVersionApproved Version

Result

TypeDescription
itemAcceptVersionApproved Version

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.Accept(
    &version.AcceptRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("eula"),
        AccessToken: pointy.String("accessToken-0001"),
        Version: &version.Version{
            Major: pointy.Int32(2),
            Minor: pointy.Int32(2),
            Micro: pointy.Int32(2),
        },
    }
)
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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\AcceptRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->accept(
        (new AcceptRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("eula")
            ->withAccessToken("accessToken-0001")
            ->withVersion((new \Gs2\Version\Model\Version())
                ->withMajor(2)
                ->withMinor(2)
                ->withMicro(2))
    );
    $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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.AcceptRequest;
import io.gs2.version.result.AcceptResult;

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

try {
    AcceptResult result = client.accept(
        new AcceptRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("eula")
            .withAccessToken("accessToken-0001")
            .withVersion(new io.gs2.version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.AcceptResult> asyncResult = null;
yield return client.Accept(
    new Gs2.Gs2Version.Request.AcceptRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("eula")
        .WithAccessToken("accessToken-0001")
        .WithVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(2)
            .WithMinor(2)
            .WithMicro(2)),
    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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.accept(
        new Gs2Version.AcceptRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("eula")
            .withAccessToken("accessToken-0001")
            .withVersion(new Gs2Version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.accept(
        version.AcceptRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('eula')
            .with_access_token('accessToken-0001')
            .with_version(
                version.Version()
                    .with_major(2)
                    .with_minor(2)
                    .with_micro(2))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.accept({
    namespaceName="namespace-0001",
    versionName="eula",
    accessToken="accessToken-0001",
    version={
        major=2,
        minor=2,
        micro=2,
    },
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.accept_async({
    namespaceName="namespace-0001",
    versionName="eula",
    accessToken="accessToken-0001",
    version={
        major=2,
        minor=2,
        micro=2,
    },
})

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['errorMessage'])
end

result = api_result.result
item = result.item;

acceptByUserId

Approve current version with user ID

When using this function in terms of service, if the server’s current version is updated while the user is confirming the terms of service, an error will occur. Therefore, please specify the version you are trying to agree to in the version argument.

If you do not specify a version, the approval will be made with the latest version, and if there is an argument version specified and that version meets the error version condition, an error will occur. Even if the conditions other than the error version are met, the API will succeed and the client will be considered to have approved the version specified by the client.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
versionNamestring
~ 128 charsVersion Name
userIdstring
~ 128 charsUser ID
versionVersionApproved Version
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemAcceptVersionApproved Version

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.AcceptByUserId(
    &version.AcceptByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-0001"),
        UserId: pointy.String("user-0001"),
        Version: 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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\AcceptByUserIdRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->acceptByUserId(
        (new AcceptByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-0001")
            ->withUserId("user-0001")
            ->withVersion(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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.AcceptByUserIdRequest;
import io.gs2.version.result.AcceptByUserIdResult;

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

try {
    AcceptByUserIdResult result = client.acceptByUserId(
        new AcceptByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withUserId("user-0001")
            .withVersion(null)
            .withTimeOffsetToken(null)
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.AcceptByUserIdResult> asyncResult = null;
yield return client.AcceptByUserId(
    new Gs2.Gs2Version.Request.AcceptByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-0001")
        .WithUserId("user-0001")
        .WithVersion(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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.acceptByUserId(
        new Gs2Version.AcceptByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withUserId("user-0001")
            .withVersion(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.accept_by_user_id(
        version.AcceptByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
            .with_user_id('user-0001')
            .with_version(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.accept_by_user_id({
    namespaceName="namespace-0001",
    versionName="version-0001",
    userId="user-0001",
    version=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.accept_by_user_id_async({
    namespaceName="namespace-0001",
    versionName="version-0001",
    userId="user-0001",
    version=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['errorMessage'])
end

result = api_result.result
item = result.item;

reject

Reject current version

Used to record that the current version has been rejected in terms of service that do not require approval. The VersionModel’s approveRequirement must be optional to call this API.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
versionNamestring
~ 128 charsVersion Name
accessTokenstring
~ 128 charsAccess token
versionVersionRejected Version

Result

TypeDescription
itemAcceptVersionRejected Version

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.Reject(
    &version.RejectRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Version: 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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\RejectRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->reject(
        (new RejectRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-0001")
            ->withAccessToken("accessToken-0001")
            ->withVersion(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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.RejectRequest;
import io.gs2.version.result.RejectResult;

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

try {
    RejectResult result = client.reject(
        new RejectRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withAccessToken("accessToken-0001")
            .withVersion(null)
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.RejectResult> asyncResult = null;
yield return client.Reject(
    new Gs2.Gs2Version.Request.RejectRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-0001")
        .WithAccessToken("accessToken-0001")
        .WithVersion(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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.reject(
        new Gs2Version.RejectRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withAccessToken("accessToken-0001")
            .withVersion(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.reject(
        version.RejectRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
            .with_access_token('accessToken-0001')
            .with_version(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.reject({
    namespaceName="namespace-0001",
    versionName="version-0001",
    accessToken="accessToken-0001",
    version=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.reject_async({
    namespaceName="namespace-0001",
    versionName="version-0001",
    accessToken="accessToken-0001",
    version=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['errorMessage'])
end

result = api_result.result
item = result.item;

rejectByUserId

Reject current version with user ID

Used to record that the current version has been rejected in terms of service that do not require approval. The VersionModel’s approveRequirement must be optional to call this API.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
versionNamestring
~ 128 charsVersion Name
userIdstring
~ 128 charsUser ID
versionVersionRejected Version
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemAcceptVersionRejected Version

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.RejectByUserId(
    &version.RejectByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-0001"),
        UserId: pointy.String("user-0001"),
        Version: 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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\RejectByUserIdRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->rejectByUserId(
        (new RejectByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-0001")
            ->withUserId("user-0001")
            ->withVersion(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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.RejectByUserIdRequest;
import io.gs2.version.result.RejectByUserIdResult;

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

try {
    RejectByUserIdResult result = client.rejectByUserId(
        new RejectByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withUserId("user-0001")
            .withVersion(null)
            .withTimeOffsetToken(null)
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.RejectByUserIdResult> asyncResult = null;
yield return client.RejectByUserId(
    new Gs2.Gs2Version.Request.RejectByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-0001")
        .WithUserId("user-0001")
        .WithVersion(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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.rejectByUserId(
        new Gs2Version.RejectByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withUserId("user-0001")
            .withVersion(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.reject_by_user_id(
        version.RejectByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
            .with_user_id('user-0001')
            .with_version(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.reject_by_user_id({
    namespaceName="namespace-0001",
    versionName="version-0001",
    userId="user-0001",
    version=nil,
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.reject_by_user_id_async({
    namespaceName="namespace-0001",
    versionName="version-0001",
    userId="user-0001",
    version=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['errorMessage'])
end

result = api_result.result
item = result.item;

getAcceptVersion

Get approved version

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
versionNamestring
~ 128 charsVersion Name

Result

TypeDescription
itemAcceptVersionApproved Version

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetAcceptVersion(
    &version.GetAcceptVersionRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        VersionName: pointy.String("eula"),
    }
)
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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\GetAcceptVersionRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->getAcceptVersion(
        (new GetAcceptVersionRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withVersionName("eula")
    );
    $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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetAcceptVersionRequest;
import io.gs2.version.result.GetAcceptVersionResult;

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

try {
    GetAcceptVersionResult result = client.getAcceptVersion(
        new GetAcceptVersionRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withVersionName("eula")
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.GetAcceptVersionResult> asyncResult = null;
yield return client.GetAcceptVersion(
    new Gs2.Gs2Version.Request.GetAcceptVersionRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithVersionName("eula"),
    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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.getAcceptVersion(
        new Gs2Version.GetAcceptVersionRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withVersionName("eula")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.get_accept_version(
        version.GetAcceptVersionRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_version_name('eula')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.get_accept_version({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    versionName="eula",
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.get_accept_version_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    versionName="eula",
})

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['errorMessage'])
end

result = api_result.result
item = result.item;

getAcceptVersionByUserId

Get approved version by specifying user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
versionNamestring
~ 128 charsVersion Name
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemAcceptVersionApproved Version

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetAcceptVersionByUserId(
    &version.GetAcceptVersionByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        VersionName: pointy.String("version-0001"),
        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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\GetAcceptVersionByUserIdRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->getAcceptVersionByUserId(
        (new GetAcceptVersionByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withVersionName("version-0001")
            ->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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetAcceptVersionByUserIdRequest;
import io.gs2.version.result.GetAcceptVersionByUserIdResult;

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

try {
    GetAcceptVersionByUserIdResult result = client.getAcceptVersionByUserId(
        new GetAcceptVersionByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withVersionName("version-0001")
            .withTimeOffsetToken(null)
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.GetAcceptVersionByUserIdResult> asyncResult = null;
yield return client.GetAcceptVersionByUserId(
    new Gs2.Gs2Version.Request.GetAcceptVersionByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithVersionName("version-0001")
        .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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.getAcceptVersionByUserId(
        new Gs2Version.GetAcceptVersionByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withVersionName("version-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.get_accept_version_by_user_id(
        version.GetAcceptVersionByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_version_name('version-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.get_accept_version_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    versionName="version-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.get_accept_version_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    versionName="version-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['errorMessage'])
end

result = api_result.result
item = result.item;

deleteAcceptVersion

Delete approved version

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
versionNamestring
~ 128 charsVersion Name

Result

TypeDescription
itemAcceptVersionDeleted approved version

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DeleteAcceptVersion(
    &version.DeleteAcceptVersionRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        VersionName: pointy.String("eula"),
    }
)
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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DeleteAcceptVersionRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->deleteAcceptVersion(
        (new DeleteAcceptVersionRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withVersionName("eula")
    );
    $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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DeleteAcceptVersionRequest;
import io.gs2.version.result.DeleteAcceptVersionResult;

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

try {
    DeleteAcceptVersionResult result = client.deleteAcceptVersion(
        new DeleteAcceptVersionRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withVersionName("eula")
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DeleteAcceptVersionResult> asyncResult = null;
yield return client.DeleteAcceptVersion(
    new Gs2.Gs2Version.Request.DeleteAcceptVersionRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithVersionName("eula"),
    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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.deleteAcceptVersion(
        new Gs2Version.DeleteAcceptVersionRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withVersionName("eula")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.delete_accept_version(
        version.DeleteAcceptVersionRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_version_name('eula')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.delete_accept_version({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    versionName="eula",
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.delete_accept_version_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    versionName="eula",
})

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['errorMessage'])
end

result = api_result.result
item = result.item;

deleteAcceptVersionByUserId

Delete approved version with user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
versionNamestring
~ 128 charsVersion Name
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
itemAcceptVersionDeleted approved version

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DeleteAcceptVersionByUserId(
    &version.DeleteAcceptVersionByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        VersionName: pointy.String("version-0001"),
        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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DeleteAcceptVersionByUserIdRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->deleteAcceptVersionByUserId(
        (new DeleteAcceptVersionByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withVersionName("version-0001")
            ->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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DeleteAcceptVersionByUserIdRequest;
import io.gs2.version.result.DeleteAcceptVersionByUserIdResult;

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

try {
    DeleteAcceptVersionByUserIdResult result = client.deleteAcceptVersionByUserId(
        new DeleteAcceptVersionByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withVersionName("version-0001")
            .withTimeOffsetToken(null)
    );
    AcceptVersion 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DeleteAcceptVersionByUserIdResult> asyncResult = null;
yield return client.DeleteAcceptVersionByUserId(
    new Gs2.Gs2Version.Request.DeleteAcceptVersionByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithVersionName("version-0001")
        .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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.deleteAcceptVersionByUserId(
        new Gs2Version.DeleteAcceptVersionByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withVersionName("version-0001")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.delete_accept_version_by_user_id(
        version.DeleteAcceptVersionByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_version_name('version-0001')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.delete_accept_version_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    versionName="version-0001",
    timeOffsetToken=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.delete_accept_version_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    versionName="version-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['errorMessage'])
end

result = api_result.result
item = result.item;

checkVersion

Check Version

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessTokenstring
~ 128 charsAccess token
targetVersionsList<TargetVersion>[]0 ~ 1000 itemsList of Versions to be verified

Result

TypeDescription
projectTokenstringSigned in to the project token.
warningsList<Status>Version Verification Results List of Warnings
errorsList<Status>Version Verification Results List of errors

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CheckVersion(
    &version.CheckVersionRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        TargetVersions: []version.TargetVersion{
            version.TargetVersion{
                VersionName: pointy.String("app"),
                Version: &version.Version{
                    Major: pointy.Int32(1),
                    Minor: pointy.Int32(2),
                    Micro: pointy.Int32(3),
                },
            },
            version.TargetVersion{
                VersionName: pointy.String("asset"),
                Version: &version.Version{
                    Major: pointy.Int32(1),
                    Minor: pointy.Int32(2),
                    Micro: pointy.Int32(3),
                },
            },
        },
    }
)
if err != nil {
    panic("error occurred")
}
projectToken := result.ProjectToken
warnings := result.Warnings
errors := result.Errors
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CheckVersionRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->checkVersion(
        (new CheckVersionRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withTargetVersions([
                (new TargetVersion())
                    ->withVersionName("app")
                    ->withVersion(
                    (new Version())
                        ->withMajor(1)
                        ->withMinor(2)
                        ->withMicro(3)
                    ),
                (new TargetVersion())
                    ->withVersionName("asset")
                    ->withVersion(
                    (new Version())
                        ->withMajor(1)
                        ->withMinor(2)
                        ->withMicro(3)
                    ),
            ])
    );
    $projectToken = $result->getProjectToken();
    $warnings = $result->getWarnings();
    $errors = $result->getErrors();
} 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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CheckVersionRequest;
import io.gs2.version.result.CheckVersionResult;

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

try {
    CheckVersionResult result = client.checkVersion(
        new CheckVersionRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withTargetVersions(Arrays.asList(
                new TargetVersion()
                    .withVersionName("app")
                    .withVersion(
                    new Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    ),
                new TargetVersion()
                    .withVersionName("asset")
                    .withVersion(
                    new Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    )
            ))
    );
    String projectToken = result.getProjectToken();
    List<Status> warnings = result.getWarnings();
    List<Status> errors = result.getErrors();
} 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.CheckVersionResult> asyncResult = null;
yield return client.CheckVersion(
    new Gs2.Gs2Version.Request.CheckVersionRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithTargetVersions(new Gs2.Gs2Version.Model.TargetVersion[] {
            new Gs2.Gs2Version.Model.TargetVersion()
                .WithVersionName("app")
                .WithVersion(
                new Gs2.Gs2Version.Model.Version_()
                    .WithMajor(1)
                    .WithMinor(2)
                    .WithMicro(3)
                ),
            new Gs2.Gs2Version.Model.TargetVersion()
                .WithVersionName("asset")
                .WithVersion(
                new Gs2.Gs2Version.Model.Version_()
                    .WithMajor(1)
                    .WithMinor(2)
                    .WithMicro(3)
                ),
        }),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var projectToken = result.ProjectToken;
var warnings = result.Warnings;
var errors = result.Errors;
import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.checkVersion(
        new Gs2Version.CheckVersionRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withTargetVersions([
                new Gs2Version.model.TargetVersion()
                    .withVersionName("app")
                    .withVersion(
                    new Gs2Version.model.Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    ),
                new Gs2Version.model.TargetVersion()
                    .withVersionName("asset")
                    .withVersion(
                    new Gs2Version.model.Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    ),
            ])
    );
    const projectToken = result.getProjectToken();
    const warnings = result.getWarnings();
    const errors = result.getErrors();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.check_version(
        version.CheckVersionRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_target_versions([
                version.TargetVersion()
                    .with_version_name('app')
                    .with_version(
                    version.Version()
                        .with_major(1)
                        .with_minor(2)
                        .with_micro(3)
                    ),
                version.TargetVersion()
                    .with_version_name('asset')
                    .with_version(
                    version.Version()
                        .with_major(1)
                        .with_minor(2)
                        .with_micro(3)
                    ),
            ])
    )
    project_token = result.project_token
    warnings = result.warnings
    errors = result.errors
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.check_version({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    targetVersions={
        {
            version_name="app",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        },
        {
            version_name="asset",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        }
    },
})

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

result = api_result.result
projectToken = result.projectToken;
warnings = result.warnings;
errors = result.errors;
client = gs2('version')

api_result_handler = client.check_version_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    targetVersions={
        {
            version_name="app",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        },
        {
            version_name="asset",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        }
    },
})

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['errorMessage'])
end

result = api_result.result
projectToken = result.projectToken;
warnings = result.warnings;
errors = result.errors;

checkVersionByUserId

Check Version by user ID

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
targetVersionsList<TargetVersion>[]0 ~ 1000 itemsList of Versions to be verified
timeOffsetTokenstring~ 1024 charsTime offset token

Result

TypeDescription
projectTokenstringSigned in to the project token.
warningsList<Status>Version Verification Results List of Warnings
errorsList<Status>Version Verification Results List of errors

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CheckVersionByUserId(
    &version.CheckVersionByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        TargetVersions: []version.TargetVersion{
            version.TargetVersion{
                VersionName: pointy.String("app"),
                Version: &version.Version{
                    Major: pointy.Int32(1),
                    Minor: pointy.Int32(2),
                    Micro: pointy.Int32(3),
                },
            },
            version.TargetVersion{
                VersionName: pointy.String("asset"),
                Version: &version.Version{
                    Major: pointy.Int32(1),
                    Minor: pointy.Int32(2),
                    Micro: pointy.Int32(3),
                },
            },
        },
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
projectToken := result.ProjectToken
warnings := result.Warnings
errors := result.Errors
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CheckVersionByUserIdRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->checkVersionByUserId(
        (new CheckVersionByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withTargetVersions([
                (new TargetVersion())
                    ->withVersionName("app")
                    ->withVersion(
                    (new Version())
                        ->withMajor(1)
                        ->withMinor(2)
                        ->withMicro(3)
                    ),
                (new TargetVersion())
                    ->withVersionName("asset")
                    ->withVersion(
                    (new Version())
                        ->withMajor(1)
                        ->withMinor(2)
                        ->withMicro(3)
                    ),
            ])
            ->withTimeOffsetToken(null)
    );
    $projectToken = $result->getProjectToken();
    $warnings = $result->getWarnings();
    $errors = $result->getErrors();
} 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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CheckVersionByUserIdRequest;
import io.gs2.version.result.CheckVersionByUserIdResult;

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

try {
    CheckVersionByUserIdResult result = client.checkVersionByUserId(
        new CheckVersionByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTargetVersions(Arrays.asList(
                new TargetVersion()
                    .withVersionName("app")
                    .withVersion(
                    new Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    ),
                new TargetVersion()
                    .withVersionName("asset")
                    .withVersion(
                    new Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    )
            ))
            .withTimeOffsetToken(null)
    );
    String projectToken = result.getProjectToken();
    List<Status> warnings = result.getWarnings();
    List<Status> errors = result.getErrors();
} 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.CheckVersionByUserIdResult> asyncResult = null;
yield return client.CheckVersionByUserId(
    new Gs2.Gs2Version.Request.CheckVersionByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithTargetVersions(new Gs2.Gs2Version.Model.TargetVersion[] {
            new Gs2.Gs2Version.Model.TargetVersion()
                .WithVersionName("app")
                .WithVersion(
                new Gs2.Gs2Version.Model.Version_()
                    .WithMajor(1)
                    .WithMinor(2)
                    .WithMicro(3)
                ),
            new Gs2.Gs2Version.Model.TargetVersion()
                .WithVersionName("asset")
                .WithVersion(
                new Gs2.Gs2Version.Model.Version_()
                    .WithMajor(1)
                    .WithMinor(2)
                    .WithMicro(3)
                ),
        })
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var projectToken = result.ProjectToken;
var warnings = result.Warnings;
var errors = result.Errors;
import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.checkVersionByUserId(
        new Gs2Version.CheckVersionByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withTargetVersions([
                new Gs2Version.model.TargetVersion()
                    .withVersionName("app")
                    .withVersion(
                    new Gs2Version.model.Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    ),
                new Gs2Version.model.TargetVersion()
                    .withVersionName("asset")
                    .withVersion(
                    new Gs2Version.model.Version()
                        .withMajor(1)
                        .withMinor(2)
                        .withMicro(3)
                    ),
            ])
            .withTimeOffsetToken(null)
    );
    const projectToken = result.getProjectToken();
    const warnings = result.getWarnings();
    const errors = result.getErrors();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.check_version_by_user_id(
        version.CheckVersionByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_target_versions([
                version.TargetVersion()
                    .with_version_name('app')
                    .with_version(
                    version.Version()
                        .with_major(1)
                        .with_minor(2)
                        .with_micro(3)
                    ),
                version.TargetVersion()
                    .with_version_name('asset')
                    .with_version(
                    version.Version()
                        .with_major(1)
                        .with_minor(2)
                        .with_micro(3)
                    ),
            ])
            .with_time_offset_token(None)
    )
    project_token = result.project_token
    warnings = result.warnings
    errors = result.errors
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.check_version_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    targetVersions={
        {
            version_name="app",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        },
        {
            version_name="asset",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        }
    },
    timeOffsetToken=nil,
})

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

result = api_result.result
projectToken = result.projectToken;
warnings = result.warnings;
errors = result.errors;
client = gs2('version')

api_result_handler = client.check_version_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    targetVersions={
        {
            version_name="app",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        },
        {
            version_name="asset",
            version=
            {
                major=1,
                minor=2,
                micro=3,
            },
        }
    },
    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['errorMessage'])
end

result = api_result.result
projectToken = result.projectToken;
warnings = result.warnings;
errors = result.errors;

calculateSignature

Calculate version signatures

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
versionNamestring
~ 128 charsVersion Model Name
Version model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
versionVersionVersion

Result

TypeDescription
bodystringBody
signaturestringSignature

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CalculateSignature(
    &version.CalculateSignatureRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-0001"),
        Version: &version.Version{
            Major: pointy.Int32(1),
            Minor: pointy.Int32(2),
            Micro: pointy.Int32(3),
        },
    }
)
if err != nil {
    panic("error occurred")
}
body := result.Body
signature := result.Signature
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CalculateSignatureRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->calculateSignature(
        (new CalculateSignatureRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-0001")
            ->withVersion((new Version())
                ->withMajor(1)
                ->withMinor(2)
                ->withMicro(3)
            )
    );
    $body = $result->getBody();
    $signature = $result->getSignature();
} 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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CalculateSignatureRequest;
import io.gs2.version.result.CalculateSignatureResult;

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

try {
    CalculateSignatureResult result = client.calculateSignature(
        new CalculateSignatureRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withVersion(new Version()
                .withMajor(1)
                .withMinor(2)
                .withMicro(3)
            )
    );
    String body = result.getBody();
    String signature = result.getSignature();
} 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.CalculateSignatureResult> asyncResult = null;
yield return client.CalculateSignature(
    new Gs2.Gs2Version.Request.CalculateSignatureRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-0001")
        .WithVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(1)
            .WithMinor(2)
            .WithMicro(3)
        ),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var body = result.Body;
var signature = result.Signature;
import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.calculateSignature(
        new Gs2Version.CalculateSignatureRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withVersion(new Gs2Version.model.Version()
                .withMajor(1)
                .withMinor(2)
                .withMicro(3)
            )
    );
    const body = result.getBody();
    const signature = result.getSignature();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.calculate_signature(
        version.CalculateSignatureRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
            .with_version(version.Version()
                .with_major(1)
                .with_minor(2)
                .with_micro(3)
            )
    )
    body = result.body
    signature = result.signature
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.calculate_signature({
    namespaceName="namespace-0001",
    versionName="version-0001",
    version={
        major=1,
        minor=2,
        micro=3,
    },
})

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

result = api_result.result
body = result.body;
signature = result.signature;
client = gs2('version')

api_result_handler = client.calculate_signature_async({
    namespaceName="namespace-0001",
    versionName="version-0001",
    version={
        major=1,
        minor=2,
        micro=3,
    },
})

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['errorMessage'])
end

result = api_result.result
body = result.body;
signature = result.signature;

describeVersionModels

Get list of Version Models

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemsList<VersionModel>List of Version Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DescribeVersionModels(
    &version.DescribeVersionModelsRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DescribeVersionModelsRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->describeVersionModels(
        (new DescribeVersionModelsRequest())
            ->withNamespaceName("namespace-0001")
    );
    $items = $result->getItems();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DescribeVersionModelsRequest;
import io.gs2.version.result.DescribeVersionModelsResult;

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

try {
    DescribeVersionModelsResult result = client.describeVersionModels(
        new DescribeVersionModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    List<VersionModel> items = result.getItems();
} 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DescribeVersionModelsResult> asyncResult = null;
yield return client.DescribeVersionModels(
    new Gs2.Gs2Version.Request.DescribeVersionModelsRequest()
        .WithNamespaceName("namespace-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.describeVersionModels(
        new Gs2Version.DescribeVersionModelsRequest()
            .withNamespaceName("namespace-0001")
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.describe_version_models(
        version.DescribeVersionModelsRequest()
            .with_namespace_name('namespace-0001')
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

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

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

result = api_result.result
items = result.items;
client = gs2('version')

api_result_handler = client.describe_version_models_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['errorMessage'])
end

result = api_result.result
items = result.items;

getVersionModel

Get Version Model

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
versionNamestring
~ 128 charsVersion Model Name
Version model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemVersionModelVersion Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetVersionModel(
    &version.GetVersionModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\GetVersionModelRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->getVersionModel(
        (new GetVersionModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetVersionModelRequest;
import io.gs2.version.result.GetVersionModelResult;

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

try {
    GetVersionModelResult result = client.getVersionModel(
        new GetVersionModelRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
    );
    VersionModel 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.GetVersionModelResult> asyncResult = null;
yield return client.GetVersionModel(
    new Gs2.Gs2Version.Request.GetVersionModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.getVersionModel(
        new Gs2Version.GetVersionModelRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.get_version_model(
        version.GetVersionModelRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.get_version_model({
    namespaceName="namespace-0001",
    versionName="version-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.get_version_model_async({
    namespaceName="namespace-0001",
    versionName="version-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['errorMessage'])
end

result = api_result.result
item = result.item;

exportMaster

Export Version Model Master in a master data format that can be activated

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCurrentVersionMasterVersion Model master data that can be activated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &version.ExportMasterRequest {
        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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\ExportMasterRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->exportMaster(
        (new ExportMasterRequest())
            ->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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.ExportMasterRequest;
import io.gs2.version.result.ExportMasterResult;

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

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentVersionMaster 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Version.Request.ExportMasterRequest()
        .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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.exportMaster(
        new Gs2Version.ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.export_master(
        version.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

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

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.export_master_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['errorMessage'])
end

result = api_result.result
item = result.item;

getCurrentVersionMaster

Get Currently Active Version Model Master Data

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemCurrentVersionMasterCurrently Active Version Model Master Data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetCurrentVersionMaster(
    &version.GetCurrentVersionMasterRequest {
        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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\GetCurrentVersionMasterRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->getCurrentVersionMaster(
        (new GetCurrentVersionMasterRequest())
            ->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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetCurrentVersionMasterRequest;
import io.gs2.version.result.GetCurrentVersionMasterResult;

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

try {
    GetCurrentVersionMasterResult result = client.getCurrentVersionMaster(
        new GetCurrentVersionMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentVersionMaster 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.GetCurrentVersionMasterResult> asyncResult = null;
yield return client.GetCurrentVersionMaster(
    new Gs2.Gs2Version.Request.GetCurrentVersionMasterRequest()
        .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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.getCurrentVersionMaster(
        new Gs2Version.GetCurrentVersionMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.get_current_version_master(
        version.GetCurrentVersionMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

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

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.get_current_version_master_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['errorMessage'])
end

result = api_result.result
item = result.item;

preUpdateCurrentVersionMaster

Update Currently Active Version Model Master Data (3-phase version)

When uploading master data larger than 1MB, the update is performed in 3 phases.

  1. Execute this API to obtain a token and URL for uploading.
  2. Upload the master data to the obtained URL.
  3. Execute UpdateCurrentModelMaster with the token used for the upload to reflect the master data.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

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

Implementation Example

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

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentVersionMaster(
        (new PreUpdateCurrentVersionMasterRequest())
            ->withNamespaceName("namespace-0001")
    );
    $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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.PreUpdateCurrentVersionMasterRequest;
import io.gs2.version.result.PreUpdateCurrentVersionMasterResult;

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

try {
    PreUpdateCurrentVersionMasterResult result = client.preUpdateCurrentVersionMaster(
        new PreUpdateCurrentVersionMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.PreUpdateCurrentVersionMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentVersionMaster(
    new Gs2.Gs2Version.Request.PreUpdateCurrentVersionMasterRequest()
        .WithNamespaceName("namespace-0001"),
    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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.preUpdateCurrentVersionMaster(
        new Gs2Version.PreUpdateCurrentVersionMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.pre_update_current_version_master(
        version.PreUpdateCurrentVersionMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

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

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

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;
client = gs2('version')

api_result_handler = client.pre_update_current_version_master_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['errorMessage'])
end

result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;

updateCurrentVersionMaster

Update Currently Active Version Model Master Data

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
modeString Enum
enum {
  “direct”,
  “preUpload”
}
“direct”Update mode
Enumerator String DefinitionDescription
“direct”Directly update master data
“preUpload”Upload master data and then update
settingsstring{mode} == “direct”
✓*
~ 5242880 charsMaster Data
* Required if mode is “direct”
uploadTokenstring{mode} == “preUpload”
✓*
~ 1024 charsToken used to reflect results after upload
* Required if mode is “preUpload”

Result

TypeDescription
itemCurrentVersionMasterUpdated Currently Active Version Model Master Data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentVersionMaster(
    &version.UpdateCurrentVersionMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"type\": \"simple\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"type\": \"simple\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}"),
        UploadToken: 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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\UpdateCurrentVersionMasterRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->updateCurrentVersionMaster(
        (new UpdateCurrentVersionMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"type\": \"simple\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"type\": \"simple\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}")
            ->withUploadToken(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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.UpdateCurrentVersionMasterRequest;
import io.gs2.version.result.UpdateCurrentVersionMasterResult;

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

try {
    UpdateCurrentVersionMasterResult result = client.updateCurrentVersionMaster(
        new UpdateCurrentVersionMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"type\": \"simple\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"type\": \"simple\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}")
            .withUploadToken(null)
    );
    CurrentVersionMaster 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.UpdateCurrentVersionMasterResult> asyncResult = null;
yield return client.UpdateCurrentVersionMaster(
    new Gs2.Gs2Version.Request.UpdateCurrentVersionMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"type\": \"simple\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"type\": \"simple\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}")
        .WithUploadToken(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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.updateCurrentVersionMaster(
        new Gs2Version.UpdateCurrentVersionMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"type\": \"simple\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"type\": \"simple\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.update_current_version_master(
        version.UpdateCurrentVersionMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{\n  "version": "2019-10-09",\n  "versionModels": [\n    {\n      "name": "app",\n      "metadata": "APP",\n      "warningVersion": {\n        "major": 2,\n        "minor": 2,\n        "micro": 2\n      },\n      "errorVersion": {\n        "major": 1,\n        "minor": 1,\n        "micro": 1\n      },\n      "scope": "passive",\n      "type": "simple",\n      "needSignature": false\n    },\n    {\n      "name": "asset",\n      "metadata": "ASSET",\n      "warningVersion": {\n        "major": 3,\n        "minor": 3,\n        "micro": 3\n      },\n      "errorVersion": {\n        "major": 2,\n        "minor": 2,\n        "micro": 2\n      },\n      "scope": "passive",\n      "type": "simple",\n      "needSignature": true,\n      "signatureKeyId": "grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001"\n    },\n    {\n      "name": "eula",\n      "metadata": "EULA",\n      "type": "simple",\n      "warningVersion": {\n        "major": 4,\n        "minor": 4,\n        "micro": 4\n      },\n      "errorVersion": {\n        "major": 3,\n        "minor": 3,\n        "micro": 3\n      },\n      "scope": "active",\n      "type": "simple",\n      "currentVersion": {\n        "major": 2,\n        "minor": 2,\n        "micro": 2\n      }\n    }\n  ]\n}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.update_current_version_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"type\": \"simple\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"type\": \"simple\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}",
    uploadToken=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.update_current_version_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\n  \"version\": \"2019-10-09\",\n  \"versionModels\": [\n    {\n      \"name\": \"app\",\n      \"metadata\": \"APP\",\n      \"warningVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"errorVersion\": {\n        \"major\": 1,\n        \"minor\": 1,\n        \"micro\": 1\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": false\n    },\n    {\n      \"name\": \"asset\",\n      \"metadata\": \"ASSET\",\n      \"warningVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"errorVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      },\n      \"scope\": \"passive\",\n      \"type\": \"simple\",\n      \"needSignature\": true,\n      \"signatureKeyId\": \"grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001\"\n    },\n    {\n      \"name\": \"eula\",\n      \"metadata\": \"EULA\",\n      \"type\": \"simple\",\n      \"warningVersion\": {\n        \"major\": 4,\n        \"minor\": 4,\n        \"micro\": 4\n      },\n      \"errorVersion\": {\n        \"major\": 3,\n        \"minor\": 3,\n        \"micro\": 3\n      },\n      \"scope\": \"active\",\n      \"type\": \"simple\",\n      \"currentVersion\": {\n        \"major\": 2,\n        \"minor\": 2,\n        \"micro\": 2\n      }\n    }\n  ]\n}",
    uploadToken=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['errorMessage'])
end

result = api_result.result
item = result.item;

updateCurrentVersionMasterFromGitHub

Update Currently Active Version Model Master Data from GitHub

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
checkoutSettingGitHubCheckoutSetting
Setup to check out master data from GitHub

Result

TypeDescription
itemCurrentVersionMasterUpdated Currently Active Version Model Master Data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.UpdateCurrentVersionMasterFromGitHub(
    &version.UpdateCurrentVersionMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &version.GitHubCheckoutSetting{
            ApiKeyId: pointy.String("apiKeyId-0001"),
            RepositoryName: pointy.String("gs2io/master-data"),
            SourcePath: pointy.String("path/to/file.json"),
            ReferenceType: pointy.String("branch"),
            BranchName: pointy.String("develop"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Version\Gs2VersionRestClient;
use Gs2\Version\Request\UpdateCurrentVersionMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->updateCurrentVersionMasterFromGitHub(
        (new UpdateCurrentVersionMasterFromGitHubRequest())
            ->withNamespaceName("namespace-0001")
            ->withCheckoutSetting((new GitHubCheckoutSetting())
                ->withApiKeyId("apiKeyId-0001")
                ->withRepositoryName("gs2io/master-data")
                ->withSourcePath("path/to/file.json")
                ->withReferenceType("branch")
                ->withBranchName("develop")
            )
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.UpdateCurrentVersionMasterFromGitHubRequest;
import io.gs2.version.result.UpdateCurrentVersionMasterFromGitHubResult;

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

try {
    UpdateCurrentVersionMasterFromGitHubResult result = client.updateCurrentVersionMasterFromGitHub(
        new UpdateCurrentVersionMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentVersionMaster 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.UpdateCurrentVersionMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentVersionMasterFromGitHub(
    new Gs2.Gs2Version.Request.UpdateCurrentVersionMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Version.Model.GitHubCheckoutSetting()
            .WithApiKeyId("apiKeyId-0001")
            .WithRepositoryName("gs2io/master-data")
            .WithSourcePath("path/to/file.json")
            .WithReferenceType("branch")
            .WithBranchName("develop")
        ),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Version from '@/gs2/version';

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

try {
    const result = await client.updateCurrentVersionMasterFromGitHub(
        new Gs2Version.UpdateCurrentVersionMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Version.model.GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.update_current_version_master_from_git_hub(
        version.UpdateCurrentVersionMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(version.GitHubCheckoutSetting()
                .with_api_key_id('apiKeyId-0001')
                .with_repository_name('gs2io/master-data')
                .with_source_path('path/to/file.json')
                .with_reference_type('branch')
                .with_branch_name('develop')
            )
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.update_current_version_master_from_git_hub({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.update_current_version_master_from_git_hub_async({
    namespaceName="namespace-0001",
    checkoutSetting={
        api_key_id="apiKeyId-0001",
        repository_name="gs2io/master-data",
        source_path="path/to/file.json",
        reference_type="branch",
        branch_name="develop",
    },
})

api_result = api_result_handler()  -- Call the handler to get the result

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

result = api_result.result
item = result.item;

describeVersionModelMasters

Get list of Version Model Masters

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namePrefixstring~ 64 charsFilter by version name prefix
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint
301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<VersionModelMaster>List of Version Model Masters
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/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DescribeVersionModelMasters(
    &version.DescribeVersionModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DescribeVersionModelMastersRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->describeVersionModelMasters(
        (new DescribeVersionModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DescribeVersionModelMastersRequest;
import io.gs2.version.result.DescribeVersionModelMastersResult;

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

try {
    DescribeVersionModelMastersResult result = client.describeVersionModelMasters(
        new DescribeVersionModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<VersionModelMaster> 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DescribeVersionModelMastersResult> asyncResult = null;
yield return client.DescribeVersionModelMasters(
    new Gs2.Gs2Version.Request.DescribeVersionModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.describeVersionModelMasters(
        new Gs2Version.DescribeVersionModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .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 version

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

try:
    result = client.describe_version_model_masters(
        version.DescribeVersionModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .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('version')

api_result = client.describe_version_model_masters({
    namespaceName="namespace-0001",
    namePrefix=nil,
    pageToken=nil,
    limit=nil,
})

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

result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('version')

api_result_handler = client.describe_version_model_masters_async({
    namespaceName="namespace-0001",
    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['errorMessage'])
end

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

createVersionModelMaster

Create a new Version Model Master

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
namestring
~ 128 charsVersion Model Name
Version model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
scopeString Enum
enum {
  “passive”,
  “active”
}
Type of version value used for judgment
Enumerator String DefinitionDescription
“passive”Sent by Client
“active”Version explicitly approved in the past
typeString Enum
enum {
  “simple”,
  “schedule”
}
“simple”Version Check Mode
Enumerator String DefinitionDescription
“simple”Simple
“schedule”Schedule Change
currentVersionVersion{type} == “simple” and {scope} == “active”
✓*
Current Version
* Required if type is “simple” and scope is “active”
warningVersionVersion{type} == “simple”
✓*
Version that prompts for version upgrade
* Required if type is “simple”
errorVersionVersion{type} == “simple”
✓*
Version that is determined to be an error by the version check
* Required if type is “simple”
scheduleVersionsList<ScheduleVersion>{type} == “schedule”0 ~ 10 itemsList of Version check content that switches over time series
* Enabled if type is “schedule”
needSignaturebool{scope} == “passive”
✓*
Whether the version value to be determined requires signature verification
* Required if scope is “passive”
signatureKeyIdstring{needSignature}
✓*
~ 1024 charsencryption key GRN
* Required if needSignature is “true”
approveRequirementString Enum
enum {
  “required”,
  “optional”
}
{scope} == “active”
✓*
“required”Requirement for approval
Enumerator String DefinitionDescription
“required”Approval required
“optional”Any approval

* Required if scope is “active”

Result

TypeDescription
itemVersionModelMasterCreated Version Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.CreateVersionModelMaster(
    &version.CreateVersionModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("version-0001"),
        Description: nil,
        Metadata: nil,
        Scope: pointy.String("passive"),
        Type: nil,
        CurrentVersion: &version.Version{
            Major: pointy.Int32(1),
            Minor: pointy.Int32(1),
            Micro: pointy.Int32(1),
        },
        WarningVersion: &version.Version{
            Major: pointy.Int32(2),
            Minor: pointy.Int32(2),
            Micro: pointy.Int32(2),
        },
        ErrorVersion: &version.Version{
            Major: pointy.Int32(1),
            Minor: pointy.Int32(1),
            Micro: pointy.Int32(1),
        },
        ScheduleVersions: nil,
        NeedSignature: pointy.Bool(false),
        SignatureKeyId: nil,
        ApproveRequirement: 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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\CreateVersionModelMasterRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->createVersionModelMaster(
        (new CreateVersionModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("version-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withScope("passive")
            ->withType(null)
            ->withCurrentVersion((new \Gs2\Version\Model\Version())
                ->withMajor(1)
                ->withMinor(1)
                ->withMicro(1))
            ->withWarningVersion((new \Gs2\Version\Model\Version())
                ->withMajor(2)
                ->withMinor(2)
                ->withMicro(2))
            ->withErrorVersion((new \Gs2\Version\Model\Version())
                ->withMajor(1)
                ->withMinor(1)
                ->withMicro(1))
            ->withScheduleVersions(null)
            ->withNeedSignature(False)
            ->withSignatureKeyId(null)
            ->withApproveRequirement(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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.CreateVersionModelMasterRequest;
import io.gs2.version.result.CreateVersionModelMasterResult;

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

try {
    CreateVersionModelMasterResult result = client.createVersionModelMaster(
        new CreateVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("version-0001")
            .withDescription(null)
            .withMetadata(null)
            .withScope("passive")
            .withType(null)
            .withCurrentVersion(new io.gs2.version.model.Version()
                .withMajor(1)
                .withMinor(1)
                .withMicro(1))
            .withWarningVersion(new io.gs2.version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
            .withErrorVersion(new io.gs2.version.model.Version()
                .withMajor(1)
                .withMinor(1)
                .withMicro(1))
            .withScheduleVersions(null)
            .withNeedSignature(false)
            .withSignatureKeyId(null)
            .withApproveRequirement(null)
    );
    VersionModelMaster 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.CreateVersionModelMasterResult> asyncResult = null;
yield return client.CreateVersionModelMaster(
    new Gs2.Gs2Version.Request.CreateVersionModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("version-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithScope("passive")
        .WithType(null)
        .WithCurrentVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(1)
            .WithMinor(1)
            .WithMicro(1))
        .WithWarningVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(2)
            .WithMinor(2)
            .WithMicro(2))
        .WithErrorVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(1)
            .WithMinor(1)
            .WithMicro(1))
        .WithScheduleVersions(null)
        .WithNeedSignature(false)
        .WithSignatureKeyId(null)
        .WithApproveRequirement(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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.createVersionModelMaster(
        new Gs2Version.CreateVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("version-0001")
            .withDescription(null)
            .withMetadata(null)
            .withScope("passive")
            .withType(null)
            .withCurrentVersion(new Gs2Version.model.Version()
                .withMajor(1)
                .withMinor(1)
                .withMicro(1))
            .withWarningVersion(new Gs2Version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
            .withErrorVersion(new Gs2Version.model.Version()
                .withMajor(1)
                .withMinor(1)
                .withMicro(1))
            .withScheduleVersions(null)
            .withNeedSignature(false)
            .withSignatureKeyId(null)
            .withApproveRequirement(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.create_version_model_master(
        version.CreateVersionModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('version-0001')
            .with_description(None)
            .with_metadata(None)
            .with_scope('passive')
            .with_type(None)
            .with_current_version(
                version.Version()
                    .with_major(1)
                    .with_minor(1)
                    .with_micro(1))
            .with_warning_version(
                version.Version()
                    .with_major(2)
                    .with_minor(2)
                    .with_micro(2))
            .with_error_version(
                version.Version()
                    .with_major(1)
                    .with_minor(1)
                    .with_micro(1))
            .with_schedule_versions(None)
            .with_need_signature(False)
            .with_signature_key_id(None)
            .with_approve_requirement(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.create_version_model_master({
    namespaceName="namespace-0001",
    name="version-0001",
    description=nil,
    metadata=nil,
    scope="passive",
    type=nil,
    currentVersion={
        major=1,
        minor=1,
        micro=1,
    },
    warningVersion={
        major=2,
        minor=2,
        micro=2,
    },
    errorVersion={
        major=1,
        minor=1,
        micro=1,
    },
    scheduleVersions=nil,
    needSignature=false,
    signatureKeyId=nil,
    approveRequirement=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.create_version_model_master_async({
    namespaceName="namespace-0001",
    name="version-0001",
    description=nil,
    metadata=nil,
    scope="passive",
    type=nil,
    currentVersion={
        major=1,
        minor=1,
        micro=1,
    },
    warningVersion={
        major=2,
        minor=2,
        micro=2,
    },
    errorVersion={
        major=1,
        minor=1,
        micro=1,
    },
    scheduleVersions=nil,
    needSignature=false,
    signatureKeyId=nil,
    approveRequirement=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['errorMessage'])
end

result = api_result.result
item = result.item;

getVersionModelMaster

Get Version Model Master

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
versionNamestring
~ 128 charsVersion Model Name
Version model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemVersionModelMasterVersion Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.GetVersionModelMaster(
    &version.GetVersionModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\GetVersionModelMasterRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->getVersionModelMaster(
        (new GetVersionModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.GetVersionModelMasterRequest;
import io.gs2.version.result.GetVersionModelMasterResult;

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

try {
    GetVersionModelMasterResult result = client.getVersionModelMaster(
        new GetVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
    );
    VersionModelMaster 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.GetVersionModelMasterResult> asyncResult = null;
yield return client.GetVersionModelMaster(
    new Gs2.Gs2Version.Request.GetVersionModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.getVersionModelMaster(
        new Gs2Version.GetVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.get_version_model_master(
        version.GetVersionModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.get_version_model_master({
    namespaceName="namespace-0001",
    versionName="version-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.get_version_model_master_async({
    namespaceName="namespace-0001",
    versionName="version-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['errorMessage'])
end

result = api_result.result
item = result.item;

updateVersionModelMaster

Update Version Model Master

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
versionNamestring
~ 128 charsVersion Model Name
Version model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
scopeString Enum
enum {
  “passive”,
  “active”
}
Type of version value used for judgment
Enumerator String DefinitionDescription
“passive”Sent by Client
“active”Version explicitly approved in the past
typeString Enum
enum {
  “simple”,
  “schedule”
}
“simple”Version Check Mode
Enumerator String DefinitionDescription
“simple”Simple
“schedule”Schedule Change
currentVersionVersion{type} == “simple” and {scope} == “active”
✓*
Current Version
* Required if type is “simple” and scope is “active”
warningVersionVersion{type} == “simple”
✓*
Version that prompts for version upgrade
* Required if type is “simple”
errorVersionVersion{type} == “simple”
✓*
Version that is determined to be an error by the version check
* Required if type is “simple”
scheduleVersionsList<ScheduleVersion>{type} == “schedule”0 ~ 10 itemsList of Version check content that switches over time series
* Enabled if type is “schedule”
needSignaturebool{scope} == “passive”
✓*
Whether the version value to be determined requires signature verification
* Required if scope is “passive”
signatureKeyIdstring{needSignature}
✓*
~ 1024 charsencryption key GRN
* Required if needSignature is “true”
approveRequirementString Enum
enum {
  “required”,
  “optional”
}
{scope} == “active”
✓*
“required”Requirement for approval
Enumerator String DefinitionDescription
“required”Approval required
“optional”Any approval

* Required if scope is “active”

Result

TypeDescription
itemVersionModelMasterUpdated Version Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.UpdateVersionModelMaster(
    &version.UpdateVersionModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("{\"hoge\": \"fuga\"}"),
        Scope: pointy.String("active"),
        Type: nil,
        CurrentVersion: &version.Version{
            Major: pointy.Int32(3),
            Minor: pointy.Int32(0),
            Micro: pointy.Int32(0),
        },
        WarningVersion: &version.Version{
            Major: pointy.Int32(3),
            Minor: pointy.Int32(3),
            Micro: pointy.Int32(3),
        },
        ErrorVersion: &version.Version{
            Major: pointy.Int32(2),
            Minor: pointy.Int32(2),
            Micro: pointy.Int32(2),
        },
        ScheduleVersions: nil,
        NeedSignature: pointy.Bool(false),
        SignatureKeyId: nil,
        ApproveRequirement: 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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\UpdateVersionModelMasterRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->updateVersionModelMaster(
        (new UpdateVersionModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-0001")
            ->withDescription("description1")
            ->withMetadata("{\"hoge\": \"fuga\"}")
            ->withScope("active")
            ->withType(null)
            ->withCurrentVersion((new \Gs2\Version\Model\Version())
                ->withMajor(3)
                ->withMinor(0)
                ->withMicro(0))
            ->withWarningVersion((new \Gs2\Version\Model\Version())
                ->withMajor(3)
                ->withMinor(3)
                ->withMicro(3))
            ->withErrorVersion((new \Gs2\Version\Model\Version())
                ->withMajor(2)
                ->withMinor(2)
                ->withMicro(2))
            ->withScheduleVersions(null)
            ->withNeedSignature(False)
            ->withSignatureKeyId(null)
            ->withApproveRequirement(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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.UpdateVersionModelMasterRequest;
import io.gs2.version.result.UpdateVersionModelMasterResult;

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

try {
    UpdateVersionModelMasterResult result = client.updateVersionModelMaster(
        new UpdateVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withDescription("description1")
            .withMetadata("{\"hoge\": \"fuga\"}")
            .withScope("active")
            .withType(null)
            .withCurrentVersion(new io.gs2.version.model.Version()
                .withMajor(3)
                .withMinor(0)
                .withMicro(0))
            .withWarningVersion(new io.gs2.version.model.Version()
                .withMajor(3)
                .withMinor(3)
                .withMicro(3))
            .withErrorVersion(new io.gs2.version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
            .withScheduleVersions(null)
            .withNeedSignature(false)
            .withSignatureKeyId(null)
            .withApproveRequirement(null)
    );
    VersionModelMaster 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.UpdateVersionModelMasterResult> asyncResult = null;
yield return client.UpdateVersionModelMaster(
    new Gs2.Gs2Version.Request.UpdateVersionModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-0001")
        .WithDescription("description1")
        .WithMetadata("{\"hoge\": \"fuga\"}")
        .WithScope("active")
        .WithType(null)
        .WithCurrentVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(3)
            .WithMinor(0)
            .WithMicro(0))
        .WithWarningVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(3)
            .WithMinor(3)
            .WithMicro(3))
        .WithErrorVersion(new Gs2.Gs2Version.Model.Version_()
            .WithMajor(2)
            .WithMinor(2)
            .WithMicro(2))
        .WithScheduleVersions(null)
        .WithNeedSignature(false)
        .WithSignatureKeyId(null)
        .WithApproveRequirement(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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.updateVersionModelMaster(
        new Gs2Version.UpdateVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
            .withDescription("description1")
            .withMetadata("{\"hoge\": \"fuga\"}")
            .withScope("active")
            .withType(null)
            .withCurrentVersion(new Gs2Version.model.Version()
                .withMajor(3)
                .withMinor(0)
                .withMicro(0))
            .withWarningVersion(new Gs2Version.model.Version()
                .withMajor(3)
                .withMinor(3)
                .withMicro(3))
            .withErrorVersion(new Gs2Version.model.Version()
                .withMajor(2)
                .withMinor(2)
                .withMicro(2))
            .withScheduleVersions(null)
            .withNeedSignature(false)
            .withSignatureKeyId(null)
            .withApproveRequirement(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.update_version_model_master(
        version.UpdateVersionModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
            .with_description('description1')
            .with_metadata('{"hoge": "fuga"}')
            .with_scope('active')
            .with_type(None)
            .with_current_version(
                version.Version()
                    .with_major(3)
                    .with_minor(0)
                    .with_micro(0))
            .with_warning_version(
                version.Version()
                    .with_major(3)
                    .with_minor(3)
                    .with_micro(3))
            .with_error_version(
                version.Version()
                    .with_major(2)
                    .with_minor(2)
                    .with_micro(2))
            .with_schedule_versions(None)
            .with_need_signature(False)
            .with_signature_key_id(None)
            .with_approve_requirement(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.update_version_model_master({
    namespaceName="namespace-0001",
    versionName="version-0001",
    description="description1",
    metadata="{\"hoge\": \"fuga\"}",
    scope="active",
    type=nil,
    currentVersion={
        major=3,
        minor=0,
        micro=0,
    },
    warningVersion={
        major=3,
        minor=3,
        micro=3,
    },
    errorVersion={
        major=2,
        minor=2,
        micro=2,
    },
    scheduleVersions=nil,
    needSignature=false,
    signatureKeyId=nil,
    approveRequirement=nil,
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.update_version_model_master_async({
    namespaceName="namespace-0001",
    versionName="version-0001",
    description="description1",
    metadata="{\"hoge\": \"fuga\"}",
    scope="active",
    type=nil,
    currentVersion={
        major=3,
        minor=0,
        micro=0,
    },
    warningVersion={
        major=3,
        minor=3,
        micro=3,
    },
    errorVersion={
        major=2,
        minor=2,
        micro=2,
    },
    scheduleVersions=nil,
    needSignature=false,
    signatureKeyId=nil,
    approveRequirement=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['errorMessage'])
end

result = api_result.result
item = result.item;

deleteVersionModelMaster

Delete Version Model Master

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
versionNamestring
~ 128 charsVersion Model Name
Version model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemVersionModelMasterDeleted Version Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/version"
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 := version.Gs2VersionRestClient{
    Session: &session,
}
result, err := client.DeleteVersionModelMaster(
    &version.DeleteVersionModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        VersionName: pointy.String("version-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\Version\Gs2VersionRestClient;
use Gs2\Version\Request\DeleteVersionModelMasterRequest;

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

$session->open();

$client = new Gs2VersionRestClient(
    $session
);

try {
    $result = $client->deleteVersionModelMaster(
        (new DeleteVersionModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withVersionName("version-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.version.rest.Gs2VersionRestClient;
import io.gs2.version.request.DeleteVersionModelMasterRequest;
import io.gs2.version.result.DeleteVersionModelMasterResult;

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

try {
    DeleteVersionModelMasterResult result = client.deleteVersionModelMaster(
        new DeleteVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
    );
    VersionModelMaster 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 Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DeleteVersionModelMasterResult> asyncResult = null;
yield return client.DeleteVersionModelMaster(
    new Gs2.Gs2Version.Request.DeleteVersionModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithVersionName("version-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 Gs2Version from '@/gs2/version';

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

try {
    const result = await client.deleteVersionModelMaster(
        new Gs2Version.DeleteVersionModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withVersionName("version-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import version

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

try:
    result = client.delete_version_model_master(
        version.DeleteVersionModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_version_name('version-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.delete_version_model_master({
    namespaceName="namespace-0001",
    versionName="version-0001",
})

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

result = api_result.result
item = result.item;
client = gs2('version')

api_result_handler = client.delete_version_model_master_async({
    namespaceName="namespace-0001",
    versionName="version-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['errorMessage'])
end

result = api_result.result
item = result.item;