API Reference of GS2-StateMachine 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 startScript ScriptSetting Script to execute when starting the state machine passScript ScriptSetting Script to execute when the state machine is successfully completed errorScript ScriptSetting Script to execute when the state machine fails lowestStateMachineVersion long Lowest version of the state machine logSetting LogSetting Log output settings createdAt long ✓ Datetime of creation updatedAt long ✓ Datetime of last update revision long 0 ~ 9223372036854775805 Revision
StateMachineMaster State machine definition
manages state machines written in GSL.
Type Condition Require Default Limitation Description stateMachineId string ✓ ~ 1024 chars State Machine Master GRN mainStateMachineName string ✓ ~ 128 chars Main state machine name payload string ✓ ~ 5242880 chars State machine definition version long ✓ Version createdAt long ✓ Datetime of creation updatedAt long ✓ Datetime of last update revision long 0 ~ 9223372036854775805 Revision
Status Status of state machine
Type Condition Require Default Limitation Description statusId string ✓ ~ 1024 chars Status of State Machine GRN userId string ✓ ~ 128 chars User Id name string ✓ UUID ~ 36 chars Status name stateMachineVersion long ✓ Version of state machine stacks List<StackEntry> ~ 1024 items Stack variables List<Variable> ~ 1000 items State variables for each state machine status enum [ “Running”, “Wait”, “Pass”, “Error” ] ✓ “Running” ~ 128 chars Status lastError string ~ 1024 chars Last error transitionCount int ✓ 0 ~ 2147483645 Number of transitions createdAt long ✓ Datetime of creation updatedAt long ✓ Datetime of last update
StackEntry Type Condition Require Default Limitation Description stateMachineName string ✓ ~ 128 chars Name of the state machine taskName string ✓ ~ 128 chars Task name
Variable Type Condition Require Default Limitation Description stateMachineName string ✓ ~ 128 chars Name of the state machine value string ✓ ~ 1048576 chars Value
LogSetting Type Condition Require Default Limitation Description loggingNamespaceId string ✓ ~ 1024 chars Namespace GRN
ScriptSetting Type Condition Require Default Limitation Description triggerScriptId string ~ 1024 chars Script GRN doneTriggerTargetType enum [ “none”, “gs2_script”, “aws” ] ✓ “none” ~ 128 chars Notification of Completion doneTriggerScriptId string {doneTriggerTargetType} == “gs2_script” ~ 1024 chars Script GRN doneTriggerQueueNamespaceId string {doneTriggerTargetType} == “gs2_script” ~ 1024 chars Namespace GRN
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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . DescribeNamespaces (
& state_machine . 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\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\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.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.DescribeNamespacesRequest ;
import io.gs2.stateMachine.result.DescribeNamespacesResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( 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.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.DescribeNamespacesRequest ;
using Gs2.Gs2StateMachine.Result.DescribeNamespacesResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . DescribeNamespacesResult > asyncResult = null ;
yield return client . DescribeNamespaces (
new Gs2 . Gs2StateMachine . 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 Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . describeNamespaces (
new Gs2StateMachine . 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 state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . describe_namespaces (
state_machine . 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 ( 'stateMachine' )
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 startScript ScriptSetting Script to execute when starting the state machine passScript ScriptSetting Script to execute when the state machine is successfully completed errorScript ScriptSetting Script to execute when the state machine fails lowestStateMachineVersion long Lowest version of the state machine 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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . CreateNamespace (
& state_machine . CreateNamespaceRequest {
Name : pointy . String ( "namespace1" ),
Description : nil ,
StartScript : nil ,
PassScript : nil ,
ErrorScript : nil ,
LowestStateMachineVersion : nil ,
LogSetting : & stateMachine . 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\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\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 )
-> withStartScript ( null )
-> withPassScript ( null )
-> withErrorScript ( null )
-> withLowestStateMachineVersion ( null )
-> withLogSetting (( new \Gs2\StateMachine\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.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.CreateNamespaceRequest ;
import io.gs2.stateMachine.result.CreateNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( session );
try {
CreateNamespaceResult result = client . createNamespace (
new CreateNamespaceRequest ()
. withName ( "namespace1" )
. withDescription ( null )
. withStartScript ( null )
. withPassScript ( null )
. withErrorScript ( null )
. withLowestStateMachineVersion ( null )
. withLogSetting ( new io . gs2 . stateMachine . 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.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.CreateNamespaceRequest ;
using Gs2.Gs2StateMachine.Result.CreateNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . CreateNamespaceResult > asyncResult = null ;
yield return client . CreateNamespace (
new Gs2 . Gs2StateMachine . Request . CreateNamespaceRequest ()
. WithName ( "namespace1" )
. WithDescription ( null )
. WithStartScript ( null )
. WithPassScript ( null )
. WithErrorScript ( null )
. WithLowestStateMachineVersion ( null )
. WithLogSetting ( new Gs2 . Gs2StateMachine . 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 Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . createNamespace (
new Gs2StateMachine . CreateNamespaceRequest ()
. withName ( "namespace1" )
. withDescription ( null )
. withStartScript ( null )
. withPassScript ( null )
. withErrorScript ( null )
. withLowestStateMachineVersion ( null )
. withLogSetting ( new Gs2StateMachine . 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 state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . create_namespace (
state_machine . CreateNamespaceRequest ()
. with_name ( self . hash1 )
. with_description ( None )
. with_start_script ( None )
. with_pass_script ( None )
. with_error_script ( None )
. with_lowest_state_machine_version ( None )
. with_log_setting (
state_machine . 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 ( 'stateMachine' )
api_result = client.create_namespace ({
name = 'namespace1' ,
description = nil ,
startScript = nil ,
passScript = nil ,
errorScript = nil ,
lowestStateMachineVersion = 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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . GetNamespaceStatus (
& state_machine . 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\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\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.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.GetNamespaceStatusRequest ;
import io.gs2.stateMachine.result.GetNamespaceStatusResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( 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.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.GetNamespaceStatusRequest ;
using Gs2.Gs2StateMachine.Result.GetNamespaceStatusResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . GetNamespaceStatusResult > asyncResult = null ;
yield return client . GetNamespaceStatus (
new Gs2 . Gs2StateMachine . 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 Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . getNamespaceStatus (
new Gs2StateMachine . GetNamespaceStatusRequest ()
. withNamespaceName ( "namespace1" )
);
const status = result . getStatus ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . get_namespace_status (
state_machine . GetNamespaceStatusRequest ()
. with_namespace_name ( self . hash1 )
)
status = result . status
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'stateMachine' )
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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . GetNamespace (
& state_machine . 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\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\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.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.GetNamespaceRequest ;
import io.gs2.stateMachine.result.GetNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( 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.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.GetNamespaceRequest ;
using Gs2.Gs2StateMachine.Result.GetNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . GetNamespaceResult > asyncResult = null ;
yield return client . GetNamespace (
new Gs2 . Gs2StateMachine . 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 Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . getNamespace (
new Gs2StateMachine . GetNamespaceRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . get_namespace (
state_machine . GetNamespaceRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'stateMachine' )
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 startScript ScriptSetting Script to execute when starting the state machine passScript ScriptSetting Script to execute when the state machine is successfully completed errorScript ScriptSetting Script to execute when the state machine fails lowestStateMachineVersion long Lowest version of the state machine 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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . UpdateNamespace (
& state_machine . UpdateNamespaceRequest {
NamespaceName : pointy . String ( "namespace1" ),
Description : pointy . String ( "description1" ),
StartScript : nil ,
PassScript : nil ,
ErrorScript : nil ,
LowestStateMachineVersion : nil ,
LogSetting : & stateMachine . 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\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\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" )
-> withStartScript ( null )
-> withPassScript ( null )
-> withErrorScript ( null )
-> withLowestStateMachineVersion ( null )
-> withLogSetting (( new \Gs2\StateMachine\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.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.UpdateNamespaceRequest ;
import io.gs2.stateMachine.result.UpdateNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( session );
try {
UpdateNamespaceResult result = client . updateNamespace (
new UpdateNamespaceRequest ()
. withNamespaceName ( "namespace1" )
. withDescription ( "description1" )
. withStartScript ( null )
. withPassScript ( null )
. withErrorScript ( null )
. withLowestStateMachineVersion ( null )
. withLogSetting ( new io . gs2 . stateMachine . 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.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.UpdateNamespaceRequest ;
using Gs2.Gs2StateMachine.Result.UpdateNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . UpdateNamespaceResult > asyncResult = null ;
yield return client . UpdateNamespace (
new Gs2 . Gs2StateMachine . Request . UpdateNamespaceRequest ()
. WithNamespaceName ( "namespace1" )
. WithDescription ( "description1" )
. WithStartScript ( null )
. WithPassScript ( null )
. WithErrorScript ( null )
. WithLowestStateMachineVersion ( null )
. WithLogSetting ( new Gs2 . Gs2StateMachine . 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 Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . updateNamespace (
new Gs2StateMachine . UpdateNamespaceRequest ()
. withNamespaceName ( "namespace1" )
. withDescription ( "description1" )
. withStartScript ( null )
. withPassScript ( null )
. withErrorScript ( null )
. withLowestStateMachineVersion ( null )
. withLogSetting ( new Gs2StateMachine . 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 state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . update_namespace (
state_machine . UpdateNamespaceRequest ()
. with_namespace_name ( self . hash1 )
. with_description ( 'description1' )
. with_start_script ( None )
. with_pass_script ( None )
. with_error_script ( None )
. with_lowest_state_machine_version ( None )
. with_log_setting (
state_machine . 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 ( 'stateMachine' )
api_result = client.update_namespace ({
namespaceName = 'namespace1' ,
description = 'description1' ,
startScript = nil ,
passScript = nil ,
errorScript = nil ,
lowestStateMachineVersion = nil ,
logSetting = {
loggingNamespaceId = 'grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1' ,
},
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
deleteNamespace Delete namespace
Request 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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . DeleteNamespace (
& state_machine . 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\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\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.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.DeleteNamespaceRequest ;
import io.gs2.stateMachine.result.DeleteNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( 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.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.DeleteNamespaceRequest ;
using Gs2.Gs2StateMachine.Result.DeleteNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . DeleteNamespaceResult > asyncResult = null ;
yield return client . DeleteNamespace (
new Gs2 . Gs2StateMachine . 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 Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . deleteNamespace (
new Gs2StateMachine . DeleteNamespaceRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . delete_namespace (
state_machine . DeleteNamespaceRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'stateMachine' )
api_result = client.delete_namespace ({
namespaceName = 'namespace1' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
dumpUserDataByUserId Get dump data of the data associated with the specified user ID
Request Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars User Id
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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . DumpUserDataByUserId (
& state_machine . DumpUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\Request\DumpUserDataByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> dumpUserDataByUserId (
( new DumpUserDataByUserIdRequest ())
-> withUserId ( "user-0001" )
);
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.DumpUserDataByUserIdRequest ;
import io.gs2.stateMachine.result.DumpUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( session );
try {
DumpUserDataByUserIdResult result = client . dumpUserDataByUserId (
new DumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
);
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.DumpUserDataByUserIdRequest ;
using Gs2.Gs2StateMachine.Result.DumpUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . DumpUserDataByUserIdResult > asyncResult = null ;
yield return client . DumpUserDataByUserId (
new Gs2 . Gs2StateMachine . Request . DumpUserDataByUserIdRequest ()
. WithUserId ( "user-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . dumpUserDataByUserId (
new Gs2StateMachine . DumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . dump_user_data_by_user_id (
state_machine . DumpUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'stateMachine' )
api_result = client.dump_user_data_by_user_id ({
userId = 'user-0001' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
checkDumpUserDataByUserId Check if the dump of the data associated with the specified user ID is complete
Request Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars User Id
Result Type Description url string URL of output data
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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . CheckDumpUserDataByUserId (
& state_machine . CheckDumpUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
url := result . Url
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\Request\CheckDumpUserDataByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> checkDumpUserDataByUserId (
( new CheckDumpUserDataByUserIdRequest ())
-> withUserId ( "user-0001" )
);
$url = $result -> getUrl ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.CheckDumpUserDataByUserIdRequest ;
import io.gs2.stateMachine.result.CheckDumpUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( session );
try {
CheckDumpUserDataByUserIdResult result = client . checkDumpUserDataByUserId (
new CheckDumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
);
String url = result . getUrl ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.CheckDumpUserDataByUserIdRequest ;
using Gs2.Gs2StateMachine.Result.CheckDumpUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . CheckDumpUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckDumpUserDataByUserId (
new Gs2 . Gs2StateMachine . Request . CheckDumpUserDataByUserIdRequest ()
. WithUserId ( "user-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var url = result . Url ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . checkDumpUserDataByUserId (
new Gs2StateMachine . CheckDumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
);
const url = result . getUrl ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . check_dump_user_data_by_user_id (
state_machine . CheckDumpUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
)
url = result . url
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'stateMachine' )
api_result = client.check_dump_user_data_by_user_id ({
userId = 'user-0001' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
url = result.url ;
cleanUserDataByUserId Get clean data of the data associated with the specified user ID
Request Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars User Id
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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . CleanUserDataByUserId (
& state_machine . CleanUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\Request\CleanUserDataByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> cleanUserDataByUserId (
( new CleanUserDataByUserIdRequest ())
-> withUserId ( "user-0001" )
);
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.CleanUserDataByUserIdRequest ;
import io.gs2.stateMachine.result.CleanUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( session );
try {
CleanUserDataByUserIdResult result = client . cleanUserDataByUserId (
new CleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
);
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.CleanUserDataByUserIdRequest ;
using Gs2.Gs2StateMachine.Result.CleanUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . CleanUserDataByUserIdResult > asyncResult = null ;
yield return client . CleanUserDataByUserId (
new Gs2 . Gs2StateMachine . Request . CleanUserDataByUserIdRequest ()
. WithUserId ( "user-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . cleanUserDataByUserId (
new Gs2StateMachine . CleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . clean_user_data_by_user_id (
state_machine . CleanUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'stateMachine' )
api_result = client.clean_user_data_by_user_id ({
userId = 'user-0001' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
checkCleanUserDataByUserId Check if the clean of the data associated with the specified user ID is complete
Request Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars User Id
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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . CheckCleanUserDataByUserId (
& state_machine . CheckCleanUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\Request\CheckCleanUserDataByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> checkCleanUserDataByUserId (
( new CheckCleanUserDataByUserIdRequest ())
-> withUserId ( "user-0001" )
);
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.CheckCleanUserDataByUserIdRequest ;
import io.gs2.stateMachine.result.CheckCleanUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( session );
try {
CheckCleanUserDataByUserIdResult result = client . checkCleanUserDataByUserId (
new CheckCleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
);
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.CheckCleanUserDataByUserIdRequest ;
using Gs2.Gs2StateMachine.Result.CheckCleanUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . CheckCleanUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckCleanUserDataByUserId (
new Gs2 . Gs2StateMachine . Request . CheckCleanUserDataByUserIdRequest ()
. WithUserId ( "user-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . checkCleanUserDataByUserId (
new Gs2StateMachine . CheckCleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . check_clean_user_data_by_user_id (
state_machine . CheckCleanUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'stateMachine' )
api_result = client.check_clean_user_data_by_user_id ({
userId = 'user-0001' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
prepareImportUserDataByUserId Start importing data associated with the specified user ID
Request Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars User Id
Result Type Description uploadToken string Token used to reflect results after upload uploadUrl string URL used to upload user data
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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . PrepareImportUserDataByUserId (
& state_machine . PrepareImportUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
uploadToken := result . UploadToken
uploadUrl := result . UploadUrl
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\Request\PrepareImportUserDataByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> prepareImportUserDataByUserId (
( new PrepareImportUserDataByUserIdRequest ())
-> withUserId ( "user-0001" )
);
$uploadToken = $result -> getUploadToken ();
$uploadUrl = $result -> getUploadUrl ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.PrepareImportUserDataByUserIdRequest ;
import io.gs2.stateMachine.result.PrepareImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( session );
try {
PrepareImportUserDataByUserIdResult result = client . prepareImportUserDataByUserId (
new PrepareImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
);
String uploadToken = result . getUploadToken ();
String uploadUrl = result . getUploadUrl ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.PrepareImportUserDataByUserIdRequest ;
using Gs2.Gs2StateMachine.Result.PrepareImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . PrepareImportUserDataByUserIdResult > asyncResult = null ;
yield return client . PrepareImportUserDataByUserId (
new Gs2 . Gs2StateMachine . Request . PrepareImportUserDataByUserIdRequest ()
. WithUserId ( "user-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var uploadToken = result . UploadToken ;
var uploadUrl = result . UploadUrl ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . prepareImportUserDataByUserId (
new Gs2StateMachine . PrepareImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
);
const uploadToken = result . getUploadToken ();
const uploadUrl = result . getUploadUrl ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . prepare_import_user_data_by_user_id (
state_machine . PrepareImportUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
)
upload_token = result . upload_token
upload_url = result . upload_url
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'stateMachine' )
api_result = client.prepare_import_user_data_by_user_id ({
userId = 'user-0001' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
uploadToken = result.uploadToken ;
uploadUrl = result.uploadUrl ;
importUserDataByUserId Start importing data associated with the specified user ID
Request Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars User Id uploadToken string ✓ ~ 1024 chars Token received in preparation for upload
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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . ImportUserDataByUserId (
& state_machine . ImportUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
UploadToken : pointy . String ( "upload-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\Request\ImportUserDataByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> importUserDataByUserId (
( new ImportUserDataByUserIdRequest ())
-> withUserId ( "user-0001" )
-> withUploadToken ( "upload-0001" )
);
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.ImportUserDataByUserIdRequest ;
import io.gs2.stateMachine.result.ImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( session );
try {
ImportUserDataByUserIdResult result = client . importUserDataByUserId (
new ImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withUploadToken ( "upload-0001" )
);
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.ImportUserDataByUserIdRequest ;
using Gs2.Gs2StateMachine.Result.ImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . ImportUserDataByUserIdResult > asyncResult = null ;
yield return client . ImportUserDataByUserId (
new Gs2 . Gs2StateMachine . Request . ImportUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithUploadToken ( "upload-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . importUserDataByUserId (
new Gs2StateMachine . ImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withUploadToken ( "upload-0001" )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . import_user_data_by_user_id (
state_machine . ImportUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_upload_token ( 'upload-0001' )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'stateMachine' )
api_result = client.import_user_data_by_user_id ({
userId = 'user-0001' ,
uploadToken = 'upload-0001' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
checkImportUserDataByUserId Check if the import of the data associated with the specified user ID is complete
Request Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars User Id uploadToken string ✓ ~ 1024 chars Token received in preparation for upload
Result Type Description url string URL of log data
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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . CheckImportUserDataByUserId (
& state_machine . CheckImportUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
UploadToken : pointy . String ( "upload-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
url := result . Url
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\Request\CheckImportUserDataByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> checkImportUserDataByUserId (
( new CheckImportUserDataByUserIdRequest ())
-> withUserId ( "user-0001" )
-> withUploadToken ( "upload-0001" )
);
$url = $result -> getUrl ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.CheckImportUserDataByUserIdRequest ;
import io.gs2.stateMachine.result.CheckImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( session );
try {
CheckImportUserDataByUserIdResult result = client . checkImportUserDataByUserId (
new CheckImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withUploadToken ( "upload-0001" )
);
String url = result . getUrl ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.CheckImportUserDataByUserIdRequest ;
using Gs2.Gs2StateMachine.Result.CheckImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . CheckImportUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckImportUserDataByUserId (
new Gs2 . Gs2StateMachine . Request . CheckImportUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithUploadToken ( "upload-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var url = result . Url ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . checkImportUserDataByUserId (
new Gs2StateMachine . CheckImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withUploadToken ( "upload-0001" )
);
const url = result . getUrl ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . check_import_user_data_by_user_id (
state_machine . CheckImportUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_upload_token ( 'upload-0001' )
)
url = result . url
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'stateMachine' )
api_result = client.check_import_user_data_by_user_id ({
userId = 'user-0001' ,
uploadToken = 'upload-0001' ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
url = result.url ;
describeStateMachineMasters Get list of State Machine 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<StateMachineMaster> List of State Machine 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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . DescribeStateMachineMasters (
& state_machine . DescribeStateMachineMastersRequest {
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\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\Request\DescribeStateMachineMastersRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeStateMachineMasters (
( new DescribeStateMachineMastersRequest ())
-> 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.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.DescribeStateMachineMastersRequest ;
import io.gs2.stateMachine.result.DescribeStateMachineMastersResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( session );
try {
DescribeStateMachineMastersResult result = client . describeStateMachineMasters (
new DescribeStateMachineMastersRequest ()
. withNamespaceName ( "namespace1" )
. withPageToken ( null )
. withLimit ( null )
);
List < StateMachineMaster > 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.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.DescribeStateMachineMastersRequest ;
using Gs2.Gs2StateMachine.Result.DescribeStateMachineMastersResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . DescribeStateMachineMastersResult > asyncResult = null ;
yield return client . DescribeStateMachineMasters (
new Gs2 . Gs2StateMachine . Request . DescribeStateMachineMastersRequest ()
. 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 Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . describeStateMachineMasters (
new Gs2StateMachine . DescribeStateMachineMastersRequest ()
. 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 state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . describe_state_machine_masters (
state_machine . DescribeStateMachineMastersRequest ()
. 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 ( 'stateMachine' )
api_result = client.describe_state_machine_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 ;
updateStateMachineMaster Create a new State Machine Master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name mainStateMachineName string ✓ ~ 128 chars Main state machine name payload string ✓ ~ 5242880 chars State machine definition
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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . UpdateStateMachineMaster (
& state_machine . UpdateStateMachineMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
MainStateMachineName : pointy . String ( "MainStateMachine" ),
Payload : pointy . String ( "\nStateMachine MainStateMachine {\n EntryPoint Task1;\n\n Task Task1(int initCounter) {\n Event Pass();\n Event Error(string Reason);\n\n Script grn:gs2:ap-northeast-1:YourOwnerId:script:state-machine-0001:script:Task1\n }\n\n PassTask Pass;\n\n ErrorTask Error(string reason);\n\n Transition Task1 handling Pass -> Pass;\n Transition Task1 handling Error -> Error;\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\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\Request\UpdateStateMachineMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateStateMachineMaster (
( new UpdateStateMachineMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withMainStateMachineName ( "MainStateMachine" )
-> withPayload ( " \n StateMachine MainStateMachine { \n EntryPoint Task1; \n\n Task Task1(int initCounter) { \n Event Pass(); \n Event Error(string Reason); \n\n Script grn:gs2:ap-northeast-1:YourOwnerId:script:state-machine-0001:script:Task1 \n } \n\n PassTask Pass; \n\n ErrorTask Error(string reason); \n\n Transition Task1 handling Pass -> Pass; \n Transition Task1 handling Error -> Error; \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.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.UpdateStateMachineMasterRequest ;
import io.gs2.stateMachine.result.UpdateStateMachineMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( session );
try {
UpdateStateMachineMasterResult result = client . updateStateMachineMaster (
new UpdateStateMachineMasterRequest ()
. withNamespaceName ( "namespace1" )
. withMainStateMachineName ( "MainStateMachine" )
. withPayload ( "\nStateMachine MainStateMachine {\n EntryPoint Task1;\n\n Task Task1(int initCounter) {\n Event Pass();\n Event Error(string Reason);\n\n Script grn:gs2:ap-northeast-1:YourOwnerId:script:state-machine-0001:script:Task1\n }\n\n PassTask Pass;\n\n ErrorTask Error(string reason);\n\n Transition Task1 handling Pass -> Pass;\n Transition Task1 handling Error -> Error;\n}\n " )
);
StateMachineMaster 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.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.UpdateStateMachineMasterRequest ;
using Gs2.Gs2StateMachine.Result.UpdateStateMachineMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . UpdateStateMachineMasterResult > asyncResult = null ;
yield return client . UpdateStateMachineMaster (
new Gs2 . Gs2StateMachine . Request . UpdateStateMachineMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithMainStateMachineName ( "MainStateMachine" )
. WithPayload ( "\nStateMachine MainStateMachine {\n EntryPoint Task1;\n\n Task Task1(int initCounter) {\n Event Pass();\n Event Error(string Reason);\n\n Script grn:gs2:ap-northeast-1:YourOwnerId:script:state-machine-0001:script:Task1\n }\n\n PassTask Pass;\n\n ErrorTask Error(string reason);\n\n Transition Task1 handling Pass -> Pass;\n Transition Task1 handling Error -> Error;\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 Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . updateStateMachineMaster (
new Gs2StateMachine . UpdateStateMachineMasterRequest ()
. withNamespaceName ( "namespace1" )
. withMainStateMachineName ( "MainStateMachine" )
. withPayload ( "\nStateMachine MainStateMachine {\n EntryPoint Task1;\n\n Task Task1(int initCounter) {\n Event Pass();\n Event Error(string Reason);\n\n Script grn:gs2:ap-northeast-1:YourOwnerId:script:state-machine-0001:script:Task1\n }\n\n PassTask Pass;\n\n ErrorTask Error(string reason);\n\n Transition Task1 handling Pass -> Pass;\n Transition Task1 handling Error -> Error;\n}\n " )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . update_state_machine_master (
state_machine . UpdateStateMachineMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_main_state_machine_name ( 'MainStateMachine' )
. with_payload ( ' \n StateMachine MainStateMachine { \n EntryPoint Task1; \n\n Task Task1(int initCounter) { \n Event Pass(); \n Event Error(string Reason); \n\n Script grn:gs2:ap-northeast-1:YourOwnerId:script:state-machine-0001:script:Task1 \n } \n\n PassTask Pass; \n\n ErrorTask Error(string reason); \n\n Transition Task1 handling Pass -> Pass; \n Transition Task1 handling Error -> Error; \n } \n ' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'stateMachine' )
api_result = client.update_state_machine_master ({
namespaceName = 'namespace1' ,
mainStateMachineName = 'MainStateMachine' ,
payload = ' \n StateMachine MainStateMachine { \n EntryPoint Task1; \n\n Task Task1(int initCounter) { \n Event Pass(); \n Event Error(string Reason); \n\n Script grn:gs2:ap-northeast-1:YourOwnerId:script:state-machine-0001:script:Task1 \n } \n\n PassTask Pass; \n\n ErrorTask Error(string reason); \n\n Transition Task1 handling Pass -> Pass; \n Transition Task1 handling Error -> Error; \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 ;
getStateMachineMaster Retrieve State Machine Master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name version long ✓ Version
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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . GetStateMachineMaster (
& state_machine . GetStateMachineMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
Version : pointy . Int64 ( 1000 ),
}
)
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\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\Request\GetStateMachineMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getStateMachineMaster (
( new GetStateMachineMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withVersion ( 1000 )
);
$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.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.GetStateMachineMasterRequest ;
import io.gs2.stateMachine.result.GetStateMachineMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( session );
try {
GetStateMachineMasterResult result = client . getStateMachineMaster (
new GetStateMachineMasterRequest ()
. withNamespaceName ( "namespace1" )
. withVersion ( 1000L )
);
StateMachineMaster 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.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.GetStateMachineMasterRequest ;
using Gs2.Gs2StateMachine.Result.GetStateMachineMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . GetStateMachineMasterResult > asyncResult = null ;
yield return client . GetStateMachineMaster (
new Gs2 . Gs2StateMachine . Request . GetStateMachineMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithVersion ( 1000L ),
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 Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . getStateMachineMaster (
new Gs2StateMachine . GetStateMachineMasterRequest ()
. withNamespaceName ( "namespace1" )
. withVersion ( 1000 )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . get_state_machine_master (
state_machine . GetStateMachineMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_version ( 1000 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'stateMachine' )
api_result = client.get_state_machine_master ({
namespaceName = 'namespace1' ,
version = 1000 ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
deleteStateMachineMaster Delete State Machine Master
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name version long ✓ Version
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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . DeleteStateMachineMaster (
& state_machine . DeleteStateMachineMasterRequest {
NamespaceName : pointy . String ( "namespace1" ),
Version : pointy . Int64 ( 1000 ),
}
)
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\StateMachine\Gs2StateMachineRestClient ;
use Gs2\StateMachine\Request\DeleteStateMachineMasterRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> deleteStateMachineMaster (
( new DeleteStateMachineMasterRequest ())
-> withNamespaceName ( self :: namespace1 )
-> withVersion ( 1000 )
);
$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.stateMachine.rest.Gs2StateMachineRestClient ;
import io.gs2.stateMachine.request.DeleteStateMachineMasterRequest ;
import io.gs2.stateMachine.result.DeleteStateMachineMasterResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2StateMachineRestClient client = new Gs2StateMachineRestClient ( session );
try {
DeleteStateMachineMasterResult result = client . deleteStateMachineMaster (
new DeleteStateMachineMasterRequest ()
. withNamespaceName ( "namespace1" )
. withVersion ( 1000L )
);
StateMachineMaster 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.Gs2StateMachine.Gs2StateMachineRestClient ;
using Gs2.Gs2StateMachine.Request.DeleteStateMachineMasterRequest ;
using Gs2.Gs2StateMachine.Result.DeleteStateMachineMasterResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2StateMachineRestClient ( session );
AsyncResult < Gs2 . Gs2StateMachine . Result . DeleteStateMachineMasterResult > asyncResult = null ;
yield return client . DeleteStateMachineMaster (
new Gs2 . Gs2StateMachine . Request . DeleteStateMachineMasterRequest ()
. WithNamespaceName ( "namespace1" )
. WithVersion ( 1000L ),
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 Gs2StateMachine from '@/gs2/stateMachine' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2StateMachine . Gs2StateMachineRestClient ( session );
try {
const result = await client . deleteStateMachineMaster (
new Gs2StateMachine . DeleteStateMachineMasterRequest ()
. withNamespaceName ( "namespace1" )
. withVersion ( 1000 )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import state_machine
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = state_machine . Gs2StateMachineRestClient ( session )
try :
result = client . delete_state_machine_master (
state_machine . DeleteStateMachineMasterRequest ()
. with_namespace_name ( self . hash1 )
. with_version ( 1000 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'stateMachine' )
api_result = client.delete_state_machine_master ({
namespaceName = 'namespace1' ,
version = 1000 ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
describeStatuses Get list of state machine statuses
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 32 chars Namespace name accessToken string ✓ ~ 128 chars User Id status enum [ “Running”, “Wait”, “Pass”, “Error” ] ~ 128 chars Status 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<Status> List of Status of State Machine 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/state_machine"
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 := state_machine . Gs2StateMachineRestClient {
Session : & session ,
}
result , err := client . DescribeStatuses (
& state_machine . DescribeStatusesRequest {
NamespaceName : pointy . String ( "namespace1" ),
AccessToken : pointy . String ( "$access_token_0001" ),
Status : pointy . String ( "Running" ),
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\R