NAV
go python java php typescript csharp GS2-Script

GS2-Datastore

GS2-SDK のリファレンス

モデル

Namespace

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

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

説明
namespaceId string ネームスペースGRN
name string ネームスペース名
description string 説明文
doneUploadScript ScriptSetting アップロード完了報告時に実行するスクリプト
logSetting LogSetting ログの出力設定
createdAt long 作成日時
updatedAt long 最終更新日時

ScriptSetting

説明
triggerScriptId string スクリプトGRN
doneTriggerTargetType string 完了通知の通知先
doneTriggerScriptId string スクリプトGRN
doneTriggerQueueNamespaceId string ネームスペースGRN

DataObject

データオブジェクトはゲームプレイヤーがアップロードしたデータです。 データは世代管理され、30日分の過去のデータも保管されます。

データにはアクセス権限を設定できます。 スコープには3種類あり、だれでもアクセスできる public。指定したユーザーIDのゲームプレイヤーのみがアクセスできる protected。自身のみがアクセスできる private があります。

説明
dataObjectId string データオブジェクトGRN
name string データの名前
userId string ユーザーID
scope string ファイルのアクセス権
allowUserIds string[] 公開するユーザIDリスト
status string 状態
generation string データの世代
previousGeneration string 以前有効だったデータの世代
createdAt long 作成日時
updatedAt long 最終更新日時

DataObjectHistory

説明
dataObjectHistoryId string データオブジェクト履歴GRN
dataObjectName string データオブジェクト名
generation string 世代ID
contentLength long データサイズ
createdAt long 作成日時

LogSetting

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

メソッド

describeNamespaces

describeNamespaces

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &datastore.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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.DescribeNamespacesRequest;
import io.gs2.datastore.result.DescribeNamespacesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2DatastoreRestClient client = new Gs2DatastoreRestClient(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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.DescribeNamespacesRequest;
using Gs2.Gs2Datastore.Result.DescribeNamespacesResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeNamespaces(
    new DescribeNamespacesRequest()
        .withPageToken(null)
        .withLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

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

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

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

api_result = client.describe_namespaces({
    pageToken=nil,
    limit=nil,
});

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

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

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

Request

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

Result

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

createNamespace

createNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &datastore.CreateNamespaceRequest {
        Name: pointy.String("namespace1"),
        Description: nil,
        LogSetting: &datastore.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
        },
        DoneUploadScript: 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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName(self::namespace1)
            ->withDescription(null)
            ->withLogSetting((new \Gs2\Datastore\Model\LogSetting())
                ->withLoggingNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
            ->withDoneUploadScript(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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.CreateNamespaceRequest;
import io.gs2.datastore.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withLogSetting(new io.gs2.datastore.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
            .withDoneUploadScript(null)
    );
    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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.CreateNamespaceRequest;
using Gs2.Gs2Datastore.Result.CreateNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.createNamespace(
    new CreateNamespaceRequest()
        .withName("namespace1")
        .withDescription(null)
        .withLogSetting(new Gs2.Gs2Datastore.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
        .withDoneUploadScript(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 Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.createNamespace(
        new Gs2Datastore.CreateNamespaceRequest()
            .withName("namespace1")
            .withDescription(null)
            .withLogSetting(new Gs2Datastore.Model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
            .withDoneUploadScript(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.create_namespace(
        datastore.CreateNamespaceRequest()
            .with_name(self.hash1)
            .with_description(None)
            .with_log_setting(
                datastore.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
            .with_done_upload_script(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.create_namespace({
    name='namespace1',
    description=nil,
    logSetting={
        loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1',
    },
    doneUploadScript=nil,
});

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

result = api_result.result
item = result.item;

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

Request

必須 デフォルト 値の制限 説明
name string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
logSetting LogSetting ログの出力設定
doneUploadScript ScriptSetting アップロード完了報告時に実行するスクリプト

Result

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

getNamespaceStatus

getNamespaceStatus

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &datastore.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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.GetNamespaceStatusRequest;
import io.gs2.datastore.result.GetNamespaceStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2DatastoreRestClient client = new Gs2DatastoreRestClient(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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.GetNamespaceStatusRequest;
using Gs2.Gs2Datastore.Result.GetNamespaceStatusResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespaceStatus(
    new GetNamespaceStatusRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.getNamespaceStatus(
        new Gs2Datastore.GetNamespaceStatusRequest()
            .withNamespaceName("namespace1")
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.get_namespace_status(
        datastore.GetNamespaceStatusRequest()
            .with_namespace_name(self.hash1)
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

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

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

result = api_result.result
status = result.status;

ネームスペースを取得

Request

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

Result

説明
status string

getNamespace

getNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &datastore.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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.GetNamespaceRequest;
import io.gs2.datastore.result.GetNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2DatastoreRestClient client = new Gs2DatastoreRestClient(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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.GetNamespaceRequest;
using Gs2.Gs2Datastore.Result.GetNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getNamespace(
    new GetNamespaceRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.getNamespace(
        new Gs2Datastore.GetNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.get_namespace(
        datastore.GetNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

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

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

result = api_result.result
item = result.item;

ネームスペースを取得

Request

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

Result

説明
item Namespace ネームスペース

updateNamespace

updateNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &datastore.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace1"),
        Description: pointy.String("description1"),
        LogSetting: &datastore.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"),
        },
        DoneUploadScript: 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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName(self::namespace1)
            ->withDescription("description1")
            ->withLogSetting((new \Gs2\Datastore\Model\LogSetting())
                ->withLoggingNamespaceId('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
            ->withDoneUploadScript(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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.UpdateNamespaceRequest;
import io.gs2.datastore.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withLogSetting(new io.gs2.datastore.model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
            .withDoneUploadScript(null)
    );
    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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.UpdateNamespaceRequest;
using Gs2.Gs2Datastore.Result.UpdateNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateNamespace(
    new UpdateNamespaceRequest()
        .withNamespaceName("namespace1")
        .withDescription("description1")
        .withLogSetting(new Gs2.Gs2Datastore.Model.LogSetting()
            .WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
        .withDoneUploadScript(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 Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.updateNamespace(
        new Gs2Datastore.UpdateNamespaceRequest()
            .withNamespaceName("namespace1")
            .withDescription("description1")
            .withLogSetting(new Gs2Datastore.Model.LogSetting()
                .withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1"))
            .withDoneUploadScript(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.update_namespace(
        datastore.UpdateNamespaceRequest()
            .with_namespace_name(self.hash1)
            .with_description('description1')
            .with_log_setting(
                datastore.LogSetting()
                    .with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1'))
            .with_done_upload_script(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.update_namespace({
    namespaceName='namespace1',
    description='description1',
    logSetting={
        loggingNamespaceId='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1',
    },
    doneUploadScript=nil,
});

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

result = api_result.result
item = result.item;

ネームスペースを更新

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
description string ~ 1024文字 説明文
logSetting LogSetting ログの出力設定
doneUploadScript ScriptSetting アップロード完了報告時に実行するスクリプト

Result

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

deleteNamespace

deleteNamespace

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &datastore.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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.DeleteNamespaceRequest;
import io.gs2.datastore.result.DeleteNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        'your client id',
        'your client secret'
    )
);
session.connect();
Gs2DatastoreRestClient client = new Gs2DatastoreRestClient(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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.DeleteNamespaceRequest;
using Gs2.Gs2Datastore.Result.DeleteNamespaceResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteNamespace(
    new DeleteNamespaceRequest()
        .withNamespaceName("namespace1"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.deleteNamespace(
        new Gs2Datastore.DeleteNamespaceRequest()
            .withNamespaceName("namespace1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.delete_namespace(
        datastore.DeleteNamespaceRequest()
            .with_namespace_name(self.hash1)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

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

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

result = api_result.result
item = result.item;

ネームスペースを削除

Request

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

Result

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

describeDataObjects

describeDataObjects

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.DescribeDataObjects(
    &datastore.DescribeDataObjectsRequest {
        NamespaceName: pointy.String("namespace2"),
        AccessToken: pointy.String("$access_token_0001"),
        Status: pointy.String("ACTIVE"),
        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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\DescribeDataObjectsRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeDataObjects(
        (new DescribeDataObjectsRequest())
            ->withNamespaceName(self::namespace2)
            ->withAccessToken(self::$accessToken0001)
            ->withStatus("ACTIVE")
            ->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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.DescribeDataObjectsRequest;
import io.gs2.datastore.result.DescribeDataObjectsResult;

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

try {
    DescribeDataObjectsResult result = client.describeDataObjects(
        new DescribeDataObjectsRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withStatus("ACTIVE")
            .withPageToken(null)
            .withLimit(null)
    );
    List<DataObject> 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.DescribeDataObjectsRequest;
using Gs2.Gs2Datastore.Result.DescribeDataObjectsResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeDataObjects(
    new DescribeDataObjectsRequest()
        .withNamespaceName("namespace2")
        .withAccessToken("$access_token_0001")
        .withStatus("ACTIVE")
        .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 Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.describeDataObjects(
        new Gs2Datastore.DescribeDataObjectsRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withStatus("ACTIVE")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.describe_data_objects(
        datastore.DescribeDataObjectsRequest()
            .with_namespace_name(self.hash2)
            .with_access_token(self.access_token_0001)
            .with_status('ACTIVE')
            .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('datastore')

api_result = client.describe_data_objects({
    namespaceName='namespace2',
    accessToken='$access_token_0001',
    status='ACTIVE',
    pageToken=nil,
    limit=nil,
});

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

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

データオブジェクトの一覧を取得

Request

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

Result

説明
items DataObject[] データオブジェクトのリスト
nextPageToken string リストの続きを取得するためのページトークン

describeDataObjectsByUserId

describeDataObjectsByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.DescribeDataObjectsByUserId(
    &datastore.DescribeDataObjectsByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        Status: pointy.String("ACTIVE"),
        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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\DescribeDataObjectsByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeDataObjectsByUserId(
        (new DescribeDataObjectsByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withStatus("ACTIVE")
            ->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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.DescribeDataObjectsByUserIdRequest;
import io.gs2.datastore.result.DescribeDataObjectsByUserIdResult;

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

try {
    DescribeDataObjectsByUserIdResult result = client.describeDataObjectsByUserId(
        new DescribeDataObjectsByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withStatus("ACTIVE")
            .withPageToken(null)
            .withLimit(null)
    );
    List<DataObject> 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.DescribeDataObjectsByUserIdRequest;
using Gs2.Gs2Datastore.Result.DescribeDataObjectsByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeDataObjectsByUserId(
    new DescribeDataObjectsByUserIdRequest()
        .withNamespaceName("namespace2")
        .withUserId("user-0001")
        .withStatus("ACTIVE")
        .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 Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.describeDataObjectsByUserId(
        new Gs2Datastore.DescribeDataObjectsByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withStatus("ACTIVE")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.describe_data_objects_by_user_id(
        datastore.DescribeDataObjectsByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_status('ACTIVE')
            .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('datastore')

api_result = client.describe_data_objects_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    status='ACTIVE',
    pageToken=nil,
    limit=nil,
});

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

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

オーナーIDを指定してデータオブジェクトの一覧を取得

Request

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

Result

説明
items DataObject[] データオブジェクトのリスト
nextPageToken string リストの続きを取得するためのページトークン

prepareUpload

prepareUpload

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.PrepareUpload(
    &datastore.PrepareUploadRequest {
        NamespaceName: pointy.String("namespace2"),
        AccessToken: pointy.String("$access_token_0001"),
        Name: pointy.String("dataObject-0001"),
        ContentType: nil,
        Scope: pointy.String("public"),
        AllowUserIds: nil,
        UpdateIfExists: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\PrepareUploadRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareUpload(
        (new PrepareUploadRequest())
            ->withNamespaceName(self::namespace2)
            ->withAccessToken(self::$accessToken0001)
            ->withName("dataObject-0001")
            ->withContentType(null)
            ->withScope("public")
            ->withAllowUserIds(null)
            ->withUpdateIfExists(null)
    );
    $item = $result->getItem();
    $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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.PrepareUploadRequest;
import io.gs2.datastore.result.PrepareUploadResult;

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

try {
    PrepareUploadResult result = client.prepareUpload(
        new PrepareUploadRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withName("dataObject-0001")
            .withContentType(null)
            .withScope("public")
            .withAllowUserIds(null)
            .withUpdateIfExists(null)
    );
    DataObject item = result.getItem();
    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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.PrepareUploadRequest;
using Gs2.Gs2Datastore.Result.PrepareUploadResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.prepareUpload(
    new PrepareUploadRequest()
        .withNamespaceName("namespace2")
        .withAccessToken("$access_token_0001")
        .withName("dataObject-0001")
        .withContentType(null)
        .withScope("public")
        .withAllowUserIds(null)
        .withUpdateIfExists(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.prepareUpload(
        new Gs2Datastore.PrepareUploadRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withName("dataObject-0001")
            .withContentType(null)
            .withScope("public")
            .withAllowUserIds(null)
            .withUpdateIfExists(null)
    );
    const item = result.getItem();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.prepare_upload(
        datastore.PrepareUploadRequest()
            .with_namespace_name(self.hash2)
            .with_access_token(self.access_token_0001)
            .with_name('dataObject-0001')
            .with_content_type(None)
            .with_scope('public')
            .with_allow_user_ids(None)
            .with_update_if_exists(None)
    )
    item = result.item
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.prepare_upload({
    namespaceName='namespace2',
    accessToken='$access_token_0001',
    name='dataObject-0001',
    contentType=nil,
    scope='public',
    allowUserIds=nil,
    updateIfExists=nil,
});

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

result = api_result.result
item = result.item;
uploadUrl = result.uploadUrl;

データオブジェクトをアップロード準備する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
name string ~ 128文字 データの名前
contentType string "application/octet-stream" ~ 256文字 アップロードするデータの MIME-Type
scope string "private" ~ 128文字 ファイルのアクセス権
allowUserIds string[] {scope} != none and {scope} == "protected" [] 公開するユーザIDリスト
updateIfExists bool false 既にデータが存在する場合にエラーとするか、データを更新するか

Result

説明
item DataObject データオブジェクト
uploadUrl string アップロード処理の実行に使用するURL

prepareUploadByUserId

prepareUploadByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.PrepareUploadByUserId(
    &datastore.PrepareUploadByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        Name: pointy.String("dataObject-0001"),
        ContentType: nil,
        Scope: pointy.String("public"),
        AllowUserIds: nil,
        UpdateIfExists: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\PrepareUploadByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareUploadByUserId(
        (new PrepareUploadByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withName("dataObject-0001")
            ->withContentType(null)
            ->withScope("public")
            ->withAllowUserIds(null)
            ->withUpdateIfExists(null)
    );
    $item = $result->getItem();
    $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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.PrepareUploadByUserIdRequest;
import io.gs2.datastore.result.PrepareUploadByUserIdResult;

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

try {
    PrepareUploadByUserIdResult result = client.prepareUploadByUserId(
        new PrepareUploadByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withName("dataObject-0001")
            .withContentType(null)
            .withScope("public")
            .withAllowUserIds(null)
            .withUpdateIfExists(null)
    );
    DataObject item = result.getItem();
    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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.PrepareUploadByUserIdRequest;
using Gs2.Gs2Datastore.Result.PrepareUploadByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.prepareUploadByUserId(
    new PrepareUploadByUserIdRequest()
        .withNamespaceName("namespace2")
        .withUserId("user-0001")
        .withName("dataObject-0001")
        .withContentType(null)
        .withScope("public")
        .withAllowUserIds(null)
        .withUpdateIfExists(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.prepareUploadByUserId(
        new Gs2Datastore.PrepareUploadByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withName("dataObject-0001")
            .withContentType(null)
            .withScope("public")
            .withAllowUserIds(null)
            .withUpdateIfExists(null)
    );
    const item = result.getItem();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.prepare_upload_by_user_id(
        datastore.PrepareUploadByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_name('dataObject-0001')
            .with_content_type(None)
            .with_scope('public')
            .with_allow_user_ids(None)
            .with_update_if_exists(None)
    )
    item = result.item
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.prepare_upload_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    name='dataObject-0001',
    contentType=nil,
    scope='public',
    allowUserIds=nil,
    updateIfExists=nil,
});

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

result = api_result.result
item = result.item;
uploadUrl = result.uploadUrl;

ユーザIDを指定してデータオブジェクトをアップロード準備する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
name string ~ 128文字 データの名前
contentType string "application/octet-stream" ~ 256文字 アップロードするデータの MIME-Type
scope string "private" ~ 128文字 ファイルのアクセス権
allowUserIds string[] {scope} != none and {scope} == "protected" [] 公開するユーザIDリスト
updateIfExists bool false 既にデータが存在する場合にエラーとするか、データを更新するか

Result

説明
item DataObject データオブジェクト
uploadUrl string アップロード処理の実行に使用するURL

updateDataObject

updateDataObject

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.UpdateDataObject(
    &datastore.UpdateDataObjectRequest {
        NamespaceName: pointy.String("namespace2"),
        DataObjectName: pointy.String("dataObject-0001"),
        AccessToken: pointy.String("$access_token_0001"),
        Scope: pointy.String("public"),
        AllowUserIds: 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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\UpdateDataObjectRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateDataObject(
        (new UpdateDataObjectRequest())
            ->withNamespaceName(self::namespace2)
            ->withDataObjectName("dataObject-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withScope("public")
            ->withAllowUserIds(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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.UpdateDataObjectRequest;
import io.gs2.datastore.result.UpdateDataObjectResult;

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

try {
    UpdateDataObjectResult result = client.updateDataObject(
        new UpdateDataObjectRequest()
            .withNamespaceName("namespace2")
            .withDataObjectName("dataObject-0001")
            .withAccessToken("$access_token_0001")
            .withScope("public")
            .withAllowUserIds(null)
    );
    DataObject 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.UpdateDataObjectRequest;
using Gs2.Gs2Datastore.Result.UpdateDataObjectResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateDataObject(
    new UpdateDataObjectRequest()
        .withNamespaceName("namespace2")
        .withDataObjectName("dataObject-0001")
        .withAccessToken("$access_token_0001")
        .withScope("public")
        .withAllowUserIds(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 Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.updateDataObject(
        new Gs2Datastore.UpdateDataObjectRequest()
            .withNamespaceName("namespace2")
            .withDataObjectName("dataObject-0001")
            .withAccessToken("$access_token_0001")
            .withScope("public")
            .withAllowUserIds(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.update_data_object(
        datastore.UpdateDataObjectRequest()
            .with_namespace_name(self.hash2)
            .with_data_object_name('dataObject-0001')
            .with_access_token(self.access_token_0001)
            .with_scope('public')
            .with_allow_user_ids(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.update_data_object({
    namespaceName='namespace2',
    dataObjectName='dataObject-0001',
    accessToken='$access_token_0001',
    scope='public',
    allowUserIds=nil,
});

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

result = api_result.result
item = result.item;

データオブジェクトを更新する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
dataObjectName string UUID ~ 36文字 データの名前
accessToken string ~ 128文字 ユーザーID
scope string "private" ~ 128文字 ファイルのアクセス権
allowUserIds string[] {scope} != none and {scope} == "protected" [] 公開するユーザIDリスト

Result

説明
item DataObject データオブジェクト

updateDataObjectByUserId

updateDataObjectByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.UpdateDataObjectByUserId(
    &datastore.UpdateDataObjectByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        DataObjectName: pointy.String("dataObject-0001"),
        UserId: pointy.String("user-0001"),
        Scope: pointy.String("public"),
        AllowUserIds: 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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\UpdateDataObjectByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->updateDataObjectByUserId(
        (new UpdateDataObjectByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withDataObjectName("dataObject-0001")
            ->withUserId("user-0001")
            ->withScope("public")
            ->withAllowUserIds(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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.UpdateDataObjectByUserIdRequest;
import io.gs2.datastore.result.UpdateDataObjectByUserIdResult;

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

try {
    UpdateDataObjectByUserIdResult result = client.updateDataObjectByUserId(
        new UpdateDataObjectByUserIdRequest()
            .withNamespaceName("namespace2")
            .withDataObjectName("dataObject-0001")
            .withUserId("user-0001")
            .withScope("public")
            .withAllowUserIds(null)
    );
    DataObject 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.UpdateDataObjectByUserIdRequest;
using Gs2.Gs2Datastore.Result.UpdateDataObjectByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.updateDataObjectByUserId(
    new UpdateDataObjectByUserIdRequest()
        .withNamespaceName("namespace2")
        .withDataObjectName("dataObject-0001")
        .withUserId("user-0001")
        .withScope("public")
        .withAllowUserIds(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 Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.updateDataObjectByUserId(
        new Gs2Datastore.UpdateDataObjectByUserIdRequest()
            .withNamespaceName("namespace2")
            .withDataObjectName("dataObject-0001")
            .withUserId("user-0001")
            .withScope("public")
            .withAllowUserIds(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.update_data_object_by_user_id(
        datastore.UpdateDataObjectByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_data_object_name('dataObject-0001')
            .with_user_id('user-0001')
            .with_scope('public')
            .with_allow_user_ids(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.update_data_object_by_user_id({
    namespaceName='namespace2',
    dataObjectName='dataObject-0001',
    userId='user-0001',
    scope='public',
    allowUserIds=nil,
});

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

result = api_result.result
item = result.item;

ユーザIDを指定してデータオブジェクトを更新する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
dataObjectName string UUID ~ 36文字 データの名前
userId string ~ 128文字 ユーザーID
scope string "private" ~ 128文字 ファイルのアクセス権
allowUserIds string[] {scope} != none and {scope} == "protected" [] 公開するユーザIDリスト

Result

説明
item DataObject データオブジェクト

prepareReUpload

prepareReUpload

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.PrepareReUpload(
    &datastore.PrepareReUploadRequest {
        NamespaceName: pointy.String("namespace2"),
        DataObjectName: pointy.String("dataObject-0001"),
        AccessToken: pointy.String("$access_token_0001"),
        ContentType: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\PrepareReUploadRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareReUpload(
        (new PrepareReUploadRequest())
            ->withNamespaceName(self::namespace2)
            ->withDataObjectName("dataObject-0001")
            ->withAccessToken(self::$accessToken0001)
            ->withContentType(null)
    );
    $item = $result->getItem();
    $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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.PrepareReUploadRequest;
import io.gs2.datastore.result.PrepareReUploadResult;

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

try {
    PrepareReUploadResult result = client.prepareReUpload(
        new PrepareReUploadRequest()
            .withNamespaceName("namespace2")
            .withDataObjectName("dataObject-0001")
            .withAccessToken("$access_token_0001")
            .withContentType(null)
    );
    DataObject item = result.getItem();
    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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.PrepareReUploadRequest;
using Gs2.Gs2Datastore.Result.PrepareReUploadResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.prepareReUpload(
    new PrepareReUploadRequest()
        .withNamespaceName("namespace2")
        .withDataObjectName("dataObject-0001")
        .withAccessToken("$access_token_0001")
        .withContentType(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.prepareReUpload(
        new Gs2Datastore.PrepareReUploadRequest()
            .withNamespaceName("namespace2")
            .withDataObjectName("dataObject-0001")
            .withAccessToken("$access_token_0001")
            .withContentType(null)
    );
    const item = result.getItem();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.prepare_re_upload(
        datastore.PrepareReUploadRequest()
            .with_namespace_name(self.hash2)
            .with_data_object_name('dataObject-0001')
            .with_access_token(self.access_token_0001)
            .with_content_type(None)
    )
    item = result.item
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.prepare_re_upload({
    namespaceName='namespace2',
    dataObjectName='dataObject-0001',
    accessToken='$access_token_0001',
    contentType=nil,
});

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

result = api_result.result
item = result.item;
uploadUrl = result.uploadUrl;

データオブジェクトを再アップロード準備する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
dataObjectName string UUID ~ 36文字 データの名前
accessToken string ~ 128文字 ユーザーID
contentType string "application/octet-stream" ~ 256文字 アップロードするデータの MIME-Type

Result

説明
item DataObject データオブジェクト
uploadUrl string アップロード処理の実行に使用するURL

prepareReUploadByUserId

prepareReUploadByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.PrepareReUploadByUserId(
    &datastore.PrepareReUploadByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        DataObjectName: pointy.String("dataObject-0001"),
        UserId: pointy.String("user-0001"),
        ContentType: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\PrepareReUploadByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareReUploadByUserId(
        (new PrepareReUploadByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withDataObjectName("dataObject-0001")
            ->withUserId("user-0001")
            ->withContentType(null)
    );
    $item = $result->getItem();
    $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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.PrepareReUploadByUserIdRequest;
import io.gs2.datastore.result.PrepareReUploadByUserIdResult;

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

try {
    PrepareReUploadByUserIdResult result = client.prepareReUploadByUserId(
        new PrepareReUploadByUserIdRequest()
            .withNamespaceName("namespace2")
            .withDataObjectName("dataObject-0001")
            .withUserId("user-0001")
            .withContentType(null)
    );
    DataObject item = result.getItem();
    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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.PrepareReUploadByUserIdRequest;
using Gs2.Gs2Datastore.Result.PrepareReUploadByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.prepareReUploadByUserId(
    new PrepareReUploadByUserIdRequest()
        .withNamespaceName("namespace2")
        .withDataObjectName("dataObject-0001")
        .withUserId("user-0001")
        .withContentType(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var uploadUrl = result.UploadUrl;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.prepareReUploadByUserId(
        new Gs2Datastore.PrepareReUploadByUserIdRequest()
            .withNamespaceName("namespace2")
            .withDataObjectName("dataObject-0001")
            .withUserId("user-0001")
            .withContentType(null)
    );
    const item = result.getItem();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.prepare_re_upload_by_user_id(
        datastore.PrepareReUploadByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_data_object_name('dataObject-0001')
            .with_user_id('user-0001')
            .with_content_type(None)
    )
    item = result.item
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.prepare_re_upload_by_user_id({
    namespaceName='namespace2',
    dataObjectName='dataObject-0001',
    userId='user-0001',
    contentType=nil,
});

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

result = api_result.result
item = result.item;
uploadUrl = result.uploadUrl;

ユーザIDを指定してデータオブジェクトを再アップロード準備する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
dataObjectName string UUID ~ 36文字 データの名前
userId string ~ 128文字 ユーザーID
contentType string "application/octet-stream" ~ 256文字 アップロードするデータの MIME-Type

Result

説明
item DataObject データオブジェクト
uploadUrl string アップロード処理の実行に使用するURL

doneUpload

doneUpload

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.DoneUpload(
    &datastore.DoneUploadRequest {
        NamespaceName: pointy.String("namespace2"),
        DataObjectName: pointy.String("dataObject-0001"),
        AccessToken: pointy.String("$access_token_0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\DoneUploadRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->doneUpload(
        (new DoneUploadRequest())
            ->withNamespaceName(self::namespace2)
            ->withDataObjectName("dataObject-0001")
            ->withAccessToken(self::$accessToken0001)
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.DoneUploadRequest;
import io.gs2.datastore.result.DoneUploadResult;

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

try {
    DoneUploadResult result = client.doneUpload(
        new DoneUploadRequest()
            .withNamespaceName("namespace2")
            .withDataObjectName("dataObject-0001")
            .withAccessToken("$access_token_0001")
    );
    DataObject 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.DoneUploadRequest;
using Gs2.Gs2Datastore.Result.DoneUploadResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.doneUpload(
    new DoneUploadRequest()
        .withNamespaceName("namespace2")
        .withDataObjectName("dataObject-0001")
        .withAccessToken("$access_token_0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.doneUpload(
        new Gs2Datastore.DoneUploadRequest()
            .withNamespaceName("namespace2")
            .withDataObjectName("dataObject-0001")
            .withAccessToken("$access_token_0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.done_upload(
        datastore.DoneUploadRequest()
            .with_namespace_name(self.hash2)
            .with_data_object_name('dataObject-0001')
            .with_access_token(self.access_token_0001)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.done_upload({
    namespaceName='namespace2',
    dataObjectName='dataObject-0001',
    accessToken='$access_token_0001',
});

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

result = api_result.result
item = result.item;

データオブジェクトのアップロード完了を報告する

Request

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

Result

説明
item DataObject データオブジェクト

doneUploadByUserId

doneUploadByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.DoneUploadByUserId(
    &datastore.DoneUploadByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        DataObjectName: pointy.String("dataObject-0001"),
        UserId: pointy.String("user-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\DoneUploadByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->doneUploadByUserId(
        (new DoneUploadByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withDataObjectName("dataObject-0001")
            ->withUserId("user-0001")
    );
    $item = $result->getItem();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.DoneUploadByUserIdRequest;
import io.gs2.datastore.result.DoneUploadByUserIdResult;

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

try {
    DoneUploadByUserIdResult result = client.doneUploadByUserId(
        new DoneUploadByUserIdRequest()
            .withNamespaceName("namespace2")
            .withDataObjectName("dataObject-0001")
            .withUserId("user-0001")
    );
    DataObject 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.DoneUploadByUserIdRequest;
using Gs2.Gs2Datastore.Result.DoneUploadByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.doneUploadByUserId(
    new DoneUploadByUserIdRequest()
        .withNamespaceName("namespace2")
        .withDataObjectName("dataObject-0001")
        .withUserId("user-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.doneUploadByUserId(
        new Gs2Datastore.DoneUploadByUserIdRequest()
            .withNamespaceName("namespace2")
            .withDataObjectName("dataObject-0001")
            .withUserId("user-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.done_upload_by_user_id(
        datastore.DoneUploadByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_data_object_name('dataObject-0001')
            .with_user_id('user-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.done_upload_by_user_id({
    namespaceName='namespace2',
    dataObjectName='dataObject-0001',
    userId='user-0001',
});

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

result = api_result.result
item = result.item;

ユーザIDを指定してデータオブジェクトのアップロード完了を報告する

Request

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

Result

説明
item DataObject データオブジェクト

deleteDataObject

deleteDataObject

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.DeleteDataObject(
    &datastore.DeleteDataObjectRequest {
        NamespaceName: pointy.String("namespace2"),
        AccessToken: pointy.String("$access_token_0001"),
        DataObjectName: pointy.String("dataObject-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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\DeleteDataObjectRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteDataObject(
        (new DeleteDataObjectRequest())
            ->withNamespaceName(self::namespace2)
            ->withAccessToken(self::$accessToken0001)
            ->withDataObjectName("dataObject-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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.DeleteDataObjectRequest;
import io.gs2.datastore.result.DeleteDataObjectResult;

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

try {
    DeleteDataObjectResult result = client.deleteDataObject(
        new DeleteDataObjectRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withDataObjectName("dataObject-0001")
    );
    DataObject 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.DeleteDataObjectRequest;
using Gs2.Gs2Datastore.Result.DeleteDataObjectResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteDataObject(
    new DeleteDataObjectRequest()
        .withNamespaceName("namespace2")
        .withAccessToken("$access_token_0001")
        .withDataObjectName("dataObject-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 Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.deleteDataObject(
        new Gs2Datastore.DeleteDataObjectRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withDataObjectName("dataObject-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.delete_data_object(
        datastore.DeleteDataObjectRequest()
            .with_namespace_name(self.hash2)
            .with_access_token(self.access_token_0001)
            .with_data_object_name('dataObject-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.delete_data_object({
    namespaceName='namespace2',
    accessToken='$access_token_0001',
    dataObjectName='dataObject-0001',
});

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

result = api_result.result
item = result.item;

データオブジェクトを削除する

Request

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

Result

説明
item DataObject データオブジェクト

deleteDataObjectByUserId

deleteDataObjectByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.DeleteDataObjectByUserId(
    &datastore.DeleteDataObjectByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        DataObjectName: pointy.String("dataObject-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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\DeleteDataObjectByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->deleteDataObjectByUserId(
        (new DeleteDataObjectByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withDataObjectName("dataObject-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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.DeleteDataObjectByUserIdRequest;
import io.gs2.datastore.result.DeleteDataObjectByUserIdResult;

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

try {
    DeleteDataObjectByUserIdResult result = client.deleteDataObjectByUserId(
        new DeleteDataObjectByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withDataObjectName("dataObject-0001")
    );
    DataObject 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.DeleteDataObjectByUserIdRequest;
using Gs2.Gs2Datastore.Result.DeleteDataObjectByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.deleteDataObjectByUserId(
    new DeleteDataObjectByUserIdRequest()
        .withNamespaceName("namespace2")
        .withUserId("user-0001")
        .withDataObjectName("dataObject-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 Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.deleteDataObjectByUserId(
        new Gs2Datastore.DeleteDataObjectByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withDataObjectName("dataObject-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.delete_data_object_by_user_id(
        datastore.DeleteDataObjectByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_data_object_name('dataObject-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.delete_data_object_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    dataObjectName='dataObject-0001',
});

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

result = api_result.result
item = result.item;

ユーザIDを指定してデータオブジェクトを削除する

Request

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

Result

説明
item DataObject データオブジェクト

prepareDownload

prepareDownload

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.PrepareDownload(
    &datastore.PrepareDownloadRequest {
        NamespaceName: pointy.String("namespace2"),
        AccessToken: pointy.String("$access_token_0001"),
        DataObjectId: pointy.String("grn:dataObject-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
fileUrl := result.FileUrl
contentLength := result.ContentLength
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\PrepareDownloadRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareDownload(
        (new PrepareDownloadRequest())
            ->withNamespaceName(self::namespace2)
            ->withAccessToken(self::$accessToken0001)
            ->withDataObjectId("grn:dataObject-0001")
    );
    $item = $result->getItem();
    $fileUrl = $result->getFileUrl();
    $contentLength = $result->getContentLength();
} 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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.PrepareDownloadRequest;
import io.gs2.datastore.result.PrepareDownloadResult;

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

try {
    PrepareDownloadResult result = client.prepareDownload(
        new PrepareDownloadRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withDataObjectId("grn:dataObject-0001")
    );
    DataObject item = result.getItem();
    String fileUrl = result.getFileUrl();
    long contentLength = result.getContentLength();
} 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.PrepareDownloadRequest;
using Gs2.Gs2Datastore.Result.PrepareDownloadResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.prepareDownload(
    new PrepareDownloadRequest()
        .withNamespaceName("namespace2")
        .withAccessToken("$access_token_0001")
        .withDataObjectId("grn:dataObject-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var fileUrl = result.FileUrl;
var contentLength = result.ContentLength;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.prepareDownload(
        new Gs2Datastore.PrepareDownloadRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withDataObjectId("grn:dataObject-0001")
    );
    const item = result.getItem();
    const fileUrl = result.getFileUrl();
    const contentLength = result.getContentLength();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.prepare_download(
        datastore.PrepareDownloadRequest()
            .with_namespace_name(self.hash2)
            .with_access_token(self.access_token_0001)
            .with_data_object_id('grn:dataObject-0001')
    )
    item = result.item
    file_url = result.file_url
    content_length = result.content_length
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.prepare_download({
    namespaceName='namespace2',
    accessToken='$access_token_0001',
    dataObjectId='grn:dataObject-0001',
});

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

result = api_result.result
item = result.item;
fileUrl = result.fileUrl;
contentLength = result.contentLength;

データオブジェクトをダウンロード準備する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
dataObjectId string ~ 1024文字 データオブジェクトGRN

Result

説明
item DataObject データオブジェクト
fileUrl string ファイルをダウンロードするためのURL
contentLength long ファイルの容量

prepareDownloadByUserId

prepareDownloadByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.PrepareDownloadByUserId(
    &datastore.PrepareDownloadByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        DataObjectId: pointy.String("grn:dataObject-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
fileUrl := result.FileUrl
contentLength := result.ContentLength
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\PrepareDownloadByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareDownloadByUserId(
        (new PrepareDownloadByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withDataObjectId("grn:dataObject-0001")
    );
    $item = $result->getItem();
    $fileUrl = $result->getFileUrl();
    $contentLength = $result->getContentLength();
} 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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.PrepareDownloadByUserIdRequest;
import io.gs2.datastore.result.PrepareDownloadByUserIdResult;

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

try {
    PrepareDownloadByUserIdResult result = client.prepareDownloadByUserId(
        new PrepareDownloadByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withDataObjectId("grn:dataObject-0001")
    );
    DataObject item = result.getItem();
    String fileUrl = result.getFileUrl();
    long contentLength = result.getContentLength();
} 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.PrepareDownloadByUserIdRequest;
using Gs2.Gs2Datastore.Result.PrepareDownloadByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.prepareDownloadByUserId(
    new PrepareDownloadByUserIdRequest()
        .withNamespaceName("namespace2")
        .withUserId("user-0001")
        .withDataObjectId("grn:dataObject-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var fileUrl = result.FileUrl;
var contentLength = result.ContentLength;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.prepareDownloadByUserId(
        new Gs2Datastore.PrepareDownloadByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withDataObjectId("grn:dataObject-0001")
    );
    const item = result.getItem();
    const fileUrl = result.getFileUrl();
    const contentLength = result.getContentLength();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.prepare_download_by_user_id(
        datastore.PrepareDownloadByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_data_object_id('grn:dataObject-0001')
    )
    item = result.item
    file_url = result.file_url
    content_length = result.content_length
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.prepare_download_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    dataObjectId='grn:dataObject-0001',
});

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

result = api_result.result
item = result.item;
fileUrl = result.fileUrl;
contentLength = result.contentLength;

ユーザIDを指定してデータオブジェクトをダウンロード準備する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
dataObjectId string ~ 1024文字 データオブジェクトGRN

Result

説明
item DataObject データオブジェクト
fileUrl string ファイルをダウンロードするためのURL
contentLength long ファイルの容量

prepareDownloadByGeneration

prepareDownloadByGeneration

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.PrepareDownloadByGeneration(
    &datastore.PrepareDownloadByGenerationRequest {
        NamespaceName: pointy.String("namespace2"),
        AccessToken: pointy.String("$access_token_0001"),
        DataObjectId: pointy.String("grn:dataObject-0001"),
        Generation: pointy.String("generation-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
fileUrl := result.FileUrl
contentLength := result.ContentLength
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\PrepareDownloadByGenerationRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareDownloadByGeneration(
        (new PrepareDownloadByGenerationRequest())
            ->withNamespaceName(self::namespace2)
            ->withAccessToken(self::$accessToken0001)
            ->withDataObjectId("grn:dataObject-0001")
            ->withGeneration("generation-0001")
    );
    $item = $result->getItem();
    $fileUrl = $result->getFileUrl();
    $contentLength = $result->getContentLength();
} 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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.PrepareDownloadByGenerationRequest;
import io.gs2.datastore.result.PrepareDownloadByGenerationResult;

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

try {
    PrepareDownloadByGenerationResult result = client.prepareDownloadByGeneration(
        new PrepareDownloadByGenerationRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withDataObjectId("grn:dataObject-0001")
            .withGeneration("generation-0001")
    );
    DataObject item = result.getItem();
    String fileUrl = result.getFileUrl();
    long contentLength = result.getContentLength();
} 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.PrepareDownloadByGenerationRequest;
using Gs2.Gs2Datastore.Result.PrepareDownloadByGenerationResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.prepareDownloadByGeneration(
    new PrepareDownloadByGenerationRequest()
        .withNamespaceName("namespace2")
        .withAccessToken("$access_token_0001")
        .withDataObjectId("grn:dataObject-0001")
        .withGeneration("generation-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var fileUrl = result.FileUrl;
var contentLength = result.ContentLength;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.prepareDownloadByGeneration(
        new Gs2Datastore.PrepareDownloadByGenerationRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withDataObjectId("grn:dataObject-0001")
            .withGeneration("generation-0001")
    );
    const item = result.getItem();
    const fileUrl = result.getFileUrl();
    const contentLength = result.getContentLength();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.prepare_download_by_generation(
        datastore.PrepareDownloadByGenerationRequest()
            .with_namespace_name(self.hash2)
            .with_access_token(self.access_token_0001)
            .with_data_object_id('grn:dataObject-0001')
            .with_generation('generation-0001')
    )
    item = result.item
    file_url = result.file_url
    content_length = result.content_length
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.prepare_download_by_generation({
    namespaceName='namespace2',
    accessToken='$access_token_0001',
    dataObjectId='grn:dataObject-0001',
    generation='generation-0001',
});

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

result = api_result.result
item = result.item;
fileUrl = result.fileUrl;
contentLength = result.contentLength;

データオブジェクトを世代を指定してダウンロード準備する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
dataObjectId string ~ 1024文字 データオブジェクトGRN
generation string ~ 128文字 データの世代

Result

説明
item DataObject データオブジェクト
fileUrl string ファイルをダウンロードするためのURL
contentLength long ファイルの容量

prepareDownloadByGenerationAndUserId

prepareDownloadByGenerationAndUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.PrepareDownloadByGenerationAndUserId(
    &datastore.PrepareDownloadByGenerationAndUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        DataObjectId: pointy.String("grn:dataObject-0001"),
        Generation: pointy.String("generation-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
fileUrl := result.FileUrl
contentLength := result.ContentLength
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\PrepareDownloadByGenerationAndUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareDownloadByGenerationAndUserId(
        (new PrepareDownloadByGenerationAndUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withDataObjectId("grn:dataObject-0001")
            ->withGeneration("generation-0001")
    );
    $item = $result->getItem();
    $fileUrl = $result->getFileUrl();
    $contentLength = $result->getContentLength();
} 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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.PrepareDownloadByGenerationAndUserIdRequest;
import io.gs2.datastore.result.PrepareDownloadByGenerationAndUserIdResult;

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

try {
    PrepareDownloadByGenerationAndUserIdResult result = client.prepareDownloadByGenerationAndUserId(
        new PrepareDownloadByGenerationAndUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withDataObjectId("grn:dataObject-0001")
            .withGeneration("generation-0001")
    );
    DataObject item = result.getItem();
    String fileUrl = result.getFileUrl();
    long contentLength = result.getContentLength();
} 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.PrepareDownloadByGenerationAndUserIdRequest;
using Gs2.Gs2Datastore.Result.PrepareDownloadByGenerationAndUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.prepareDownloadByGenerationAndUserId(
    new PrepareDownloadByGenerationAndUserIdRequest()
        .withNamespaceName("namespace2")
        .withUserId("user-0001")
        .withDataObjectId("grn:dataObject-0001")
        .withGeneration("generation-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var fileUrl = result.FileUrl;
var contentLength = result.ContentLength;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.prepareDownloadByGenerationAndUserId(
        new Gs2Datastore.PrepareDownloadByGenerationAndUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withDataObjectId("grn:dataObject-0001")
            .withGeneration("generation-0001")
    );
    const item = result.getItem();
    const fileUrl = result.getFileUrl();
    const contentLength = result.getContentLength();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.prepare_download_by_generation_and_user_id(
        datastore.PrepareDownloadByGenerationAndUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_data_object_id('grn:dataObject-0001')
            .with_generation('generation-0001')
    )
    item = result.item
    file_url = result.file_url
    content_length = result.content_length
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.prepare_download_by_generation_and_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    dataObjectId='grn:dataObject-0001',
    generation='generation-0001',
});

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

result = api_result.result
item = result.item;
fileUrl = result.fileUrl;
contentLength = result.contentLength;

ユーザIDを指定してデータオブジェクトを世代を指定してダウンロード準備する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
dataObjectId string ~ 1024文字 データオブジェクトGRN
generation string ~ 128文字 データの世代

Result

説明
item DataObject データオブジェクト
fileUrl string ファイルをダウンロードするためのURL
contentLength long ファイルの容量

prepareDownloadOwnData

prepareDownloadOwnData

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.PrepareDownloadOwnData(
    &datastore.PrepareDownloadOwnDataRequest {
        NamespaceName: pointy.String("namespace2"),
        AccessToken: pointy.String("$access_token_0001"),
        DataObjectName: pointy.String("dataObject-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
fileUrl := result.FileUrl
contentLength := result.ContentLength
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\PrepareDownloadOwnDataRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareDownloadOwnData(
        (new PrepareDownloadOwnDataRequest())
            ->withNamespaceName(self::namespace2)
            ->withAccessToken(self::$accessToken0001)
            ->withDataObjectName("dataObject-0001")
    );
    $item = $result->getItem();
    $fileUrl = $result->getFileUrl();
    $contentLength = $result->getContentLength();
} 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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.PrepareDownloadOwnDataRequest;
import io.gs2.datastore.result.PrepareDownloadOwnDataResult;

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

try {
    PrepareDownloadOwnDataResult result = client.prepareDownloadOwnData(
        new PrepareDownloadOwnDataRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withDataObjectName("dataObject-0001")
    );
    DataObject item = result.getItem();
    String fileUrl = result.getFileUrl();
    long contentLength = result.getContentLength();
} 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.PrepareDownloadOwnDataRequest;
using Gs2.Gs2Datastore.Result.PrepareDownloadOwnDataResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.prepareDownloadOwnData(
    new PrepareDownloadOwnDataRequest()
        .withNamespaceName("namespace2")
        .withAccessToken("$access_token_0001")
        .withDataObjectName("dataObject-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var fileUrl = result.FileUrl;
var contentLength = result.ContentLength;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.prepareDownloadOwnData(
        new Gs2Datastore.PrepareDownloadOwnDataRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withDataObjectName("dataObject-0001")
    );
    const item = result.getItem();
    const fileUrl = result.getFileUrl();
    const contentLength = result.getContentLength();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.prepare_download_own_data(
        datastore.PrepareDownloadOwnDataRequest()
            .with_namespace_name(self.hash2)
            .with_access_token(self.access_token_0001)
            .with_data_object_name('dataObject-0001')
    )
    item = result.item
    file_url = result.file_url
    content_length = result.content_length
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.prepare_download_own_data({
    namespaceName='namespace2',
    accessToken='$access_token_0001',
    dataObjectName='dataObject-0001',
});

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

result = api_result.result
item = result.item;
fileUrl = result.fileUrl;
contentLength = result.contentLength;

データオブジェクトをダウンロード準備する

Request

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

Result

説明
item DataObject データオブジェクト
fileUrl string ファイルをダウンロードするためのURL
contentLength long ファイルの容量

prepareDownloadByUserIdAndDataObjectName

prepareDownloadByUserIdAndDataObjectName

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.PrepareDownloadByUserIdAndDataObjectName(
    &datastore.PrepareDownloadByUserIdAndDataObjectNameRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        DataObjectName: pointy.String("dataObject-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
fileUrl := result.FileUrl
contentLength := result.ContentLength
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\PrepareDownloadByUserIdAndDataObjectNameRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareDownloadByUserIdAndDataObjectName(
        (new PrepareDownloadByUserIdAndDataObjectNameRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withDataObjectName("dataObject-0001")
    );
    $item = $result->getItem();
    $fileUrl = $result->getFileUrl();
    $contentLength = $result->getContentLength();
} 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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.PrepareDownloadByUserIdAndDataObjectNameRequest;
import io.gs2.datastore.result.PrepareDownloadByUserIdAndDataObjectNameResult;

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

try {
    PrepareDownloadByUserIdAndDataObjectNameResult result = client.prepareDownloadByUserIdAndDataObjectName(
        new PrepareDownloadByUserIdAndDataObjectNameRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withDataObjectName("dataObject-0001")
    );
    DataObject item = result.getItem();
    String fileUrl = result.getFileUrl();
    long contentLength = result.getContentLength();
} 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.PrepareDownloadByUserIdAndDataObjectNameRequest;
using Gs2.Gs2Datastore.Result.PrepareDownloadByUserIdAndDataObjectNameResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.prepareDownloadByUserIdAndDataObjectName(
    new PrepareDownloadByUserIdAndDataObjectNameRequest()
        .withNamespaceName("namespace2")
        .withUserId("user-0001")
        .withDataObjectName("dataObject-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var fileUrl = result.FileUrl;
var contentLength = result.ContentLength;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.prepareDownloadByUserIdAndDataObjectName(
        new Gs2Datastore.PrepareDownloadByUserIdAndDataObjectNameRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withDataObjectName("dataObject-0001")
    );
    const item = result.getItem();
    const fileUrl = result.getFileUrl();
    const contentLength = result.getContentLength();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.prepare_download_by_user_id_and_data_object_name(
        datastore.PrepareDownloadByUserIdAndDataObjectNameRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_data_object_name('dataObject-0001')
    )
    item = result.item
    file_url = result.file_url
    content_length = result.content_length
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.prepare_download_by_user_id_and_data_object_name({
    namespaceName='namespace2',
    userId='user-0001',
    dataObjectName='dataObject-0001',
});

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

result = api_result.result
item = result.item;
fileUrl = result.fileUrl;
contentLength = result.contentLength;

ユーザIDとオブジェクト名を指定してデータオブジェクトをダウンロード準備する

Request

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

Result

説明
item DataObject データオブジェクト
fileUrl string ファイルをダウンロードするためのURL
contentLength long ファイルの容量

prepareDownloadOwnDataByGeneration

prepareDownloadOwnDataByGeneration

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.PrepareDownloadOwnDataByGeneration(
    &datastore.PrepareDownloadOwnDataByGenerationRequest {
        NamespaceName: pointy.String("namespace2"),
        AccessToken: pointy.String("$access_token_0001"),
        DataObjectName: pointy.String("dataObject-0001"),
        Generation: pointy.String("generation-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
fileUrl := result.FileUrl
contentLength := result.ContentLength
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\PrepareDownloadOwnDataByGenerationRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareDownloadOwnDataByGeneration(
        (new PrepareDownloadOwnDataByGenerationRequest())
            ->withNamespaceName(self::namespace2)
            ->withAccessToken(self::$accessToken0001)
            ->withDataObjectName("dataObject-0001")
            ->withGeneration("generation-0001")
    );
    $item = $result->getItem();
    $fileUrl = $result->getFileUrl();
    $contentLength = $result->getContentLength();
} 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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.PrepareDownloadOwnDataByGenerationRequest;
import io.gs2.datastore.result.PrepareDownloadOwnDataByGenerationResult;

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

try {
    PrepareDownloadOwnDataByGenerationResult result = client.prepareDownloadOwnDataByGeneration(
        new PrepareDownloadOwnDataByGenerationRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withDataObjectName("dataObject-0001")
            .withGeneration("generation-0001")
    );
    DataObject item = result.getItem();
    String fileUrl = result.getFileUrl();
    long contentLength = result.getContentLength();
} 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.PrepareDownloadOwnDataByGenerationRequest;
using Gs2.Gs2Datastore.Result.PrepareDownloadOwnDataByGenerationResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.prepareDownloadOwnDataByGeneration(
    new PrepareDownloadOwnDataByGenerationRequest()
        .withNamespaceName("namespace2")
        .withAccessToken("$access_token_0001")
        .withDataObjectName("dataObject-0001")
        .withGeneration("generation-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var fileUrl = result.FileUrl;
var contentLength = result.ContentLength;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.prepareDownloadOwnDataByGeneration(
        new Gs2Datastore.PrepareDownloadOwnDataByGenerationRequest()
            .withNamespaceName("namespace2")
            .withAccessToken("$access_token_0001")
            .withDataObjectName("dataObject-0001")
            .withGeneration("generation-0001")
    );
    const item = result.getItem();
    const fileUrl = result.getFileUrl();
    const contentLength = result.getContentLength();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.prepare_download_own_data_by_generation(
        datastore.PrepareDownloadOwnDataByGenerationRequest()
            .with_namespace_name(self.hash2)
            .with_access_token(self.access_token_0001)
            .with_data_object_name('dataObject-0001')
            .with_generation('generation-0001')
    )
    item = result.item
    file_url = result.file_url
    content_length = result.content_length
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.prepare_download_own_data_by_generation({
    namespaceName='namespace2',
    accessToken='$access_token_0001',
    dataObjectName='dataObject-0001',
    generation='generation-0001',
});

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

result = api_result.result
item = result.item;
fileUrl = result.fileUrl;
contentLength = result.contentLength;

データオブジェクトを世代を指定してダウンロード準備する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
dataObjectName string UUID ~ 36文字 データの名前
generation string ~ 128文字 データの世代

Result

説明
item DataObject データオブジェクト
fileUrl string ファイルをダウンロードするためのURL
contentLength long ファイルの容量

prepareDownloadByUserIdAndDataObjectNameAndGeneration

prepareDownloadByUserIdAndDataObjectNameAndGeneration

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.PrepareDownloadByUserIdAndDataObjectNameAndGeneration(
    &datastore.PrepareDownloadByUserIdAndDataObjectNameAndGenerationRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        DataObjectName: pointy.String("dataObject-0001"),
        Generation: pointy.String("generation-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
fileUrl := result.FileUrl
contentLength := result.ContentLength
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\PrepareDownloadByUserIdAndDataObjectNameAndGenerationRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->prepareDownloadByUserIdAndDataObjectNameAndGeneration(
        (new PrepareDownloadByUserIdAndDataObjectNameAndGenerationRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withDataObjectName("dataObject-0001")
            ->withGeneration("generation-0001")
    );
    $item = $result->getItem();
    $fileUrl = $result->getFileUrl();
    $contentLength = $result->getContentLength();
} 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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.PrepareDownloadByUserIdAndDataObjectNameAndGenerationRequest;
import io.gs2.datastore.result.PrepareDownloadByUserIdAndDataObjectNameAndGenerationResult;

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

try {
    PrepareDownloadByUserIdAndDataObjectNameAndGenerationResult result = client.prepareDownloadByUserIdAndDataObjectNameAndGeneration(
        new PrepareDownloadByUserIdAndDataObjectNameAndGenerationRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withDataObjectName("dataObject-0001")
            .withGeneration("generation-0001")
    );
    DataObject item = result.getItem();
    String fileUrl = result.getFileUrl();
    long contentLength = result.getContentLength();
} 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.PrepareDownloadByUserIdAndDataObjectNameAndGenerationRequest;
using Gs2.Gs2Datastore.Result.PrepareDownloadByUserIdAndDataObjectNameAndGenerationResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.prepareDownloadByUserIdAndDataObjectNameAndGeneration(
    new PrepareDownloadByUserIdAndDataObjectNameAndGenerationRequest()
        .withNamespaceName("namespace2")
        .withUserId("user-0001")
        .withDataObjectName("dataObject-0001")
        .withGeneration("generation-0001"),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var fileUrl = result.FileUrl;
var contentLength = result.ContentLength;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.prepareDownloadByUserIdAndDataObjectNameAndGeneration(
        new Gs2Datastore.PrepareDownloadByUserIdAndDataObjectNameAndGenerationRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withDataObjectName("dataObject-0001")
            .withGeneration("generation-0001")
    );
    const item = result.getItem();
    const fileUrl = result.getFileUrl();
    const contentLength = result.getContentLength();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.prepare_download_by_user_id_and_data_object_name_and_generation(
        datastore.PrepareDownloadByUserIdAndDataObjectNameAndGenerationRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_data_object_name('dataObject-0001')
            .with_generation('generation-0001')
    )
    item = result.item
    file_url = result.file_url
    content_length = result.content_length
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.prepare_download_by_user_id_and_data_object_name_and_generation({
    namespaceName='namespace2',
    userId='user-0001',
    dataObjectName='dataObject-0001',
    generation='generation-0001',
});

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

result = api_result.result
item = result.item;
fileUrl = result.fileUrl;
contentLength = result.contentLength;

ユーザIDを指定してデータオブジェクトを世代を指定してダウンロード準備する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
dataObjectName string UUID ~ 36文字 データの名前
generation string ~ 128文字 データの世代

Result

説明
item DataObject データオブジェクト
fileUrl string ファイルをダウンロードするためのURL
contentLength long ファイルの容量

restoreDataObject

restoreDataObject

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.RestoreDataObject(
    &datastore.RestoreDataObjectRequest {
        NamespaceName: pointy.String("namespace2"),
        DataObjectId: pointy.String("grn:dataObject-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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\RestoreDataObjectRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->restoreDataObject(
        (new RestoreDataObjectRequest())
            ->withNamespaceName(self::namespace2)
            ->withDataObjectId("grn:dataObject-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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.RestoreDataObjectRequest;
import io.gs2.datastore.result.RestoreDataObjectResult;

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

try {
    RestoreDataObjectResult result = client.restoreDataObject(
        new RestoreDataObjectRequest()
            .withNamespaceName("namespace2")
            .withDataObjectId("grn:dataObject-0001")
    );
    DataObject 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.RestoreDataObjectRequest;
using Gs2.Gs2Datastore.Result.RestoreDataObjectResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.restoreDataObject(
    new RestoreDataObjectRequest()
        .withNamespaceName("namespace2")
        .withDataObjectId("grn:dataObject-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 Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.restoreDataObject(
        new Gs2Datastore.RestoreDataObjectRequest()
            .withNamespaceName("namespace2")
            .withDataObjectId("grn:dataObject-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.restore_data_object(
        datastore.RestoreDataObjectRequest()
            .with_namespace_name(self.hash2)
            .with_data_object_id('grn:dataObject-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.restore_data_object({
    namespaceName='namespace2',
    dataObjectId='grn:dataObject-0001',
});

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

result = api_result.result
item = result.item;

データオブジェクトの管理情報を修復する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
dataObjectId string ~ 1024文字 データオブジェクトGRN

Result

説明
item DataObject データオブジェクト

describeDataObjectHistories

describeDataObjectHistories

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.DescribeDataObjectHistories(
    &datastore.DescribeDataObjectHistoriesRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        DataObjectName: pointy.String("dataObject-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\DescribeDataObjectHistoriesRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeDataObjectHistories(
        (new DescribeDataObjectHistoriesRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withDataObjectName("dataObject-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.DescribeDataObjectHistoriesRequest;
import io.gs2.datastore.result.DescribeDataObjectHistoriesResult;

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

try {
    DescribeDataObjectHistoriesResult result = client.describeDataObjectHistories(
        new DescribeDataObjectHistoriesRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withDataObjectName("dataObject-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<DataObjectHistory> 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.DescribeDataObjectHistoriesRequest;
using Gs2.Gs2Datastore.Result.DescribeDataObjectHistoriesResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeDataObjectHistories(
    new DescribeDataObjectHistoriesRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withDataObjectName("dataObject-0001")
        .withPageToken(null)
        .withLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.describeDataObjectHistories(
        new Gs2Datastore.DescribeDataObjectHistoriesRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withDataObjectName("dataObject-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.describe_data_object_histories(
        datastore.DescribeDataObjectHistoriesRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_data_object_name('dataObject-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.describe_data_object_histories({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    dataObjectName='dataObject-0001',
    pageToken=nil,
    limit=nil,
});

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

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

データオブジェクト履歴の一覧を取得

Request

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

Result

説明
items DataObjectHistory[] データオブジェクト履歴のリスト
nextPageToken string リストの続きを取得するためのページトークン

describeDataObjectHistoriesByUserId

describeDataObjectHistoriesByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.DescribeDataObjectHistoriesByUserId(
    &datastore.DescribeDataObjectHistoriesByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        DataObjectName: pointy.String("dataObject-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\DescribeDataObjectHistoriesByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->describeDataObjectHistoriesByUserId(
        (new DescribeDataObjectHistoriesByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withDataObjectName("dataObject-0001")
            ->withPageToken(null)
            ->withLimit(null)
    );
    $items = $result->getItems();
    $nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
    exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.DescribeDataObjectHistoriesByUserIdRequest;
import io.gs2.datastore.result.DescribeDataObjectHistoriesByUserIdResult;

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

try {
    DescribeDataObjectHistoriesByUserIdResult result = client.describeDataObjectHistoriesByUserId(
        new DescribeDataObjectHistoriesByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withDataObjectName("dataObject-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<DataObjectHistory> 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.DescribeDataObjectHistoriesByUserIdRequest;
using Gs2.Gs2Datastore.Result.DescribeDataObjectHistoriesByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.describeDataObjectHistoriesByUserId(
    new DescribeDataObjectHistoriesByUserIdRequest()
        .withNamespaceName("namespace2")
        .withUserId("user-0001")
        .withDataObjectName("dataObject-0001")
        .withPageToken(null)
        .withLimit(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.describeDataObjectHistoriesByUserId(
        new Gs2Datastore.DescribeDataObjectHistoriesByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withDataObjectName("dataObject-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.describe_data_object_histories_by_user_id(
        datastore.DescribeDataObjectHistoriesByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_data_object_name('dataObject-0001')
            .with_page_token(None)
            .with_limit(None)
    )
    items = result.items
    next_page_token = result.next_page_token
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.describe_data_object_histories_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    dataObjectName='dataObject-0001',
    pageToken=nil,
    limit=nil,
});

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

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

ユーザIDを指定してデータオブジェクト履歴の一覧を取得

Request

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

Result

説明
items DataObjectHistory[] データオブジェクト履歴のリスト
nextPageToken string リストの続きを取得するためのページトークン

getDataObjectHistory

getDataObjectHistory

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.GetDataObjectHistory(
    &datastore.GetDataObjectHistoryRequest {
        NamespaceName: pointy.String("namespace1"),
        AccessToken: pointy.String("$access_token_0001"),
        DataObjectName: pointy.String("dataObject-0001"),
        Generation: pointy.String("1"),
    }
)
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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\GetDataObjectHistoryRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getDataObjectHistory(
        (new GetDataObjectHistoryRequest())
            ->withNamespaceName(self::namespace1)
            ->withAccessToken(self::$accessToken0001)
            ->withDataObjectName("dataObject-0001")
            ->withGeneration("1")
    );
    $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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.GetDataObjectHistoryRequest;
import io.gs2.datastore.result.GetDataObjectHistoryResult;

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

try {
    GetDataObjectHistoryResult result = client.getDataObjectHistory(
        new GetDataObjectHistoryRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withDataObjectName("dataObject-0001")
            .withGeneration("1")
    );
    DataObjectHistory 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.GetDataObjectHistoryRequest;
using Gs2.Gs2Datastore.Result.GetDataObjectHistoryResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getDataObjectHistory(
    new GetDataObjectHistoryRequest()
        .withNamespaceName("namespace1")
        .withAccessToken("$access_token_0001")
        .withDataObjectName("dataObject-0001")
        .withGeneration("1"),
    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 Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.getDataObjectHistory(
        new Gs2Datastore.GetDataObjectHistoryRequest()
            .withNamespaceName("namespace1")
            .withAccessToken("$access_token_0001")
            .withDataObjectName("dataObject-0001")
            .withGeneration("1")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.get_data_object_history(
        datastore.GetDataObjectHistoryRequest()
            .with_namespace_name(self.hash1)
            .with_access_token(self.access_token_0001)
            .with_data_object_name('dataObject-0001')
            .with_generation('1')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.get_data_object_history({
    namespaceName='namespace1',
    accessToken='$access_token_0001',
    dataObjectName='dataObject-0001',
    generation='1',
});

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

result = api_result.result
item = result.item;

データオブジェクト履歴を取得する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
accessToken string ~ 128文字 ユーザーID
dataObjectName string ~ 128文字 データオブジェクト名
generation string ~ 128文字 世代ID

Result

説明
item DataObjectHistory データオブジェクト履歴

getDataObjectHistoryByUserId

getDataObjectHistoryByUserId

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/datastore"
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 := datastore.Gs2DatastoreRestClient{
    Session: &session,
}
result, err := client.GetDataObjectHistoryByUserId(
    &datastore.GetDataObjectHistoryByUserIdRequest {
        NamespaceName: pointy.String("namespace2"),
        UserId: pointy.String("user-0001"),
        DataObjectName: pointy.String("dataObject-0001"),
        Generation: pointy.String("generation-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\Datastore\Gs2DatastoreRestClient;
use Gs2\Datastore\Request\GetDataObjectHistoryByUserIdRequest;

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

$session->open();

$client = new Gs2AccountRestClient(
    $session
);

try {
    $result = $client->getDataObjectHistoryByUserId(
        (new GetDataObjectHistoryByUserIdRequest())
            ->withNamespaceName(self::namespace2)
            ->withUserId("user-0001")
            ->withDataObjectName("dataObject-0001")
            ->withGeneration("generation-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.datastore.rest.Gs2DatastoreRestClient;
import io.gs2.datastore.request.GetDataObjectHistoryByUserIdRequest;
import io.gs2.datastore.result.GetDataObjectHistoryByUserIdResult;

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

try {
    GetDataObjectHistoryByUserIdResult result = client.getDataObjectHistoryByUserId(
        new GetDataObjectHistoryByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withDataObjectName("dataObject-0001")
            .withGeneration("generation-0001")
    );
    DataObjectHistory 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.Gs2Datastore.Gs2DatastoreRestClient;
using Gs2.Gs2Datastore.Request.GetDataObjectHistoryByUserIdRequest;
using Gs2.Gs2Datastore.Result.GetDataObjectHistoryByUserIdResult;

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

AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.getDataObjectHistoryByUserId(
    new GetDataObjectHistoryByUserIdRequest()
        .withNamespaceName("namespace2")
        .withUserId("user-0001")
        .withDataObjectName("dataObject-0001")
        .withGeneration("generation-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 Gs2Datastore from '@/gs2/datastore';

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

try {
    const result = await client.getDataObjectHistoryByUserId(
        new Gs2Datastore.GetDataObjectHistoryByUserIdRequest()
            .withNamespaceName("namespace2")
            .withUserId("user-0001")
            .withDataObjectName("dataObject-0001")
            .withGeneration("generation-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import datastore

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

try:
    result = client.get_data_object_history_by_user_id(
        datastore.GetDataObjectHistoryByUserIdRequest()
            .with_namespace_name(self.hash2)
            .with_user_id('user-0001')
            .with_data_object_name('dataObject-0001')
            .with_generation('generation-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)

client = gs2('datastore')

api_result = client.get_data_object_history_by_user_id({
    namespaceName='namespace2',
    userId='user-0001',
    dataObjectName='dataObject-0001',
    generation='generation-0001',
});

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

result = api_result.result
item = result.item;

ユーザIDを指定してデータオブジェクト履歴を取得する

Request

必須 デフォルト 値の制限 説明
namespaceName string ~ 32文字 ネームスペース名
userId string ~ 128文字 ユーザーID
dataObjectName string ~ 128文字 データオブジェクト名
generation string ~ 128文字 世代ID

Result

説明
item DataObjectHistory データオブジェクト履歴