API Reference of GS2-Version SDK

Model

Namespace

Namespace

Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.

Therefore, it is necessary to create a namespace before starting to use each service.

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsNamespace GRN
namestring~ 32 charsNamespace name
descriptionstring~ 1024 charsDescription
assumeUserIdstring~ 1024 charsUser GRN
acceptVersionScriptScriptSettingScript to run when version is approved
checkVersionTriggerScriptIdstring~ 1024 charsGS2-Script script to perform version checking process
logSettingLogSettingLog output settings
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision


VersionModelMaster

Version Model Master

You can set a warning version that accepts logins but notifies you that you can upgrade, 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.

TypeConditionRequireDefaultLimitationDescription
versionModelIdstring~ 1024 charsVersion Master GRN
namestring~ 128 charsVersion Model Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
scopeenum [
“passive”,
“active”
]
~ 128 charsType of version value used for judgment
typeenum [
“simple”,
“schedule”
]
“simple”~ 128 charsType of version value used for judgment
currentVersionVersion{type} == “simple” and {scope} == “active”Current Version
warningVersionVersion{type} == “simple”Version that prompts for version upgrade
errorVersionVersion{type} == “simple”Version that is determined to be an error by the version check
scheduleVersionsList<ScheduleVersion>{type} == “schedule”~ 10 itemsList of Version check content that switches over time series
needSignaturebool{scope} == “passive”Whether the version value to be determined requires signature verification
signatureKeyIdstring{needSignature} != none and {needSignature}~ 1024 charsencryption key GRN
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 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.

TypeConditionRequireDefaultLimitationDescription
versionModelIdstring~ 1024 charsVersion Model GRN
namestring~ 128 charsVersion Model Name
metadatastring~ 2048 charsmetadata
scopeenum [
“passive”,
“active”
]
~ 128 charsType of version value used for judgment
typeenum [
“simple”,
“schedule”
]
“simple”~ 128 charsType of version value used for judgment
currentVersionVersion{type} == “simple” and {scope} == “active”Current Version
warningVersionVersion{type} == “simple”Version that prompts for version upgrade
errorVersionVersion{type} == “simple”Version that is determined to be an error by the version check
scheduleVersionsList<ScheduleVersion>{type} == “schedule”~ 10 itemsList of Version check content that switches over time series
needSignaturebool{scope} == “passive”Whether the version value to be determined requires signature verification
signatureKeyIdstring{needSignature} != none and {needSignature}~ 1024 charsencryption key GRN


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.

TypeConditionRequireDefaultLimitationDescription
acceptVersionIdstring~ 1024 charsApproved Version GRN
versionNamestring~ 128 charsApproved Version Name
userIdstring~ 128 charsUser Id
versionVersionApproved Version
createdAtlongDatetime of creation
updatedAtlongDatetime of last update
revisionlong0~ 9223372036854775805Revision


Status

TypeConditionRequireDefaultLimitationDescription
versionModelVersionModelVersion Model
currentVersionVersionCurrent Version

TargetVersion

TypeConditionRequireDefaultLimitationDescription
versionNamestring~ 128 charsVersion Name
bodystring~ 1048576 charsBody
signaturestring~ 256 charsSignature
versionVersion{signature} == ""Version

SignTargetVersion

TypeConditionRequireDefaultLimitationDescription
regionstring~ 128 charsRegion
namespaceNamestring~ 128 charsNamespace name
versionNamestring~ 128 charsVersion Model Name
versionVersionVersion

CurrentVersionMaster

Currently available master data

GS2 uses JSON format files for master data management. By uploading the file, you can actually reflect the settings on the server.

We provide a master data editor on the management console as a way to create JSON files, but you can also create JSON files using the The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.

Please refer to the documentation for the format of the JSON file.

TypeConditionRequireDefaultLimitationDescription
namespaceIdstring~ 1024 charsCurrently available version GRN
settingsstring~ 5242880 charsMaster data


ScriptSetting

TypeConditionRequireDefaultLimitationDescription
triggerScriptIdstring~ 1024 charsScript GRN
doneTriggerTargetTypeenum [
“none”,
“gs2_script”,
“aws”
]
“none”~ 128 charsNotification of Completion
doneTriggerScriptIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsScript GRN
doneTriggerQueueNamespaceIdstring{doneTriggerTargetType} == “gs2_script”~ 1024 charsNamespace GRN

GitHubCheckoutSetting

TypeConditionRequireDefaultLimitationDescription
apiKeyIdstring~ 1024 charsGitHub API key GRN
repositoryNamestring~ 1024 charsRepository Name
sourcePathstring~ 1024 charsSource code file path
referenceTypeenum [
“commit_hash”,
“branch”,
“tag”
]
~ 128 charsSource of code
commitHashstring{referenceType} == “commit_hash”~ 1024 charsCommit hash
branchNamestring{referenceType} == “branch”~ 1024 charsBranch Name
tagNamestring{referenceType} == “tag”~ 1024 charsTag Name

LogSetting

TypeConditionRequireDefaultLimitationDescription
loggingNamespaceIdstring~ 1024 charsNamespace GRN

Version

TypeConditionRequireDefaultLimitationDescription
majorint~ 2147483646Major version
minorint~ 2147483646Minor version
microint~ 2147483646Micro version

ScheduleVersion

TypeConditionRequireDefaultLimitationDescription
currentVersionVersionCurrent Version
warningVersionVersionVersion that prompts for version upgrade
errorVersionVersionVersion that is determined to be an error by the version check
scheduleEventIdstring~ 1024 charsGS2-Schedule event that enables version check

Methods

describeNamespaces

Get list of namespaces

Request

TypeConditionRequireDefaultLimitationDescription
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 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 {
        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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeNamespaces(
        (new DescribeNamespacesRequest())
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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()
            .withPageToken(null)
            .withLimit(null)
    );
    List<Namespace> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.DescribeNamespacesRequest;
using Gs2.Gs2Version.Result.DescribeNamespacesResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Version.Request.DescribeNamespacesRequest()
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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()
            .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_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({
    pageToken=nil,
    limit=nil,
})

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

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

createNamespace

Create a new namespace

Request

TypeConditionRequireDefaultLimitationDescription
namestring~ 32 charsNamespace name
descriptionstring~ 1024 charsDescription
assumeUserIdstring~ 1024 charsUser GRN
acceptVersionScriptScriptSettingScript to run when version is approved
checkVersionTriggerScriptIdstring~ 1024 charsGS2-Script script 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("namespace1"),
        Description: 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:namespace1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName(self::namespace1)
            ->withDescription(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:\namespace1"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
            .withDescription(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:namespace1"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.CreateNamespaceRequest;
using Gs2.Gs2Version.Result.CreateNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Version.Request.CreateNamespaceRequest()
        .WithName("namespace1")
        .WithDescription(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:namespace1")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
            .withDescription(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:namespace1"))
    );
    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(self.hash1)
            .with_description(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:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.create_namespace({
    name='namespace1',
    description=nil,
    assumeUserId='grn:gs2::YourOwnerId:identifier:user:user-0001',
    acceptVersionScript=nil,
    checkVersionTriggerScriptId=nil,
    logSetting={
        loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1',
    },
})

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

result = api_result.result
item = result.item;

getNamespaceStatus

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getNamespaceStatus(
        (new GetNamespaceStatusRequest())
            ->withNamespaceName(self::namespace1)
    );
    $status = $result->getStatus();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
    );
    String status = result.getStatus();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Version.Result.GetNamespaceStatusResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Version.Request.GetNamespaceStatusRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
    );
    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(self.hash1)
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

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

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

result = api_result.result
status = result.status;

getNamespace

Get namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getNamespace(
        (new GetNamespaceRequest())
            ->withNamespaceName(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.GetNamespaceRequest;
using Gs2.Gs2Version.Result.GetNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Version.Request.GetNamespaceRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
    );
    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(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

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

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

result = api_result.result
item = result.item;

updateNamespace

Update namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
descriptionstring~ 1024 charsDescription
assumeUserIdstring~ 1024 charsUser GRN
acceptVersionScriptScriptSettingScript to run when version is approved
checkVersionTriggerScriptIdstring~ 1024 charsGS2-Script script 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("namespace1"),
        Description: pointy.String("description1"),
        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:namespace1"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName(self::namespace1)
            ->withDescription("description1")
            ->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:\namespace1"))
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
            .withDescription("description1")
            .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:namespace1"))
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.UpdateNamespaceRequest;
using Gs2.Gs2Version.Result.UpdateNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Version.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace1")
        .WithDescription("description1")
        .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:namespace1")),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
            .withDescription("description1")
            .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:namespace1"))
    );
    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(self.hash1)
            .with_description('description1')
            .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:namespace1'))
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.update_namespace({
    namespaceName='namespace1',
    description='description1',
    assumeUserId='grn:gs2::YourOwnerId:identifier:user:user-0002',
    acceptVersionScript=nil,
    checkVersionTriggerScriptId=nil,
    logSetting={
        loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1',
    },
})

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

result = api_result.result
item = result.item;

deleteNamespace

Delete namespace

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name

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("namespace1"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteNamespace(
        (new DeleteNamespaceRequest())
            ->withNamespaceName(self::namespace1)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
    );
    Namespace item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.DeleteNamespaceRequest;
using Gs2.Gs2Version.Result.DeleteNamespaceResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Version.Request.DeleteNamespaceRequest()
        .WithNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
    );
    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(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

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

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

result = api_result.result
item = result.item;

dumpUserDataByUserId

Get dump data of the data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id

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"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->dumpUserDataByUserId(
        (new DumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
    );
} 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")
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.DumpUserDataByUserIdRequest;
using Gs2.Gs2Version.Result.DumpUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Version.Request.DumpUserDataByUserIdRequest()
        .WithUserId("user-0001"),
    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")
    );
} 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')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.dump_user_data_by_user_id({
    userId='user-0001',
})

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

result = api_result.result

checkDumpUserDataByUserId

Check if the dump of the data associated with the specified user ID is complete

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id

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"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkDumpUserDataByUserId(
        (new CheckDumpUserDataByUserIdRequest())
            ->withUserId("user-0001")
    );
    $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")
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.CheckDumpUserDataByUserIdRequest;
using Gs2.Gs2Version.Result.CheckDumpUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Version.Request.CheckDumpUserDataByUserIdRequest()
        .WithUserId("user-0001"),
    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")
    );
    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')
    )
    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',
})

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

result = api_result.result
url = result.url;

cleanUserDataByUserId

Get clean data of the data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id

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"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->cleanUserDataByUserId(
        (new CleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
    );
} 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")
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.CleanUserDataByUserIdRequest;
using Gs2.Gs2Version.Result.CleanUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Version.Request.CleanUserDataByUserIdRequest()
        .WithUserId("user-0001"),
    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")
    );
} 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')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.clean_user_data_by_user_id({
    userId='user-0001',
})

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

result = api_result.result

checkCleanUserDataByUserId

Check if the clean of the data associated with the specified user ID is complete

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id

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"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkCleanUserDataByUserId(
        (new CheckCleanUserDataByUserIdRequest())
            ->withUserId("user-0001")
    );
} 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")
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.CheckCleanUserDataByUserIdRequest;
using Gs2.Gs2Version.Result.CheckCleanUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Version.Request.CheckCleanUserDataByUserIdRequest()
        .WithUserId("user-0001"),
    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")
    );
} 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')
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.check_clean_user_data_by_user_id({
    userId='user-0001',
})

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

result = api_result.result

prepareImportUserDataByUserId

Start importing data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id

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"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareImportUserDataByUserId(
        (new PrepareImportUserDataByUserIdRequest())
            ->withUserId("user-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.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")
    );
    String uploadToken = result.getUploadToken();
    String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.PrepareImportUserDataByUserIdRequest;
using Gs2.Gs2Version.Result.PrepareImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Version.Request.PrepareImportUserDataByUserIdRequest()
        .WithUserId("user-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.prepareImportUserDataByUserId(
        new Gs2Version.PrepareImportUserDataByUserIdRequest()
            .withUserId("user-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.prepare_import_user_data_by_user_id(
        version.PrepareImportUserDataByUserIdRequest()
            .with_user_id('user-0001')
    )
    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',
})

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

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

importUserDataByUserId

Start importing data associated with the specified user ID

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
uploadTokenstring~ 1024 charsToken received in preparation for upload

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"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->importUserDataByUserId(
        (new ImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
    );
} 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")
    );
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.ImportUserDataByUserIdRequest;
using Gs2.Gs2Version.Result.ImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
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"),
    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")
    );
} 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')
    )
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',
})

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

result = api_result.result

checkImportUserDataByUserId

Check if the import of the data associated with the specified user ID is complete

Request

TypeConditionRequireDefaultLimitationDescription
userIdstring~ 128 charsUser Id
uploadTokenstring~ 1024 charsToken received in preparation for upload

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"),
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->checkImportUserDataByUserId(
        (new CheckImportUserDataByUserIdRequest())
            ->withUserId("user-0001")
            ->withUploadToken("upload-0001")
    );
    $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")
    );
    String url = result.getUrl();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.CheckImportUserDataByUserIdRequest;
using Gs2.Gs2Version.Result.CheckImportUserDataByUserIdResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
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"),
    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")
    );
    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')
    )
    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',
})

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

result = api_result.result
url = result.url;

describeVersionModelMasters

Get list of version masters

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<VersionModelMaster>List of Version 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("namespace1"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeVersionModelMasters(
        (new DescribeVersionModelMastersRequest())
            ->withNamespaceName(self::namespace1)
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.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("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    List<VersionModelMaster> items = result.getItems();
    String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.DescribeVersionModelMastersRequest;
using Gs2.Gs2Version.Result.DescribeVersionModelMastersResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.DescribeVersionModelMastersResult> asyncResult = null;
yield return client.DescribeVersionModelMasters(
    new Gs2.Gs2Version.Request.DescribeVersionModelMastersRequest()
        .WithNamespaceName("namespace1")
        .WithPageToken(null)
        .WithLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as 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("namespace1")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import 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(self.hash1)
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

api_result = client.describe_version_model_masters({
    namespaceName='namespace1',
    pageToken=nil,
    limit=nil,
})

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

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

createVersionModelMaster

Create a new version master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
namestring~ 128 charsVersion Model Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
scopeenum [
“passive”,
“active”
]
~ 128 charsType of version value used for judgment
typeenum [
“simple”,
“schedule”
]
“simple”~ 128 charsType of version value used for judgment
currentVersionVersion{type} == “simple” and {scope} == “active”Current Version
warningVersionVersion{type} == “simple”Version that prompts for version upgrade
errorVersionVersion{type} == “simple”Version that is determined to be an error by the version check
scheduleVersionsList<ScheduleVersion>{type} == “schedule”~ 10 itemsList of Version check content that switches over time series
needSignaturebool{scope} == “passive”Whether the version value to be determined requires signature verification
signatureKeyIdstring{needSignature} != none and {needSignature}~ 1024 charsencryption key GRN

Result

TypeDescription
itemVersionModelMasterCreated version 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("namespace1"),
        Name: pointy.String("version-0001"),
        Description: nil,
        Metadata: nil,
        Scope: pointy.String("passive"),
        Type: nil,
        CurrentVersion: nil,
        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,
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createVersionModelMaster(
        (new CreateVersionModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withName("version-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withScope("passive")
            ->withType(null)
            ->withCurrentVersion(null)
            ->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)
    );
    $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("namespace1")
            .withName("version-0001")
            .withDescription(null)
            .withMetadata(null)
            .withScope("passive")
            .withType(null)
            .withCurrentVersion(null)
            .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)
    );
    VersionModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.CreateVersionModelMasterRequest;
using Gs2.Gs2Version.Result.CreateVersionModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.CreateVersionModelMasterResult> asyncResult = null;
yield return client.CreateVersionModelMaster(
    new Gs2.Gs2Version.Request.CreateVersionModelMasterRequest()
        .WithNamespaceName("namespace1")
        .WithName("version-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithScope("passive")
        .WithType(null)
        .WithCurrentVersion(null)
        .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),
    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("namespace1")
            .withName("version-0001")
            .withDescription(null)
            .withMetadata(null)
            .withScope("passive")
            .withType(null)
            .withCurrentVersion(null)
            .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)
    );
    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(self.hash1)
            .with_name('version-0001')
            .with_description(None)
            .with_metadata(None)
            .with_scope('passive')
            .with_type(None)
            .with_current_version(None)
            .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)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('version')

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

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

result = api_result.result
item = result.item;

getVersionModelMaster

Get Version Master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
versionNamestring~ 128 charsVersion Model Name

Result

TypeDescription
itemVersionModelMasterVersion 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("namespace1"),
        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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getVersionModelMaster(
        (new GetVersionModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->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("namespace1")
            .withVersionName("version-0001")
    );
    VersionModelMaster item = result.getItem();
} catch (Gs2Exception e) {
    System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Version.Gs2VersionRestClient;
using Gs2.Gs2Version.Request.GetVersionModelMasterRequest;
using Gs2.Gs2Version.Result.GetVersionModelMasterResult;

var session = new Gs2RestSession(
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    ),
    Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2VersionRestClient(session);

AsyncResult<Gs2.Gs2Version.Result.GetVersionModelMasterResult> asyncResult = null;
yield return client.GetVersionModelMaster(
    new Gs2.Gs2Version.Request.GetVersionModelMasterRequest()
        .WithNamespaceName("namespace1")
        .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("namespace1")
            .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(self.hash1)
            .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='namespace1',
    versionName='version-0001',
})

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

result = api_result.result
item = result.item;

updateVersionModelMaster

Update version master

Request

TypeConditionRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
versionNamestring~ 128 charsVersion Model Name
descriptionstring~ 1024 charsDescription
metadatastring~ 2048 charsmetadata
scopeenum [
“passive”,
“active”
]
~ 128 charsType of version value used for judgment
typeenum [
“simple”,
“schedule”
]
“simple”~ 128 charsType of version value used for judgment
currentVersionVersion{type} == “simple” and {scope} == “active”Current Version
warningVersionVersion{type} == “simple”Version that prompts for version upgrade
errorVersionVersion{type} == “simple”Version that is determined to be an error by the version check
scheduleVersionsList<ScheduleVersion>{type} == “schedule”~ 10 itemsList of Version check content that switches over time series
needSignaturebool{scope} == “passive”Whether the version value to be determined requires signature verification
signatureKeyIdstring{needSignature} != none and {needSignature}~ 1024 charsencryption key GRN

Result

TypeDescription
itemVersionModelMasterUpdated version 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("namespace1"),
        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,
    }
)
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 Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateVersionModelMaster(
        (new UpdateVersionModelMasterRequest())
            ->withNamespaceName(self::namespace1)
            ->withVersionName("version-0001")
            ->withDescription("description1")
            ->withMetadata("{\"hoge\": \"fuga\"}")
            ->withScope("active")
            ->withType(null)
            ->withCurrentVersion((new \Gs2\Version\Model\Version())
                ->withMajor(3)
                ->withMinor(0)