API Reference of GS2-Distributor SDK Model Namespace Namespace
Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project.
Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.
Therefore, it is necessary to create a namespace before starting to use each service.
Type Condition Require Default Limitation Description namespaceId string ✓ ~ 1024 chars Namespace Grn name string ✓ ~ 32 chars Namespace name description string ~ 1024 chars Description assumeUserId string ~ 1024 chars User GRN autoRunStampSheetNotification NotificationSetting ✓ Push notification when stamp sheet auto-execution is complete logSetting LogSetting Log output settings createdAt long ✓ Datetime of creation updatedAt long ✓ Datetime of last update revision long 0 ~ 9223372036854775805 Revision
DistributorModelMaster Delivery Setting Model Master
A delivery setting is an entity that sets the policy when an entity’s acquisition exceeds its possession quota.
By processing acquisitions through GS2-Distributor, overflow resources can be forwarded as GS2-Inbox messages.
Type Condition Require Default Limitation Description distributorModelId string ✓ ~ 1024 chars Delivery Setting Master GRN name string ✓ ~ 128 chars delivery setting name description string ~ 1024 chars Description metadata string ~ 2048 chars metadata inboxNamespaceId string ~ 1024 chars Namespace GRN whiteListTargetIds List<string> [] ~ 100 items Whitelist of target resource GRNs that can be processed through the distributor createdAt long ✓ Datetime of creation updatedAt long ✓ Datetime of last update revision long 0 ~ 9223372036854775805 Revision
DistributorModel Delivery Setting Model
A delivery setting is an entity that sets the policy when an entity’s acquisition exceeds its possession quota.
By processing acquisitions through GS2-Distributor, overflow resources can be forwarded as GS2-Inbox messages.
Type Condition Require Default Limitation Description distributorModelId string ✓ ~ 1024 chars Delivery Setting GRN name string ✓ ~ 128 chars Delivery setting name metadata string ~ 2048 chars metadata inboxNamespaceId string ~ 1024 chars Namespace GRN whiteListTargetIds List<string> [] ~ 1000 items Whitelist of target resource GRNs that can be processed through the distributor
CurrentDistributorMaster Currently available master data
GS2 uses JSON format files for master data management.
By uploading the file, you can actually reflect the settings on the server.
We provide a master data editor on the management console as a way to create JSON files, but we also provide a master data editor on the management console as a way to create JSON files.
The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.
Please refer to the documentation for the format of the JSON file.
Type Condition Require Default Limitation Description namespaceId string ✓ ~ 1024 chars Currently available delivery settings GRN settings string ✓ ~ 5242880 chars Master data
StampSheetResult Stamp sheet execution results
Stamp sheet execution results executed using server-side stamp sheet auto-execution functionality
Type Condition Require Default Limitation Description stampSheetResultId string ✓ ~ 1024 chars Stamp Sheet Result GRN userId string ✓ ~ 128 chars User Id transactionId string ✓ 36 ~ 36 chars stamp-sheet transaction ID taskRequests List<ConsumeAction> ~ 1000 items List of Stamp task request payload sheetRequest AcquireAction ✓ Stamp sheet request payload taskResults List<string> ~ 1000 items Stamp task execution results sheetResult string ~ 1048576 chars Stamp sheet execution result response content nextTransactionId string 36 ~ 36 chars Stamp sheet execution results, newly issued stamp sheet transaction ID createdAt long ✓ Datetime of creation revision long 0 ~ 9223372036854775805 Revision
AcquireAction Type Condition Require Default Limitation Description action enum [ ] ✓ ~ 128 chars Types of actions to be performed in the stamp sheet request string ✓ ~ 1048576 chars JSON of request
ConsumeAction Type Condition Require Default Limitation Description action enum [ ] ✓ ~ 128 chars Types of actions to be performed in the stamp task request string ✓ ~ 1048576 chars JSON of the obtain request
GitHubCheckoutSetting Type Condition Require Default Limitation Description apiKeyId string ✓ ~ 1024 chars GitHub API key GRN repositoryName string ✓ ~ 1024 chars Repository Name sourcePath string ✓ ~ 1024 chars Source code file path referenceType enum [ “commit_hash”, “branch”, “tag” ] ✓ ~ 128 chars Source of code commitHash string {referenceType} == “commit_hash” ✓ ~ 1024 chars Commit hash branchName string {referenceType} == “branch” ✓ ~ 1024 chars Branch Name tagName string {referenceType} == “tag” ✓ ~ 1024 chars Tag Name
DistributeResource Type Condition Require Default Limitation Description action enum [ ] ✓ ~ 128 chars Types of actions to be performed in the stamp sheet request string ✓ ~ 1048576 chars JSON of request
LogSetting Type Condition Require Default Limitation Description loggingNamespaceId string ✓ ~ 1024 chars Namespace GRN
NotificationSetting Push notification settings
This is a setting for sending push notifications when an event occurs in a GS2 microservice.
The push notification here refers to the processing via the WebSocket interface provided by GS2-Gateway, and is different from the push notification of a smartphone.
For example, when a matchmaking is completed or a friend request is received, the GS2-Gateway can send a push notification via the WebSocket interface, and the game client can detect the change of the state.
GS2-Gateway’s push notifications can be used to send additional processing to mobile push notifications when the destination device is offline.
If you use mobile push notifications well, you may be able to realize a flow in which you can notify the player by using mobile push notifications even if you end the game during matchmaking and return to the game.
Type Condition Require Default Limitation Description gatewayNamespaceId string ✓ “grn:gs2:{region}:{ownerId}:gateway:default” ~ 1024 chars GS2-Gateway namespace to use for push notifications enableTransferMobileNotification bool? false Forwarding to mobile push notification sound string {enableTransferMobileNotification} == true ~ 1024 chars Sound file name to be used for mobile push notifications
Methods describeNamespaces Get list of namespaces
Request Type Condition Require Default Limitation Description pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data limit int ✓ 30 1 ~ 1000 Number of data acquired
Result Type Description items List<Namespace> List of Namespace nextPageToken string Page token to retrieve the rest of the listing
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . DescribeNamespaces (
& distributor . 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\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\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.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.DescribeNamespacesRequest ;
import io.gs2.distributor.result.DescribeNamespacesResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( 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.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.DescribeNamespacesRequest ;
using Gs2.Gs2Distributor.Result.DescribeNamespacesResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . DescribeNamespacesResult > asyncResult = null ;
yield return client . DescribeNamespaces (
new Gs2 . Gs2Distributor . Request . DescribeNamespacesRequest ()
. WithPageToken ( null )
. WithLimit ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var items = result . Items ;
var nextPageToken = result . NextPageToken ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . describeNamespaces (
new Gs2Distributor . 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 distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . describe_namespaces (
distributor . 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 ( 'distributor' )
api_result = client.describe_namespaces ({
pageToken = nil ,
limit = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
createNamespace Create a new namespace
Request Type Condition Require Default Limitation Description name string ✓ ~ 32 chars Namespace name description string ~ 1024 chars Description assumeUserId string ~ 1024 chars User GRN autoRunStampSheetNotification NotificationSetting ✓ Push notification when stamp sheet auto-execution is complete logSetting LogSetting Log output settings
Result Type Description item Namespace Namespace created
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . CreateNamespace (
& distributor . CreateNamespaceRequest {
Name : pointy . String ( "namespace1" ),
Description : nil ,
AssumeUserId : pointy . String ( "grn:gs2::YourOwnerId:identifier:user:user-0001" ),
AutoRunStampSheetNotification : nil ,
LogSetting : & distributor . LogSetting {
LoggingNamespaceId : pointy . String ( "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ),
},
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\Request\CreateNamespaceRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> createNamespace (
( new CreateNamespaceRequest ())
-> withName ( self :: namespace1 )
-> withDescription ( null )
-> withAssumeUserId ( "grn:gs2::YourOwnerId:identifier:user:user-0001" )
-> withAutoRunStampSheetNotification ( null )
-> withLogSetting (( new \Gs2\Distributor\Model\LogSetting ())
-> withLoggingNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:log: \n amespace1" ))
);
$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.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.CreateNamespaceRequest ;
import io.gs2.distributor.result.CreateNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( session );
try {
CreateNamespaceResult result = client . createNamespace (
new CreateNamespaceRequest ()
. withName ( "namespace1" )
. withDescription ( null )
. withAssumeUserId ( "grn:gs2::YourOwnerId:identifier:user:user-0001" )
. withAutoRunStampSheetNotification ( null )
. withLogSetting ( new io . gs2 . distributor . model . LogSetting ()
. withLoggingNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ))
);
Namespace item = result . getItem ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.CreateNamespaceRequest ;
using Gs2.Gs2Distributor.Result.CreateNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . CreateNamespaceResult > asyncResult = null ;
yield return client . CreateNamespace (
new Gs2 . Gs2Distributor . Request . CreateNamespaceRequest ()
. WithName ( "namespace1" )
. WithDescription ( null )
. WithAssumeUserId ( "grn:gs2::YourOwnerId:identifier:user:user-0001" )
. WithAutoRunStampSheetNotification ( null )
. WithLogSetting ( new Gs2 . Gs2Distributor . Model . LogSetting ()
. WithLoggingNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" )),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . createNamespace (
new Gs2Distributor . CreateNamespaceRequest ()
. withName ( "namespace1" )
. withDescription ( null )
. withAssumeUserId ( "grn:gs2::YourOwnerId:identifier:user:user-0001" )
. withAutoRunStampSheetNotification ( null )
. withLogSetting ( new Gs2Distributor . model . LogSetting ()
. withLoggingNamespaceId ( "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1" ))
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . create_namespace (
distributor . CreateNamespaceRequest ()
. with_name ( self . hash1 )
. with_description ( None )
. with_assume_user_id ( 'grn:gs2::YourOwnerId:identifier:user:user-0001' )
. with_auto_run_stamp_sheet_notification ( None )
. with_log_setting (
distributor . LogSetting ()
. with_logging_namespace_id ( 'grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1' ))
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.create_namespace ({
name = 'namespace1' ,
description = nil ,
assumeUserId = 'grn:gs2::YourOwnerId:identifier:user:user-0001' ,
autoRunStampSheetNotification = nil ,
logSetting = {
loggingNamespaceId = 'grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1' ,
},
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
getNamespaceStatus Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name
Result Type Description status string
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . GetNamespaceStatus (
& distributor . 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\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\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.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.GetNamespaceStatusRequest ;
import io.gs2.distributor.result.GetNamespaceStatusResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( 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.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.GetNamespaceStatusRequest ;
using Gs2.Gs2Distributor.Result.GetNamespaceStatusResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . GetNamespaceStatusResult > asyncResult = null ;
yield return client . GetNamespaceStatus (
new Gs2 . Gs2Distributor . Request . GetNamespaceStatusRequest ()
. WithNamespaceName ( "namespace1" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var status = result . Status ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . getNamespaceStatus (
new Gs2Distributor . GetNamespaceStatusRequest ()
. withNamespaceName ( "namespace1" )
);
const status = result . getStatus ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . get_namespace_status (
distributor . GetNamespaceStatusRequest ()
. with_namespace_name ( self . hash1 )
)
status = result . status
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.get_namespace_status ({
namespaceName = 'namespace1' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
status = result.status ;
getNamespace Get namespace
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . GetNamespace (
& distributor . 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\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\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.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.GetNamespaceRequest ;
import io.gs2.distributor.result.GetNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( 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.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.GetNamespaceRequest ;
using Gs2.Gs2Distributor.Result.GetNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . GetNamespaceResult > asyncResult = null ;
yield return client . GetNamespace (
new Gs2 . Gs2Distributor . Request . GetNamespaceRequest ()
. WithNamespaceName ( "namespace1" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . getNamespace (
new Gs2Distributor . GetNamespaceRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . get_namespace (
distributor . GetNamespaceRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.get_namespace ({
namespaceName = 'namespace1' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
updateNamespace Update namespace
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name description string ~ 1024 chars Description assumeUserId string ~ 1024 chars User GRN autoRunStampSheetNotification NotificationSetting ✓ Push notification when stamp sheet auto-execution is complete logSetting LogSetting Log output settings
Result Type Description item Namespace Updated namespace
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . UpdateNamespace (
& distributor . UpdateNamespaceRequest {
NamespaceName : pointy . String ( "namespace1" ),
Description : pointy . String ( "description1" ),
AssumeUserId : pointy . String ( "grn:gs2::YourOwnerId:identifier:user:user-0001" ),
AutoRunStampSheetNotification : nil ,
LogSetting : 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\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\Request\UpdateNamespaceRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateNamespace (
( new UpdateNamespaceRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withDescription ( "description1" )
-> withAssumeUserId ( "grn:gs2::YourOwnerId:identifier:user:user-0001" )
-> withAutoRunStampSheetNotification ( null )
-> withLogSetting ( 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.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.UpdateNamespaceRequest ;
import io.gs2.distributor.result.UpdateNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( session );
try {
UpdateNamespaceResult result = client . updateNamespace (
new UpdateNamespaceRequest ()
. withNamespaceName ( "namespace1" )
. withDescription ( "description1" )
. withAssumeUserId ( "grn:gs2::YourOwnerId:identifier:user:user-0001" )
. withAutoRunStampSheetNotification ( null )
. withLogSetting ( 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.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.UpdateNamespaceRequest ;
using Gs2.Gs2Distributor.Result.UpdateNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . UpdateNamespaceResult > asyncResult = null ;
yield return client . UpdateNamespace (
new Gs2 . Gs2Distributor . Request . UpdateNamespaceRequest ()
. WithNamespaceName ( "namespace1" )
. WithDescription ( "description1" )
. WithAssumeUserId ( "grn:gs2::YourOwnerId:identifier:user:user-0001" )
. WithAutoRunStampSheetNotification ( null )
. WithLogSetting ( 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 Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . updateNamespace (
new Gs2Distributor . UpdateNamespaceRequest ()
. withNamespaceName ( "namespace1" )
. withDescription ( "description1" )
. withAssumeUserId ( "grn:gs2::YourOwnerId:identifier:user:user-0001" )
. withAutoRunStampSheetNotification ( null )
. withLogSetting ( null )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . update_namespace (
distributor . UpdateNamespaceRequest ()
. with_namespace_name ( self . hash1 )
. with_description ( 'description1' )
. with_assume_user_id ( 'grn:gs2::YourOwnerId:identifier:user:user-0001' )
. with_auto_run_stamp_sheet_notification ( None )
. with_log_setting ( None )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.update_namespace ({
namespaceName = 'namespace1' ,
description = 'description1' ,
assumeUserId = 'grn:gs2::YourOwnerId:identifier:user:user-0001' ,
autoRunStampSheetNotification = nil ,
logSetting = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
deleteNamespace Delete namespace
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name
Result Type Description item Namespace Deleted namespace
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . DeleteNamespace (
& distributor . 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\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\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.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.DeleteNamespaceRequest ;
import io.gs2.distributor.result.DeleteNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( 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.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.DeleteNamespaceRequest ;
using Gs2.Gs2Distributor.Result.DeleteNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . DeleteNamespaceResult > asyncResult = null ;
yield return client . DeleteNamespace (
new Gs2 . Gs2Distributor . Request . DeleteNamespaceRequest ()
. WithNamespaceName ( "namespace1" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . deleteNamespace (
new Gs2Distributor . DeleteNamespaceRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . delete_namespace (
distributor . DeleteNamespaceRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.delete_namespace ({
namespaceName = 'namespace1' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
describeDistributorModelMasters Get list of delivery setting masters
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data limit int ✓ 30 1 ~ 1000 Number of data acquired
Result Type Description items List<DistributorModelMaster> List of delivery setting masters nextPageToken string Page token to retrieve the rest of the listing
Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . DescribeDistributorModelMasters (
& distributor . DescribeDistributorModelMastersRequest {
NamespaceName : pointy . String ( "namespace1" ),
PageToken : nil ,
Limit : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
nextPageToken := result . NextPageToken
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\Request\DescribeDistributorModelMastersRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeDistributorModelMasters (
( new DescribeDistributorModelMastersRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withPageToken ( null )
-> withLimit ( null )
);
$items = $result -> getItems ();
$nextPageToken = $result -> getNextPageToken ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.DescribeDistributorModelMastersRequest ;
import io.gs2.distributor.result.DescribeDistributorModelMastersResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( session );
try {
DescribeDistributorModelMastersResult result = client . describeDistributorModelMasters (
new DescribeDistributorModelMastersRequest ()
. withNamespaceName ( "namespace1" )
. withPageToken ( null )
. withLimit ( null )
);
List < DistributorModelMaster > 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.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.DescribeDistributorModelMastersRequest ;
using Gs2.Gs2Distributor.Result.DescribeDistributorModelMastersResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . DescribeDistributorModelMastersResult > asyncResult = null ;
yield return client . DescribeDistributorModelMasters (
new Gs2 . Gs2Distributor . Request . DescribeDistributorModelMastersRequest ()
. WithNamespaceName ( "namespace1" )
. WithPageToken ( null )
. WithLimit ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var items = result . Items ;
var nextPageToken = result . NextPageToken ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . describeDistributorModelMasters (
new Gs2Distributor . DescribeDistributorModelMastersRequest ()
. withNamespaceName ( "namespace1" )
. withPageToken ( null )
. withLimit ( null )
);
const items = result . getItems ();
const nextPageToken = result . getNextPageToken ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . describe_distributor_model_masters (
distributor . DescribeDistributorModelMastersRequest ()
. with_namespace_name ( self . hash1 )
. with_page_token ( None )
. with_limit ( None )
)
items = result . items
next_page_token = result . next_page_token
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.describe_distributor_model_masters ({
namespaceName = 'namespace1' ,
pageToken = nil ,
limit = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
nextPageToken = result.nextPageToken ;
createDistributorModelMaster Create a new master distribution setting
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name name string ✓ ~ 128 chars delivery setting name description string ~ 1024 chars Description metadata string ~ 2048 chars metadata inboxNamespaceId string ~ 1024 chars Namespace GRN whiteListTargetIds List<string> [] ~ 100 items Whitelist of target resource GRNs that can be processed through the distributor
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . CreateDistributorModelMaster (
& distributor . CreateDistributorModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
Name : pointy . String ( "distributor-model-0001" ),
Description : nil ,
Metadata : nil ,
InboxNamespaceId : nil ,
WhiteListTargetIds : 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\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\Request\CreateDistributorModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> createDistributorModelMaster (
( new CreateDistributorModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withName ( "distributor-model-0001" )
-> withDescription ( null )
-> withMetadata ( null )
-> withInboxNamespaceId ( null )
-> withWhiteListTargetIds ( 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.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.CreateDistributorModelMasterRequest ;
import io.gs2.distributor.result.CreateDistributorModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( session );
try {
CreateDistributorModelMasterResult result = client . createDistributorModelMaster (
new CreateDistributorModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withName ( "distributor-model-0001" )
. withDescription ( null )
. withMetadata ( null )
. withInboxNamespaceId ( null )
. withWhiteListTargetIds ( null )
);
DistributorModelMaster 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.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.CreateDistributorModelMasterRequest ;
using Gs2.Gs2Distributor.Result.CreateDistributorModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . CreateDistributorModelMasterResult > asyncResult = null ;
yield return client . CreateDistributorModelMaster (
new Gs2 . Gs2Distributor . Request . CreateDistributorModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithName ( "distributor-model-0001" )
. WithDescription ( null )
. WithMetadata ( null )
. WithInboxNamespaceId ( null )
. WithWhiteListTargetIds ( 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 Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . createDistributorModelMaster (
new Gs2Distributor . CreateDistributorModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withName ( "distributor-model-0001" )
. withDescription ( null )
. withMetadata ( null )
. withInboxNamespaceId ( null )
. withWhiteListTargetIds ( null )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . create_distributor_model_master (
distributor . CreateDistributorModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_name ( 'distributor-model-0001' )
. with_description ( None )
. with_metadata ( None )
. with_inbox_namespace_id ( None )
. with_white_list_target_ids ( None )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.create_distributor_model_master ({
namespaceName = 'namespace1' ,
name = 'distributor-model-0001' ,
description = nil ,
metadata = nil ,
inboxNamespaceId = nil ,
whiteListTargetIds = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
getDistributorModelMaster Get delivery setting master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name distributorName string ✓ ~ 128 chars delivery setting name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . GetDistributorModelMaster (
& distributor . GetDistributorModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
DistributorName : pointy . String ( "distributor-model-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\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\Request\GetDistributorModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getDistributorModelMaster (
( new GetDistributorModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withDistributorName ( "distributor-model-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.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.GetDistributorModelMasterRequest ;
import io.gs2.distributor.result.GetDistributorModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( session );
try {
GetDistributorModelMasterResult result = client . getDistributorModelMaster (
new GetDistributorModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withDistributorName ( "distributor-model-0001" )
);
DistributorModelMaster 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.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.GetDistributorModelMasterRequest ;
using Gs2.Gs2Distributor.Result.GetDistributorModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . GetDistributorModelMasterResult > asyncResult = null ;
yield return client . GetDistributorModelMaster (
new Gs2 . Gs2Distributor . Request . GetDistributorModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithDistributorName ( "distributor-model-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 Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . getDistributorModelMaster (
new Gs2Distributor . GetDistributorModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withDistributorName ( "distributor-model-0001" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . get_distributor_model_master (
distributor . GetDistributorModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_distributor_name ( 'distributor-model-0001' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.get_distributor_model_master ({
namespaceName = 'namespace1' ,
distributorName = 'distributor-model-0001' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
updateDistributorModelMaster Update distribution setting master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name distributorName string ✓ ~ 128 chars delivery setting name description string ~ 1024 chars Description metadata string ~ 2048 chars metadata inboxNamespaceId string ~ 1024 chars Namespace GRN whiteListTargetIds List<string> [] ~ 100 items Whitelist of target resource GRNs that can be processed through the distributor
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . UpdateDistributorModelMaster (
& distributor . UpdateDistributorModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
DistributorName : pointy . String ( "distributor-model-0001" ),
Description : pointy . String ( "description1" ),
Metadata : pointy . String ( "{\"hoge\": \"fuga\"}" ),
InboxNamespaceId : pointy . String ( "inbox-0001" ),
WhiteListTargetIds : [] * string {
pointy . String ( "grn:AAA" ),
pointy . String ( "grn:BBB" ),
},
}
)
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\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\Request\UpdateDistributorModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateDistributorModelMaster (
( new UpdateDistributorModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withDistributorName ( "distributor-model-0001" )
-> withDescription ( "description1" )
-> withMetadata ( "{ \" hoge \" : \" fuga \" }" )
-> withInboxNamespaceId ( "inbox-0001" )
-> withWhiteListTargetIds ([ "grn:AAA" ,
"grn:BBB" ,
])
);
$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.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.UpdateDistributorModelMasterRequest ;
import io.gs2.distributor.result.UpdateDistributorModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( session );
try {
UpdateDistributorModelMasterResult result = client . updateDistributorModelMaster (
new UpdateDistributorModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withDistributorName ( "distributor-model-0001" )
. withDescription ( "description1" )
. withMetadata ( "{\"hoge\": \"fuga\"}" )
. withInboxNamespaceId ( "inbox-0001" )
. withWhiteListTargetIds ( Arrays . asList (
"grn:AAA" ,
"grn:BBB"
))
);
DistributorModelMaster 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.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.UpdateDistributorModelMasterRequest ;
using Gs2.Gs2Distributor.Result.UpdateDistributorModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . UpdateDistributorModelMasterResult > asyncResult = null ;
yield return client . UpdateDistributorModelMaster (
new Gs2 . Gs2Distributor . Request . UpdateDistributorModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithDistributorName ( "distributor-model-0001" )
. WithDescription ( "description1" )
. WithMetadata ( "{\"hoge\": \"fuga\"}" )
. WithInboxNamespaceId ( "inbox-0001" )
. WithWhiteListTargetIds ( new string [] {
"grn:AAA" ,
"grn:BBB"
}),
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 Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . updateDistributorModelMaster (
new Gs2Distributor . UpdateDistributorModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withDistributorName ( "distributor-model-0001" )
. withDescription ( "description1" )
. withMetadata ( "{\"hoge\": \"fuga\"}" )
. withInboxNamespaceId ( "inbox-0001" )
. withWhiteListTargetIds ([
"grn:AAA" ,
"grn:BBB"
])
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . update_distributor_model_master (
distributor . UpdateDistributorModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_distributor_name ( 'distributor-model-0001' )
. with_description ( 'description1' )
. with_metadata ( '{"hoge": "fuga"}' )
. with_inbox_namespace_id ( 'inbox-0001' )
. with_white_list_target_ids ([ 'grn:AAA' ,
'grn:BBB' ,
])
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.update_distributor_model_master ({
namespaceName = 'namespace1' ,
distributorName = 'distributor-model-0001' ,
description = 'description1' ,
metadata = '{"hoge": "fuga"}' ,
inboxNamespaceId = 'inbox-0001' ,
whiteListTargetIds = {
'grn:AAA' ,
'grn:BBB'
},
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
deleteDistributorModelMaster Delete distribution setting master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name distributorName string ✓ ~ 128 chars delivery setting name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . DeleteDistributorModelMaster (
& distributor . DeleteDistributorModelMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
DistributorName : pointy . String ( "distributor-model-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\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\Request\DeleteDistributorModelMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> deleteDistributorModelMaster (
( new DeleteDistributorModelMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withDistributorName ( "distributor-model-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.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.DeleteDistributorModelMasterRequest ;
import io.gs2.distributor.result.DeleteDistributorModelMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( session );
try {
DeleteDistributorModelMasterResult result = client . deleteDistributorModelMaster (
new DeleteDistributorModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withDistributorName ( "distributor-model-0001" )
);
DistributorModelMaster 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.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.DeleteDistributorModelMasterRequest ;
using Gs2.Gs2Distributor.Result.DeleteDistributorModelMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . DeleteDistributorModelMasterResult > asyncResult = null ;
yield return client . DeleteDistributorModelMaster (
new Gs2 . Gs2Distributor . Request . DeleteDistributorModelMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithDistributorName ( "distributor-model-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 Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . deleteDistributorModelMaster (
new Gs2Distributor . DeleteDistributorModelMasterRequest ()
. withNamespaceName ( "namespace1" )
. withDistributorName ( "distributor-model-0001" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . delete_distributor_model_master (
distributor . DeleteDistributorModelMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_distributor_name ( 'distributor-model-0001' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.delete_distributor_model_master ({
namespaceName = 'namespace1' ,
distributorName = 'distributor-model-0001' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
describeDistributorModels Get list of delivery settings
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . DescribeDistributorModels (
& distributor . DescribeDistributorModelsRequest {
NamespaceName : pointy . String ( "namespace1" ),
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\Request\DescribeDistributorModelsRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeDistributorModels (
( new DescribeDistributorModelsRequest ())
-> withNamespaceName ( self :: namespace1 )
);
$items = $result -> getItems ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.DescribeDistributorModelsRequest ;
import io.gs2.distributor.result.DescribeDistributorModelsResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( session );
try {
DescribeDistributorModelsResult result = client . describeDistributorModels (
new DescribeDistributorModelsRequest ()
. withNamespaceName ( "namespace1" )
);
List < DistributorModel > items = result . getItems ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.DescribeDistributorModelsRequest ;
using Gs2.Gs2Distributor.Result.DescribeDistributorModelsResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . DescribeDistributorModelsResult > asyncResult = null ;
yield return client . DescribeDistributorModels (
new Gs2 . Gs2Distributor . Request . DescribeDistributorModelsRequest ()
. WithNamespaceName ( "namespace1" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var items = result . Items ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . describeDistributorModels (
new Gs2Distributor . DescribeDistributorModelsRequest ()
. withNamespaceName ( "namespace1" )
);
const items = result . getItems ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . describe_distributor_models (
distributor . DescribeDistributorModelsRequest ()
. with_namespace_name ( self . hash1 )
)
items = result . items
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.describe_distributor_models ({
namespaceName = 'namespace1' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
items = result.items ;
getDistributorModel Get delivery setting
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name distributorName string ✓ ~ 128 chars Delivery setting name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . GetDistributorModel (
& distributor . GetDistributorModelRequest {
NamespaceName : pointy . String ( "namespace1" ),
DistributorName : pointy . String ( "distributor-model-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\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\Request\GetDistributorModelRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getDistributorModel (
( new GetDistributorModelRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withDistributorName ( "distributor-model-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.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.GetDistributorModelRequest ;
import io.gs2.distributor.result.GetDistributorModelResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( session );
try {
GetDistributorModelResult result = client . getDistributorModel (
new GetDistributorModelRequest ()
. withNamespaceName ( "namespace1" )
. withDistributorName ( "distributor-model-0001" )
);
DistributorModel 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.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.GetDistributorModelRequest ;
using Gs2.Gs2Distributor.Result.GetDistributorModelResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . GetDistributorModelResult > asyncResult = null ;
yield return client . GetDistributorModel (
new Gs2 . Gs2Distributor . Request . GetDistributorModelRequest ()
. WithNamespaceName ( "namespace1" )
. WithDistributorName ( "distributor-model-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 Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . getDistributorModel (
new Gs2Distributor . GetDistributorModelRequest ()
. withNamespaceName ( "namespace1" )
. withDistributorName ( "distributor-model-0001" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . get_distributor_model (
distributor . GetDistributorModelRequest ()
. with_namespace_name ( self . hash1 )
. with_distributor_name ( 'distributor-model-0001' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.get_distributor_model ({
namespaceName = 'namespace1' ,
distributorName = 'distributor-model-0001' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
exportMaster Export master data for currently active delivery configurations
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . ExportMaster (
& distributor . ExportMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\Request\ExportMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> exportMaster (
( new ExportMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.ExportMasterRequest ;
import io.gs2.distributor.result.ExportMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( session );
try {
ExportMasterResult result = client . exportMaster (
new ExportMasterRequest ()
. withNamespaceName ( "namespace1" )
);
CurrentDistributorMaster 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.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.ExportMasterRequest ;
using Gs2.Gs2Distributor.Result.ExportMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . ExportMasterResult > asyncResult = null ;
yield return client . ExportMaster (
new Gs2 . Gs2Distributor . Request . ExportMasterRequest ()
. WithNamespaceName ( "namespace1" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . exportMaster (
new Gs2Distributor . ExportMasterRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . export_master (
distributor . ExportMasterRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.export_master ({
namespaceName = 'namespace1' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
getCurrentDistributorMaster Retrieve the currently active delivery settings
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . GetCurrentDistributorMaster (
& distributor . GetCurrentDistributorMasterRequest {
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\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\Request\GetCurrentDistributorMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getCurrentDistributorMaster (
( new GetCurrentDistributorMasterRequest ())
-> 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.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.GetCurrentDistributorMasterRequest ;
import io.gs2.distributor.result.GetCurrentDistributorMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( session );
try {
GetCurrentDistributorMasterResult result = client . getCurrentDistributorMaster (
new GetCurrentDistributorMasterRequest ()
. withNamespaceName ( "namespace1" )
);
CurrentDistributorMaster 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.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.GetCurrentDistributorMasterRequest ;
using Gs2.Gs2Distributor.Result.GetCurrentDistributorMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . GetCurrentDistributorMasterResult > asyncResult = null ;
yield return client . GetCurrentDistributorMaster (
new Gs2 . Gs2Distributor . Request . GetCurrentDistributorMasterRequest ()
. 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 Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . getCurrentDistributorMaster (
new Gs2Distributor . GetCurrentDistributorMasterRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . get_current_distributor_master (
distributor . GetCurrentDistributorMasterRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.get_current_distributor_master ({
namespaceName = 'namespace1' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
updateCurrentDistributorMaster Update the currently active delivery settings
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name settings string ✓ ~ 5242880 chars Master data
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . UpdateCurrentDistributorMaster (
& distributor . UpdateCurrentDistributorMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
Settings : pointy . String ( "{\n \"version\": \"2019-03-01\",\n \"distributorModels\": [\n {\n \"name\": \"basic\",\n \"metadata\": \"BASIC\",\n \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\"\n },\n {\n \"name\": \"special\",\n \"metadata\": \"SPECIAL\",\n \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\",\n \"whiteListTargetIds\": [\n \"test\"\n ]\n }\n ]\n}" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\Request\UpdateCurrentDistributorMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateCurrentDistributorMaster (
( new UpdateCurrentDistributorMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withSettings ( "{ \n \" version \" : \" 2019-03-01 \" , \n \" distributorModels \" : [ \n { \n \" name \" : \" basic \" , \n \" metadata \" : \" BASIC \" , \n \" inboxNamespaceId \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001 \"\n }, \n { \n \" name \" : \" special \" , \n \" metadata \" : \" SPECIAL \" , \n \" inboxNamespaceId \" : \" grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001 \" , \n \" whiteListTargetIds \" : [ \n \" test \"\n ] \n } \n ] \n }" )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.UpdateCurrentDistributorMasterRequest ;
import io.gs2.distributor.result.UpdateCurrentDistributorMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( session );
try {
UpdateCurrentDistributorMasterResult result = client . updateCurrentDistributorMaster (
new UpdateCurrentDistributorMasterRequest ()
. withNamespaceName ( "namespace1" )
. withSettings ( "{\n \"version\": \"2019-03-01\",\n \"distributorModels\": [\n {\n \"name\": \"basic\",\n \"metadata\": \"BASIC\",\n \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\"\n },\n {\n \"name\": \"special\",\n \"metadata\": \"SPECIAL\",\n \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\",\n \"whiteListTargetIds\": [\n \"test\"\n ]\n }\n ]\n}" )
);
CurrentDistributorMaster 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.Gs2Distributor.Gs2DistributorRestClient ;
using Gs2.Gs2Distributor.Request.UpdateCurrentDistributorMasterRequest ;
using Gs2.Gs2Distributor.Result.UpdateCurrentDistributorMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2DistributorRestClient ( session );
AsyncResult < Gs2 . Gs2Distributor . Result . UpdateCurrentDistributorMasterResult > asyncResult = null ;
yield return client . UpdateCurrentDistributorMaster (
new Gs2 . Gs2Distributor . Request . UpdateCurrentDistributorMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithSettings ( "{\n \"version\": \"2019-03-01\",\n \"distributorModels\": [\n {\n \"name\": \"basic\",\n \"metadata\": \"BASIC\",\n \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\"\n },\n {\n \"name\": \"special\",\n \"metadata\": \"SPECIAL\",\n \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\",\n \"whiteListTargetIds\": [\n \"test\"\n ]\n }\n ]\n}" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Distributor from '@/gs2/distributor' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Distributor . Gs2DistributorRestClient ( session );
try {
const result = await client . updateCurrentDistributorMaster (
new Gs2Distributor . UpdateCurrentDistributorMasterRequest ()
. withNamespaceName ( "namespace1" )
. withSettings ( "{\n \"version\": \"2019-03-01\",\n \"distributorModels\": [\n {\n \"name\": \"basic\",\n \"metadata\": \"BASIC\",\n \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\"\n },\n {\n \"name\": \"special\",\n \"metadata\": \"SPECIAL\",\n \"inboxNamespaceId\": \"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001\",\n \"whiteListTargetIds\": [\n \"test\"\n ]\n }\n ]\n}" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import distributor
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = distributor . Gs2DistributorRestClient ( session )
try :
result = client . update_current_distributor_master (
distributor . UpdateCurrentDistributorMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_settings ( '{ \n "version": "2019-03-01", \n "distributorModels": [ \n { \n "name": "basic", \n "metadata": "BASIC", \n "inboxNamespaceId": "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001" \n }, \n { \n "name": "special", \n "metadata": "SPECIAL", \n "inboxNamespaceId": "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001", \n "whiteListTargetIds": [ \n "test" \n ] \n } \n ] \n }' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'distributor' )
api_result = client.update_current_distributor_master ({
namespaceName = 'namespace1' ,
settings = '{ \n "version": "2019-03-01", \n "distributorModels": [ \n { \n "name": "basic", \n "metadata": "BASIC", \n "inboxNamespaceId": "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001" \n }, \n { \n "name": "special", \n "metadata": "SPECIAL", \n "inboxNamespaceId": "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001", \n "whiteListTargetIds": [ \n "test" \n ] \n } \n ] \n }' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
updateCurrentDistributorMasterFromGitHub Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name checkoutSetting GitHubCheckoutSetting ✓ Setup to check out master data from GitHub
Result Implementation Example
Language:
Go
PHP
Java
C#
TypeScript
Python
GS2-Script import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/distributor"
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 := distributor . Gs2DistributorRestClient {
Session : & session ,
}
result , err := client . UpdateCurrentDistributorMasterFromGitHub (
& distributor . UpdateCurrentDistributorMasterFromGitHubRequest {
NamespaceName : pointy . String ( "namespace1" ),
CheckoutSetting : { ' apiKeyId ' : '$ gitHubApiKey1 . apiKeyId ' , ' repositoryName ' : ' gs2io / master - data ' , ' sourcePath ' : ' path / to / file . json ' , ' referenceType ' : ' branch ' , ' branchName ' : ' develop ' },
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Distributor\Gs2DistributorRestClient ;
use Gs2\Distributor\Request\UpdateCurrentDistributorMasterFromGitHubRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateCurrentDistributorMasterFromGitHub (
( new UpdateCurrentDistributorMasterFromGitHubRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withCheckoutSetting ({ 'apiKeyId' : '$gitHubApiKey1.apiKeyId' , 'repositoryName' : 'gs2io/master-data' , 'sourcePath' : 'path/to/file.json' , 'referenceType' : 'branch' , 'branchName' : 'develop' })
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.distributor.rest.Gs2DistributorRestClient ;
import io.gs2.distributor.request.UpdateCurrentDistributorMasterFromGitHubRequest ;
import io.gs2.distributor.result.UpdateCurrentDistributorMasterFromGitHubResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2DistributorRestClient client = new Gs2DistributorRestClient ( session );
try {
UpdateCurrentDistributorMasterFromGitHubResult result = client . updateCurrentDistributorMasterFromGitHub (
new UpdateCurrentDistributorMasterFromGitHubRequest ()
. withNamespaceName ( "namespace1" )
. withCheckoutSetting ({ ' apiKeyId ' : ' $gitHubApiKey1 . apiKeyId ' , ' repositoryName ' : ' gs2io / master - data ' , ' sourcePath ' : ' path /