API Reference of GS2-Friend 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 ✓ ~ 128 chars Namespace name description string ~ 1024 chars Description followScript ScriptSetting Script to run when followed unfollowScript ScriptSetting Script to run when unfollowed sendRequestScript ScriptSetting Script to run when a friend request is issued cancelRequestScript ScriptSetting Script to execute when a friend request is canceled acceptRequestScript ScriptSetting Script to run when a friend request is accepted rejectRequestScript ScriptSetting Script to execute when a friend request is rejected deleteFriendScript ScriptSetting Script to run when a friend is deleted updateProfileScript ScriptSetting Script to run when you update your profile followNotification NotificationSetting Push notification when you are followed receiveRequestNotification NotificationSetting ✓ Push notification when a friend request is received cancelRequestNotification NotificationSetting ✓ Push notification when a received friend request is canceled acceptRequestNotification NotificationSetting ✓ Push notification when a friend request is approved rejectRequestNotification NotificationSetting ✓ Push notification when a friend request is rejected deleteFriendNotification NotificationSetting ✓ Push notification when a friend is deleted logSetting LogSetting Log output settings createdAt long ✓ Datetime of creation updatedAt long ✓ Datetime of last update revision long 0 ~ 9223372036854775805 Revision
Profile Profile
The profile stores information about the game player.
There are three types of profiles that can be set for each public range.
friend The information that can be viewed by those with whom a friend relationship has been established. follow Content that can be viewed by followers. public Content that can be viewed by anyone Type Condition Require Default Limitation Description profileId string ✓ ~ 1024 chars Profile GRN userId string ✓ ~ 128 chars User Id publicProfile string ~ 1024 chars Public profile followerProfile string ~ 1024 chars Profile for followers friendProfile string ~ 1024 chars Profile for friends createdAt long ✓ Datetime of creation updatedAt long ✓ Datetime of last update revision long 0 ~ 9223372036854775805 Revision
Follow Follow
A follow is a unidirectional relationship between game players.
The relationship is established immediately upon sending a follow request.
Type Condition Require Default Limitation Description followId string ✓ ~ 1024 chars Follow GRN userId string ✓ ~ 128 chars User Id targetUserIds List<string> ~ 1000 items List of user IDs you are following createdAt long ✓ Datetime of creation updatedAt long ✓ Datetime of last update revision long 0 ~ 9223372036854775805 Revision
Friend Friend
A friend is a two-way, approved relationship between game players.
To establish a friend relationship, one party must send a request and the other party must approve it.
Type Condition Require Default Limitation Description friendId string ✓ ~ 1024 chars Friend GRN userId string ✓ ~ 128 chars User Id targetUserIds List<string> ~ 1000 items User ID list of friends createdAt long ✓ Datetime of creation updatedAt long ✓ Datetime of last update revision long 0 ~ 9223372036854775805 Revision
SendBox Send box
Sent friend requests
Type Condition Require Default Limitation Description sendBoxId string ✓ ~ 1024 chars SendBox GRN userId string ✓ ~ 128 chars User Id targetUserIds List<string> ~ 1000 items Destination user ID list for friend requests createdAt long ✓ Datetime of creation updatedAt long ✓ Datetime of last update revision long 0 ~ 9223372036854775805 Revision
Inbox In-box
Received friend requests
Type Condition Require Default Limitation Description inboxId string ✓ ~ 1024 chars Inbox GRN userId string ✓ ~ 128 chars User Id fromUserIds List<string> ~ 1000 items List of user IDs who have sent friend requests createdAt long ✓ Datetime of creation updatedAt long ✓ Datetime of last update revision long 0 ~ 9223372036854775805 Revision
BlackList Blacklist
Type Condition Require Default Limitation Description blackListId string ✓ ~ 1024 chars Blacklist GRN userId string ✓ ~ 128 chars User Id targetUserIds List<string> ~ 10000 items Blacklist user ID list createdAt long ✓ Datetime of creation updatedAt long ✓ Datetime of last update revision long 0 ~ 9223372036854775805 Revision
FollowUser Users you are following
Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars User Id publicProfile string ~ 1024 chars Public profile followerProfile string ~ 1024 chars Profile for followers
FriendUser Friend’s users
Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars User Id publicProfile string ~ 1024 chars Public profile friendProfile string ~ 1024 chars Profile for friends
FriendRequest friend request
Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars Sender targetUserId string ✓ ~ 128 chars Target
SendFriendRequest Friend request sent
This entity indicates the status of a pending friend request.
This is a friend request sent by the user to another user.
When the user who sent the friend request approves it, the friend request is deleted and the user is added to the friend list.
Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars Sent targetUserId string ✓ ~ 128 chars Target
ReceiveFriendRequest Friend request received
This entity indicates that a friend request has been accepted.
This is a friend request received by the user from another user.
When the user approves the friend request, the friend request is deleted and the user is added to the friend list.
Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars Sent targetUserId string ✓ ~ 128 chars Target
PublicProfile Profile available to everyone
Type Condition Require Default Limitation Description userId string ✓ ~ 128 chars User Id publicProfile string ~ 1024 chars Public profile
ScriptSetting Script settings
In GS2, you can associate custom scripts with microservice events and execute them.
This model holds the settings for triggering script execution.
There are two main ways to execute a script: synchronous execution and asynchronous execution.
Synchronous execution blocks processing until the script has finished executing.
Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API.
On the other hand, asynchronous execution does not block processing until the script has finished executing.
Instead, you can use the script execution result to stop the execution of the API or to tamper with the result of the API.
However, asynchronous execution does not block processing until the script has finished executing, so it is generally recommended to use asynchronous execution.
There are two types of asynchronous execution methods: GS2-Script and Amazon EventBridge.
By using Amazon EventBridge, you can write processing in languages other than Lua.
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
NotificationSetting Push notification settings
This is a setting for sending push notifications when an event occurs in a GS2 microservice.
The push notification here refers to the processing via the WebSocket interface provided by GS2-Gateway, and is different from the push notification of a smartphone.
For example, when a matchmaking is completed or a friend request is received, the GS2-Gateway can send a push notification via the WebSocket interface, and the game client can detect the change of the state.
GS2-Gateway’s push notifications can be used to send additional processing to mobile push notifications when the destination device is offline.
If you use mobile push notifications well, you may be able to realize a flow in which you can notify the player by using mobile push notifications even if you end the game during matchmaking and return to the game.
Type Condition Require Default Limitation Description gatewayNamespaceId string ✓ “grn:gs2:{region}:{ownerId}:gateway:default” ~ 1024 chars GS2-Gateway namespace to use for push notifications enableTransferMobileNotification bool? false Forwarding to mobile push notification sound string {enableTransferMobileNotification} == true ~ 1024 chars Sound file name to be used for mobile push notifications
LogSetting Log setting
This type manages log output settings.
This type holds the identifier of the log namespace used to output log data.
The log namespace ID specifies the GS2-Log namespace to aggregate and store the log data.
Through this setting, API request and response log data under this namespace will be output to the target GS2-Log.
GS2-Log provides logs in real time, which can be used for system monitoring, analysis, debugging, etc.
Type Condition Require Default Limitation Description loggingNamespaceId string ✓ ~ 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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . DescribeNamespaces (
& friend . 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\Friend\Gs2FriendRestClient ;
use Gs2\Friend\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.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.DescribeNamespacesRequest ;
import io.gs2.friend.result.DescribeNamespacesResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.DescribeNamespacesRequest ;
using Gs2.Gs2Friend.Result.DescribeNamespacesResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . DescribeNamespacesResult > asyncResult = null ;
yield return client . DescribeNamespaces (
new Gs2 . Gs2Friend . 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 Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . describeNamespaces (
new Gs2Friend . 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 friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . describe_namespaces (
friend . 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 ( 'friend' )
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 ✓ ~ 128 chars Namespace name description string ~ 1024 chars Description followScript ScriptSetting Script to run when followed unfollowScript ScriptSetting Script to run when unfollowed sendRequestScript ScriptSetting Script to run when a friend request is issued cancelRequestScript ScriptSetting Script to execute when a friend request is canceled acceptRequestScript ScriptSetting Script to run when a friend request is accepted rejectRequestScript ScriptSetting Script to execute when a friend request is rejected deleteFriendScript ScriptSetting Script to run when a friend is deleted updateProfileScript ScriptSetting Script to run when you update your profile followNotification NotificationSetting Push notification when you are followed receiveRequestNotification NotificationSetting ✓ Push notification when a friend request is received cancelRequestNotification NotificationSetting ✓ Push notification when a received friend request is canceled acceptRequestNotification NotificationSetting ✓ Push notification when a friend request is approved rejectRequestNotification NotificationSetting ✓ Push notification when a friend request is rejected deleteFriendNotification NotificationSetting ✓ Push notification when a friend is deleted 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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . CreateNamespace (
& friend . CreateNamespaceRequest {
Name : pointy . String ( "namespace1" ),
Description : nil ,
FollowScript : nil ,
UnfollowScript : nil ,
SendRequestScript : nil ,
CancelRequestScript : nil ,
AcceptRequestScript : nil ,
RejectRequestScript : nil ,
DeleteFriendScript : nil ,
UpdateProfileScript : nil ,
FollowNotification : nil ,
ReceiveRequestNotification : nil ,
CancelRequestNotification : nil ,
AcceptRequestNotification : nil ,
RejectRequestNotification : nil ,
DeleteFriendNotification : nil ,
LogSetting : & friend . 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\Friend\Gs2FriendRestClient ;
use Gs2\Friend\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 )
-> withFollowScript ( null )
-> withUnfollowScript ( null )
-> withSendRequestScript ( null )
-> withCancelRequestScript ( null )
-> withAcceptRequestScript ( null )
-> withRejectRequestScript ( null )
-> withDeleteFriendScript ( null )
-> withUpdateProfileScript ( null )
-> withFollowNotification ( null )
-> withReceiveRequestNotification ( null )
-> withCancelRequestNotification ( null )
-> withAcceptRequestNotification ( null )
-> withRejectRequestNotification ( null )
-> withDeleteFriendNotification ( null )
-> withLogSetting (( new \Gs2\Friend\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.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.CreateNamespaceRequest ;
import io.gs2.friend.result.CreateNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
CreateNamespaceResult result = client . createNamespace (
new CreateNamespaceRequest ()
. withName ( "namespace1" )
. withDescription ( null )
. withFollowScript ( null )
. withUnfollowScript ( null )
. withSendRequestScript ( null )
. withCancelRequestScript ( null )
. withAcceptRequestScript ( null )
. withRejectRequestScript ( null )
. withDeleteFriendScript ( null )
. withUpdateProfileScript ( null )
. withFollowNotification ( null )
. withReceiveRequestNotification ( null )
. withCancelRequestNotification ( null )
. withAcceptRequestNotification ( null )
. withRejectRequestNotification ( null )
. withDeleteFriendNotification ( null )
. withLogSetting ( new io . gs2 . friend . 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.CreateNamespaceRequest ;
using Gs2.Gs2Friend.Result.CreateNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . CreateNamespaceResult > asyncResult = null ;
yield return client . CreateNamespace (
new Gs2 . Gs2Friend . Request . CreateNamespaceRequest ()
. WithName ( "namespace1" )
. WithDescription ( null )
. WithFollowScript ( null )
. WithUnfollowScript ( null )
. WithSendRequestScript ( null )
. WithCancelRequestScript ( null )
. WithAcceptRequestScript ( null )
. WithRejectRequestScript ( null )
. WithDeleteFriendScript ( null )
. WithUpdateProfileScript ( null )
. WithFollowNotification ( null )
. WithReceiveRequestNotification ( null )
. WithCancelRequestNotification ( null )
. WithAcceptRequestNotification ( null )
. WithRejectRequestNotification ( null )
. WithDeleteFriendNotification ( null )
. WithLogSetting ( new Gs2 . Gs2Friend . 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 Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . createNamespace (
new Gs2Friend . CreateNamespaceRequest ()
. withName ( "namespace1" )
. withDescription ( null )
. withFollowScript ( null )
. withUnfollowScript ( null )
. withSendRequestScript ( null )
. withCancelRequestScript ( null )
. withAcceptRequestScript ( null )
. withRejectRequestScript ( null )
. withDeleteFriendScript ( null )
. withUpdateProfileScript ( null )
. withFollowNotification ( null )
. withReceiveRequestNotification ( null )
. withCancelRequestNotification ( null )
. withAcceptRequestNotification ( null )
. withRejectRequestNotification ( null )
. withDeleteFriendNotification ( null )
. withLogSetting ( new Gs2Friend . 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 friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . create_namespace (
friend . CreateNamespaceRequest ()
. with_name ( self . hash1 )
. with_description ( None )
. with_follow_script ( None )
. with_unfollow_script ( None )
. with_send_request_script ( None )
. with_cancel_request_script ( None )
. with_accept_request_script ( None )
. with_reject_request_script ( None )
. with_delete_friend_script ( None )
. with_update_profile_script ( None )
. with_follow_notification ( None )
. with_receive_request_notification ( None )
. with_cancel_request_notification ( None )
. with_accept_request_notification ( None )
. with_reject_request_notification ( None )
. with_delete_friend_notification ( None )
. with_log_setting (
friend . 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 ( 'friend' )
api_result = client.create_namespace ({
name = "namespace1" ,
description = nil ,
followScript = nil ,
unfollowScript = nil ,
sendRequestScript = nil ,
cancelRequestScript = nil ,
acceptRequestScript = nil ,
rejectRequestScript = nil ,
deleteFriendScript = nil ,
updateProfileScript = nil ,
followNotification = nil ,
receiveRequestNotification = nil ,
cancelRequestNotification = nil ,
acceptRequestNotification = nil ,
rejectRequestNotification = nil ,
deleteFriendNotification = 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 Get namespace status
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . GetNamespaceStatus (
& friend . 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\Friend\Gs2FriendRestClient ;
use Gs2\Friend\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.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.GetNamespaceStatusRequest ;
import io.gs2.friend.result.GetNamespaceStatusResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.GetNamespaceStatusRequest ;
using Gs2.Gs2Friend.Result.GetNamespaceStatusResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . GetNamespaceStatusResult > asyncResult = null ;
yield return client . GetNamespaceStatus (
new Gs2 . Gs2Friend . 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 Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . getNamespaceStatus (
new Gs2Friend . GetNamespaceStatusRequest ()
. withNamespaceName ( "namespace1" )
);
const status = result . getStatus ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . get_namespace_status (
friend . GetNamespaceStatusRequest ()
. with_namespace_name ( self . hash1 )
)
status = result . status
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
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 ✓ ~ 128 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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . GetNamespace (
& friend . 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\Friend\Gs2FriendRestClient ;
use Gs2\Friend\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.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.GetNamespaceRequest ;
import io.gs2.friend.result.GetNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.GetNamespaceRequest ;
using Gs2.Gs2Friend.Result.GetNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . GetNamespaceResult > asyncResult = null ;
yield return client . GetNamespace (
new Gs2 . Gs2Friend . 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 Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . getNamespace (
new Gs2Friend . GetNamespaceRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . get_namespace (
friend . GetNamespaceRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
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 ✓ ~ 128 chars Namespace name description string ~ 1024 chars Description followScript ScriptSetting Script to run when followed unfollowScript ScriptSetting Script to run when unfollowed sendRequestScript ScriptSetting Script to run when a friend request is issued cancelRequestScript ScriptSetting Script to execute when a friend request is canceled acceptRequestScript ScriptSetting Script to run when a friend request is accepted rejectRequestScript ScriptSetting Script to execute when a friend request is rejected deleteFriendScript ScriptSetting Script to run when a friend is deleted updateProfileScript ScriptSetting Script to run when you update your profile followNotification NotificationSetting Push notification when you are followed receiveRequestNotification NotificationSetting ✓ Push notification when a friend request is received cancelRequestNotification NotificationSetting ✓ Push notification when a received friend request is canceled acceptRequestNotification NotificationSetting ✓ Push notification when a friend request is approved rejectRequestNotification NotificationSetting ✓ Push notification when a friend request is rejected deleteFriendNotification NotificationSetting ✓ Push notification when a friend is deleted 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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . UpdateNamespace (
& friend . UpdateNamespaceRequest {
NamespaceName : pointy . String ( "namespace1" ),
Description : pointy . String ( "description1" ),
FollowScript : nil ,
UnfollowScript : nil ,
SendRequestScript : nil ,
CancelRequestScript : nil ,
AcceptRequestScript : nil ,
RejectRequestScript : nil ,
DeleteFriendScript : nil ,
UpdateProfileScript : nil ,
FollowNotification : nil ,
ReceiveRequestNotification : nil ,
CancelRequestNotification : nil ,
AcceptRequestNotification : nil ,
RejectRequestNotification : nil ,
DeleteFriendNotification : nil ,
LogSetting : & friend . 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\Friend\Gs2FriendRestClient ;
use Gs2\Friend\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" )
-> withFollowScript ( null )
-> withUnfollowScript ( null )
-> withSendRequestScript ( null )
-> withCancelRequestScript ( null )
-> withAcceptRequestScript ( null )
-> withRejectRequestScript ( null )
-> withDeleteFriendScript ( null )
-> withUpdateProfileScript ( null )
-> withFollowNotification ( null )
-> withReceiveRequestNotification ( null )
-> withCancelRequestNotification ( null )
-> withAcceptRequestNotification ( null )
-> withRejectRequestNotification ( null )
-> withDeleteFriendNotification ( null )
-> withLogSetting (( new \Gs2\Friend\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.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.UpdateNamespaceRequest ;
import io.gs2.friend.result.UpdateNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
UpdateNamespaceResult result = client . updateNamespace (
new UpdateNamespaceRequest ()
. withNamespaceName ( "namespace1" )
. withDescription ( "description1" )
. withFollowScript ( null )
. withUnfollowScript ( null )
. withSendRequestScript ( null )
. withCancelRequestScript ( null )
. withAcceptRequestScript ( null )
. withRejectRequestScript ( null )
. withDeleteFriendScript ( null )
. withUpdateProfileScript ( null )
. withFollowNotification ( null )
. withReceiveRequestNotification ( null )
. withCancelRequestNotification ( null )
. withAcceptRequestNotification ( null )
. withRejectRequestNotification ( null )
. withDeleteFriendNotification ( null )
. withLogSetting ( new io . gs2 . friend . 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.UpdateNamespaceRequest ;
using Gs2.Gs2Friend.Result.UpdateNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . UpdateNamespaceResult > asyncResult = null ;
yield return client . UpdateNamespace (
new Gs2 . Gs2Friend . Request . UpdateNamespaceRequest ()
. WithNamespaceName ( "namespace1" )
. WithDescription ( "description1" )
. WithFollowScript ( null )
. WithUnfollowScript ( null )
. WithSendRequestScript ( null )
. WithCancelRequestScript ( null )
. WithAcceptRequestScript ( null )
. WithRejectRequestScript ( null )
. WithDeleteFriendScript ( null )
. WithUpdateProfileScript ( null )
. WithFollowNotification ( null )
. WithReceiveRequestNotification ( null )
. WithCancelRequestNotification ( null )
. WithAcceptRequestNotification ( null )
. WithRejectRequestNotification ( null )
. WithDeleteFriendNotification ( null )
. WithLogSetting ( new Gs2 . Gs2Friend . 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 Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . updateNamespace (
new Gs2Friend . UpdateNamespaceRequest ()
. withNamespaceName ( "namespace1" )
. withDescription ( "description1" )
. withFollowScript ( null )
. withUnfollowScript ( null )
. withSendRequestScript ( null )
. withCancelRequestScript ( null )
. withAcceptRequestScript ( null )
. withRejectRequestScript ( null )
. withDeleteFriendScript ( null )
. withUpdateProfileScript ( null )
. withFollowNotification ( null )
. withReceiveRequestNotification ( null )
. withCancelRequestNotification ( null )
. withAcceptRequestNotification ( null )
. withRejectRequestNotification ( null )
. withDeleteFriendNotification ( null )
. withLogSetting ( new Gs2Friend . 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 friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . update_namespace (
friend . UpdateNamespaceRequest ()
. with_namespace_name ( self . hash1 )
. with_description ( 'description1' )
. with_follow_script ( None )
. with_unfollow_script ( None )
. with_send_request_script ( None )
. with_cancel_request_script ( None )
. with_accept_request_script ( None )
. with_reject_request_script ( None )
. with_delete_friend_script ( None )
. with_update_profile_script ( None )
. with_follow_notification ( None )
. with_receive_request_notification ( None )
. with_cancel_request_notification ( None )
. with_accept_request_notification ( None )
. with_reject_request_notification ( None )
. with_delete_friend_notification ( None )
. with_log_setting (
friend . 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 ( 'friend' )
api_result = client.update_namespace ({
namespaceName = "namespace1" ,
description = "description1" ,
followScript = nil ,
unfollowScript = nil ,
sendRequestScript = nil ,
cancelRequestScript = nil ,
acceptRequestScript = nil ,
rejectRequestScript = nil ,
deleteFriendScript = nil ,
updateProfileScript = nil ,
followNotification = nil ,
receiveRequestNotification = nil ,
cancelRequestNotification = nil ,
acceptRequestNotification = nil ,
rejectRequestNotification = nil ,
deleteFriendNotification = 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 ✓ ~ 128 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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . DeleteNamespace (
& friend . 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\Friend\Gs2FriendRestClient ;
use Gs2\Friend\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.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.DeleteNamespaceRequest ;
import io.gs2.friend.result.DeleteNamespaceResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.DeleteNamespaceRequest ;
using Gs2.Gs2Friend.Result.DeleteNamespaceResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . DeleteNamespaceResult > asyncResult = null ;
yield return client . DeleteNamespace (
new Gs2 . Gs2Friend . 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 Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . deleteNamespace (
new Gs2Friend . DeleteNamespaceRequest ()
. withNamespaceName ( "namespace1" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . delete_namespace (
friend . DeleteNamespaceRequest ()
. with_namespace_name ( self . hash1 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
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 timeOffsetToken string ~ 1024 chars Time offset token
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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . DumpUserDataByUserId (
& friend . DumpUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Friend\Gs2FriendRestClient ;
use Gs2\Friend\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" )
-> withTimeOffsetToken ( null )
);
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.DumpUserDataByUserIdRequest ;
import io.gs2.friend.result.DumpUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
DumpUserDataByUserIdResult result = client . dumpUserDataByUserId (
new DumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.DumpUserDataByUserIdRequest ;
using Gs2.Gs2Friend.Result.DumpUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . DumpUserDataByUserIdResult > asyncResult = null ;
yield return client . DumpUserDataByUserId (
new Gs2 . Gs2Friend . Request . DumpUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . dumpUserDataByUserId (
new Gs2Friend . DumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . dump_user_data_by_user_id (
friend . DumpUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.dump_user_data_by_user_id ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ '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 timeOffsetToken string ~ 1024 chars Time offset token
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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . CheckDumpUserDataByUserId (
& friend . CheckDumpUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
url := result . Url
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Friend\Gs2FriendRestClient ;
use Gs2\Friend\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" )
-> withTimeOffsetToken ( null )
);
$url = $result -> getUrl ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.CheckDumpUserDataByUserIdRequest ;
import io.gs2.friend.result.CheckDumpUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
CheckDumpUserDataByUserIdResult result = client . checkDumpUserDataByUserId (
new CheckDumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
String url = result . getUrl ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.CheckDumpUserDataByUserIdRequest ;
using Gs2.Gs2Friend.Result.CheckDumpUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . CheckDumpUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckDumpUserDataByUserId (
new Gs2 . Gs2Friend . Request . CheckDumpUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var url = result . Url ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . checkDumpUserDataByUserId (
new Gs2Friend . CheckDumpUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
const url = result . getUrl ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . check_dump_user_data_by_user_id (
friend . CheckDumpUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
url = result . url
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.check_dump_user_data_by_user_id ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ '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 timeOffsetToken string ~ 1024 chars Time offset token
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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . CleanUserDataByUserId (
& friend . CleanUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Friend\Gs2FriendRestClient ;
use Gs2\Friend\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" )
-> withTimeOffsetToken ( null )
);
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.CleanUserDataByUserIdRequest ;
import io.gs2.friend.result.CleanUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
CleanUserDataByUserIdResult result = client . cleanUserDataByUserId (
new CleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.CleanUserDataByUserIdRequest ;
using Gs2.Gs2Friend.Result.CleanUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . CleanUserDataByUserIdResult > asyncResult = null ;
yield return client . CleanUserDataByUserId (
new Gs2 . Gs2Friend . Request . CleanUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . cleanUserDataByUserId (
new Gs2Friend . CleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . clean_user_data_by_user_id (
friend . CleanUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.clean_user_data_by_user_id ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ '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 timeOffsetToken string ~ 1024 chars Time offset token
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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . CheckCleanUserDataByUserId (
& friend . CheckCleanUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Friend\Gs2FriendRestClient ;
use Gs2\Friend\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" )
-> withTimeOffsetToken ( null )
);
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.CheckCleanUserDataByUserIdRequest ;
import io.gs2.friend.result.CheckCleanUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
CheckCleanUserDataByUserIdResult result = client . checkCleanUserDataByUserId (
new CheckCleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.CheckCleanUserDataByUserIdRequest ;
using Gs2.Gs2Friend.Result.CheckCleanUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . CheckCleanUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckCleanUserDataByUserId (
new Gs2 . Gs2Friend . Request . CheckCleanUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . checkCleanUserDataByUserId (
new Gs2Friend . CheckCleanUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . check_clean_user_data_by_user_id (
friend . CheckCleanUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.check_clean_user_data_by_user_id ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ '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 timeOffsetToken string ~ 1024 chars Time offset token
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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . PrepareImportUserDataByUserId (
& friend . PrepareImportUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
uploadToken := result . UploadToken
uploadUrl := result . UploadUrl
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Friend\Gs2FriendRestClient ;
use Gs2\Friend\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" )
-> withTimeOffsetToken ( null )
);
$uploadToken = $result -> getUploadToken ();
$uploadUrl = $result -> getUploadUrl ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.PrepareImportUserDataByUserIdRequest ;
import io.gs2.friend.result.PrepareImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
PrepareImportUserDataByUserIdResult result = client . prepareImportUserDataByUserId (
new PrepareImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
String uploadToken = result . getUploadToken ();
String uploadUrl = result . getUploadUrl ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.PrepareImportUserDataByUserIdRequest ;
using Gs2.Gs2Friend.Result.PrepareImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . PrepareImportUserDataByUserIdResult > asyncResult = null ;
yield return client . PrepareImportUserDataByUserId (
new Gs2 . Gs2Friend . Request . PrepareImportUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var uploadToken = result . UploadToken ;
var uploadUrl = result . UploadUrl ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . prepareImportUserDataByUserId (
new Gs2Friend . PrepareImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
const uploadToken = result . getUploadToken ();
const uploadUrl = result . getUploadUrl ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . prepare_import_user_data_by_user_id (
friend . PrepareImportUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
upload_token = result . upload_token
upload_url = result . upload_url
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.prepare_import_user_data_by_user_id ({
userId = "user-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ '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 timeOffsetToken string ~ 1024 chars Time offset token
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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . ImportUserDataByUserId (
& friend . ImportUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
UploadToken : pointy . String ( "upload-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Friend\Gs2FriendRestClient ;
use Gs2\Friend\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" )
-> withTimeOffsetToken ( null )
);
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.ImportUserDataByUserIdRequest ;
import io.gs2.friend.result.ImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
ImportUserDataByUserIdResult result = client . importUserDataByUserId (
new ImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withUploadToken ( "upload-0001" )
. withTimeOffsetToken ( null )
);
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.ImportUserDataByUserIdRequest ;
using Gs2.Gs2Friend.Result.ImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . ImportUserDataByUserIdResult > asyncResult = null ;
yield return client . ImportUserDataByUserId (
new Gs2 . Gs2Friend . Request . ImportUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithUploadToken ( "upload-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . importUserDataByUserId (
new Gs2Friend . ImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withUploadToken ( "upload-0001" )
. withTimeOffsetToken ( null )
);
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . import_user_data_by_user_id (
friend . ImportUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_upload_token ( 'upload-0001' )
. with_time_offset_token ( None )
)
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.import_user_data_by_user_id ({
userId = "user-0001" ,
uploadToken = "upload-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ '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 timeOffsetToken string ~ 1024 chars Time offset token
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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . CheckImportUserDataByUserId (
& friend . CheckImportUserDataByUserIdRequest {
UserId : pointy . String ( "user-0001" ),
UploadToken : pointy . String ( "upload-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
url := result . Url
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Friend\Gs2FriendRestClient ;
use Gs2\Friend\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" )
-> withTimeOffsetToken ( null )
);
$url = $result -> getUrl ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.CheckImportUserDataByUserIdRequest ;
import io.gs2.friend.result.CheckImportUserDataByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
CheckImportUserDataByUserIdResult result = client . checkImportUserDataByUserId (
new CheckImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withUploadToken ( "upload-0001" )
. withTimeOffsetToken ( null )
);
String url = result . getUrl ();
} catch ( Gs2Exception e ) {
System . exit ( 1 );
}
using Gs2.Core.Model.Region ;
using Gs2.Core.Model.BasicGs2Credential ;
using Gs2.Core.Net.Gs2RestSession ;
using Gs2.Core.Exception.Gs2Exception ;
using Gs2.Core.AsyncResult ;
using Gs2.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.CheckImportUserDataByUserIdRequest ;
using Gs2.Gs2Friend.Result.CheckImportUserDataByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . CheckImportUserDataByUserIdResult > asyncResult = null ;
yield return client . CheckImportUserDataByUserId (
new Gs2 . Gs2Friend . Request . CheckImportUserDataByUserIdRequest ()
. WithUserId ( "user-0001" )
. WithUploadToken ( "upload-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var url = result . Url ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . checkImportUserDataByUserId (
new Gs2Friend . CheckImportUserDataByUserIdRequest ()
. withUserId ( "user-0001" )
. withUploadToken ( "upload-0001" )
. withTimeOffsetToken ( null )
);
const url = result . getUrl ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . check_import_user_data_by_user_id (
friend . CheckImportUserDataByUserIdRequest ()
. with_user_id ( 'user-0001' )
. with_upload_token ( 'upload-0001' )
. with_time_offset_token ( None )
)
url = result . url
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.check_import_user_data_by_user_id ({
userId = "user-0001" ,
uploadToken = "upload-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
url = result.url ;
getProfile Get Profile
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace name accessToken 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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . GetProfile (
& friend . GetProfileRequest {
NamespaceName : pointy . String ( "namespace2" ),
AccessToken : pointy . String ( "accessToken-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Friend\Gs2FriendRestClient ;
use Gs2\Friend\Request\GetProfileRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getProfile (
( new GetProfileRequest ())
-> withNamespaceName ( self :: namespace2 )
-> withAccessToken ( self :: $accessToken0001 )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.GetProfileRequest ;
import io.gs2.friend.result.GetProfileResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
GetProfileResult result = client . getProfile (
new GetProfileRequest ()
. withNamespaceName ( "namespace2" )
. withAccessToken ( "accessToken-0001" )
);
Profile 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.GetProfileRequest ;
using Gs2.Gs2Friend.Result.GetProfileResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . GetProfileResult > asyncResult = null ;
yield return client . GetProfile (
new Gs2 . Gs2Friend . Request . GetProfileRequest ()
. WithNamespaceName ( "namespace2" )
. WithAccessToken ( "accessToken-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . getProfile (
new Gs2Friend . GetProfileRequest ()
. withNamespaceName ( "namespace2" )
. withAccessToken ( "accessToken-0001" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . get_profile (
friend . GetProfileRequest ()
. with_namespace_name ( self . hash2 )
. with_access_token ( self . access_token_0001 )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.get_profile ({
namespaceName = "namespace2" ,
accessToken = "accessToken-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
getProfileByUserId Get profile by specifying user ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace name userId string ✓ ~ 128 chars User Id timeOffsetToken string ~ 1024 chars Time offset token
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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . GetProfileByUserId (
& friend . GetProfileByUserIdRequest {
NamespaceName : pointy . String ( "namespace2" ),
UserId : pointy . String ( "user-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Friend\Gs2FriendRestClient ;
use Gs2\Friend\Request\GetProfileByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> getProfileByUserId (
( new GetProfileByUserIdRequest ())
-> withNamespaceName ( self :: namespace2 )
-> withUserId ( "user-0001" )
-> withTimeOffsetToken ( null )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.GetProfileByUserIdRequest ;
import io.gs2.friend.result.GetProfileByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
GetProfileByUserIdResult result = client . getProfileByUserId (
new GetProfileByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
Profile 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.GetProfileByUserIdRequest ;
using Gs2.Gs2Friend.Result.GetProfileByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . GetProfileByUserIdResult > asyncResult = null ;
yield return client . GetProfileByUserId (
new Gs2 . Gs2Friend . Request . GetProfileByUserIdRequest ()
. WithNamespaceName ( "namespace2" )
. WithUserId ( "user-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . getProfileByUserId (
new Gs2Friend . GetProfileByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . get_profile_by_user_id (
friend . GetProfileByUserIdRequest ()
. with_namespace_name ( self . hash2 )
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.get_profile_by_user_id ({
namespaceName = "namespace2" ,
userId = "user-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
updateProfile Update Profile
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace name accessToken string ✓ ~ 128 chars User Id publicProfile string ~ 1024 chars Public profile followerProfile string ~ 1024 chars Profile for followers friendProfile string ~ 1024 chars Profile for friends
Result Type Description item Profile Updated Profile
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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . UpdateProfile (
& friend . UpdateProfileRequest {
NamespaceName : pointy . String ( "namespace2" ),
AccessToken : pointy . String ( "accessToken-0001" ),
PublicProfile : pointy . String ( "public" ),
FollowerProfile : pointy . String ( "follower" ),
FriendProfile : pointy . String ( "friend" ),
}
)
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\Friend\Gs2FriendRestClient ;
use Gs2\Friend\Request\UpdateProfileRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateProfile (
( new UpdateProfileRequest ())
-> withNamespaceName ( self :: namespace2 )
-> withAccessToken ( self :: $accessToken0001 )
-> withPublicProfile ( "public" )
-> withFollowerProfile ( "follower" )
-> withFriendProfile ( "friend" )
);
$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.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.UpdateProfileRequest ;
import io.gs2.friend.result.UpdateProfileResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
UpdateProfileResult result = client . updateProfile (
new UpdateProfileRequest ()
. withNamespaceName ( "namespace2" )
. withAccessToken ( "accessToken-0001" )
. withPublicProfile ( "public" )
. withFollowerProfile ( "follower" )
. withFriendProfile ( "friend" )
);
Profile 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.UpdateProfileRequest ;
using Gs2.Gs2Friend.Result.UpdateProfileResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . UpdateProfileResult > asyncResult = null ;
yield return client . UpdateProfile (
new Gs2 . Gs2Friend . Request . UpdateProfileRequest ()
. WithNamespaceName ( "namespace2" )
. WithAccessToken ( "accessToken-0001" )
. WithPublicProfile ( "public" )
. WithFollowerProfile ( "follower" )
. WithFriendProfile ( "friend" ),
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 Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . updateProfile (
new Gs2Friend . UpdateProfileRequest ()
. withNamespaceName ( "namespace2" )
. withAccessToken ( "accessToken-0001" )
. withPublicProfile ( "public" )
. withFollowerProfile ( "follower" )
. withFriendProfile ( "friend" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . update_profile (
friend . UpdateProfileRequest ()
. with_namespace_name ( self . hash2 )
. with_access_token ( self . access_token_0001 )
. with_public_profile ( 'public' )
. with_follower_profile ( 'follower' )
. with_friend_profile ( 'friend' )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.update_profile ({
namespaceName = "namespace2" ,
accessToken = "accessToken-0001" ,
publicProfile = "public" ,
followerProfile = "follower" ,
friendProfile = "friend" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
updateProfileByUserId Update profile with user ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace name userId string ✓ ~ 128 chars User Id publicProfile string ~ 1024 chars Public profile followerProfile string ~ 1024 chars Profile for followers friendProfile string ~ 1024 chars Profile for friends timeOffsetToken string ~ 1024 chars Time offset token
Result Type Description item Profile Updated Profile
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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . UpdateProfileByUserId (
& friend . UpdateProfileByUserIdRequest {
NamespaceName : pointy . String ( "namespace2" ),
UserId : pointy . String ( "user-0001" ),
PublicProfile : pointy . String ( "public2" ),
FollowerProfile : pointy . String ( "follower2" ),
FriendProfile : pointy . String ( "friend2" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Friend\Gs2FriendRestClient ;
use Gs2\Friend\Request\UpdateProfileByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateProfileByUserId (
( new UpdateProfileByUserIdRequest ())
-> withNamespaceName ( self :: namespace2 )
-> withUserId ( "user-0001" )
-> withPublicProfile ( "public2" )
-> withFollowerProfile ( "follower2" )
-> withFriendProfile ( "friend2" )
-> withTimeOffsetToken ( null )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.UpdateProfileByUserIdRequest ;
import io.gs2.friend.result.UpdateProfileByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
UpdateProfileByUserIdResult result = client . updateProfileByUserId (
new UpdateProfileByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withUserId ( "user-0001" )
. withPublicProfile ( "public2" )
. withFollowerProfile ( "follower2" )
. withFriendProfile ( "friend2" )
. withTimeOffsetToken ( null )
);
Profile 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.UpdateProfileByUserIdRequest ;
using Gs2.Gs2Friend.Result.UpdateProfileByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . UpdateProfileByUserIdResult > asyncResult = null ;
yield return client . UpdateProfileByUserId (
new Gs2 . Gs2Friend . Request . UpdateProfileByUserIdRequest ()
. WithNamespaceName ( "namespace2" )
. WithUserId ( "user-0001" )
. WithPublicProfile ( "public2" )
. WithFollowerProfile ( "follower2" )
. WithFriendProfile ( "friend2" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . updateProfileByUserId (
new Gs2Friend . UpdateProfileByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withUserId ( "user-0001" )
. withPublicProfile ( "public2" )
. withFollowerProfile ( "follower2" )
. withFriendProfile ( "friend2" )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . update_profile_by_user_id (
friend . UpdateProfileByUserIdRequest ()
. with_namespace_name ( self . hash2 )
. with_user_id ( 'user-0001' )
. with_public_profile ( 'public2' )
. with_follower_profile ( 'follower2' )
. with_friend_profile ( 'friend2' )
. with_time_offset_token ( None )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.update_profile_by_user_id ({
namespaceName = "namespace2" ,
userId = "user-0001" ,
publicProfile = "public2" ,
followerProfile = "follower2" ,
friendProfile = "friend2" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
deleteProfileByUserId Delete profile
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace name userId string ✓ ~ 128 chars User Id timeOffsetToken string ~ 1024 chars Time offset token
Result Type Description item Profile Deleted Profile
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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . DeleteProfileByUserId (
& friend . DeleteProfileByUserIdRequest {
NamespaceName : pointy . String ( "namespace2" ),
UserId : pointy . String ( "user-0001" ),
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Friend\Gs2FriendRestClient ;
use Gs2\Friend\Request\DeleteProfileByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> deleteProfileByUserId (
( new DeleteProfileByUserIdRequest ())
-> withNamespaceName ( self :: namespace2 )
-> withUserId ( "user-0001" )
-> withTimeOffsetToken ( null )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.DeleteProfileByUserIdRequest ;
import io.gs2.friend.result.DeleteProfileByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
DeleteProfileByUserIdResult result = client . deleteProfileByUserId (
new DeleteProfileByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
Profile 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.DeleteProfileByUserIdRequest ;
using Gs2.Gs2Friend.Result.DeleteProfileByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . DeleteProfileByUserIdResult > asyncResult = null ;
yield return client . DeleteProfileByUserId (
new Gs2 . Gs2Friend . Request . DeleteProfileByUserIdRequest ()
. WithNamespaceName ( "namespace2" )
. WithUserId ( "user-0001" )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . deleteProfileByUserId (
new Gs2Friend . DeleteProfileByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withUserId ( "user-0001" )
. withTimeOffsetToken ( null )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . delete_profile_by_user_id (
friend . DeleteProfileByUserIdRequest ()
. with_namespace_name ( self . hash2 )
. with_user_id ( 'user-0001' )
. with_time_offset_token ( None )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.delete_profile_by_user_id ({
namespaceName = "namespace2" ,
userId = "user-0001" ,
timeOffsetToken = nil ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
updateProfileByStampSheet Update profile as an acquisition action
Request Type Condition Require Default Limitation Description stampSheet string ✓ ~ 5242880 chars Transaction keyId string ✓ ~ 1024 chars encryption key GRN
Result Type Description item Profile Updated Profile
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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . UpdateProfileByStampSheet (
& friend . UpdateProfileByStampSheetRequest {
StampSheet : pointy . String ( "stampSheet" ),
KeyId : pointy . String ( "key-0001" ),
}
)
if err != nil {
panic ( "error occurred" )
}
item := result . Item
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Friend\Gs2FriendRestClient ;
use Gs2\Friend\Request\UpdateProfileByStampSheetRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> updateProfileByStampSheet (
( new UpdateProfileByStampSheetRequest ())
-> withStampSheet ( self :: stampSheet )
-> withKeyId ( self :: key - 0001 )
);
$item = $result -> getItem ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.UpdateProfileByStampSheetRequest ;
import io.gs2.friend.result.UpdateProfileByStampSheetResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
UpdateProfileByStampSheetResult result = client . updateProfileByStampSheet (
new UpdateProfileByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
Profile 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.UpdateProfileByStampSheetRequest ;
using Gs2.Gs2Friend.Result.UpdateProfileByStampSheetResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . UpdateProfileByStampSheetResult > asyncResult = null ;
yield return client . UpdateProfileByStampSheet (
new Gs2 . Gs2Friend . Request . UpdateProfileByStampSheetRequest ()
. WithStampSheet ( "stampSheet" )
. WithKeyId ( "key-0001" ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var item = result . Item ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . updateProfileByStampSheet (
new Gs2Friend . UpdateProfileByStampSheetRequest ()
. withStampSheet ( "stampSheet" )
. withKeyId ( "key-0001" )
);
const item = result . getItem ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . update_profile_by_stamp_sheet (
friend . UpdateProfileByStampSheetRequest ()
. with_stamp_sheet ( self . stamp_sheet )
. with_key_id ( self . key1 . key_id )
)
item = result . item
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.update_profile_by_stamp_sheet ({
stampSheet = "stampSheet" ,
keyId = "key-0001" ,
})
if ( api_result.isError ) then
-- When error occurs
fail ( api_result [ 'statusCode' ], api_result [ 'message' ])
end
result = api_result.result
item = result.item ;
describeFriends Get list of friends
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace name accessToken string ✓ ~ 128 chars User Id withProfile bool ✓ false Get a profile together 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<FriendUser> List of Friend 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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . DescribeFriends (
& friend . DescribeFriendsRequest {
NamespaceName : pointy . String ( "namespace2" ),
AccessToken : pointy . String ( "accessToken-0001" ),
WithProfile : pointy . Bool ( true ),
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\Friend\Gs2FriendRestClient ;
use Gs2\Friend\Request\DescribeFriendsRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeFriends (
( new DescribeFriendsRequest ())
-> withNamespaceName ( self :: namespace2 )
-> withAccessToken ( self :: $accessToken0001 )
-> withWithProfile ( True )
-> 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.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.DescribeFriendsRequest ;
import io.gs2.friend.result.DescribeFriendsResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
DescribeFriendsResult result = client . describeFriends (
new DescribeFriendsRequest ()
. withNamespaceName ( "namespace2" )
. withAccessToken ( "accessToken-0001" )
. withWithProfile ( true )
. withPageToken ( null )
. withLimit ( null )
);
List < FriendUser > 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.DescribeFriendsRequest ;
using Gs2.Gs2Friend.Result.DescribeFriendsResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . DescribeFriendsResult > asyncResult = null ;
yield return client . DescribeFriends (
new Gs2 . Gs2Friend . Request . DescribeFriendsRequest ()
. WithNamespaceName ( "namespace2" )
. WithAccessToken ( "accessToken-0001" )
. WithWithProfile ( true )
. 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 Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . describeFriends (
new Gs2Friend . DescribeFriendsRequest ()
. withNamespaceName ( "namespace2" )
. withAccessToken ( "accessToken-0001" )
. withWithProfile ( true )
. withPageToken ( null )
. withLimit ( null )
);
const items = result . getItems ();
const nextPageToken = result . getNextPageToken ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . describe_friends (
friend . DescribeFriendsRequest ()
. with_namespace_name ( self . hash2 )
. with_access_token ( self . access_token_0001 )
. with_with_profile ( True )
. 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 ( 'friend' )
api_result = client.describe_friends ({
namespaceName = "namespace2" ,
accessToken = "accessToken-0001" ,
withProfile = true ,
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 ;
describeFriendsByUserId Get list of friends by user ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace name userId string ✓ ~ 128 chars User Id withProfile bool ✓ false Get a profile together pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data limit int ✓ 30 1 ~ 1000 Number of data acquired timeOffsetToken string ~ 1024 chars Time offset token
Result Type Description items List<FriendUser> List of Friend 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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . DescribeFriendsByUserId (
& friend . DescribeFriendsByUserIdRequest {
NamespaceName : pointy . String ( "namespace2" ),
UserId : pointy . String ( "user-0001" ),
WithProfile : pointy . Bool ( true ),
PageToken : nil ,
Limit : nil ,
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
nextPageToken := result . NextPageToken
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Friend\Gs2FriendRestClient ;
use Gs2\Friend\Request\DescribeFriendsByUserIdRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeFriendsByUserId (
( new DescribeFriendsByUserIdRequest ())
-> withNamespaceName ( self :: namespace2 )
-> withUserId ( "user-0001" )
-> withWithProfile ( True )
-> withPageToken ( null )
-> withLimit ( null )
-> withTimeOffsetToken ( null )
);
$items = $result -> getItems ();
$nextPageToken = $result -> getNextPageToken ();
} catch ( Gs2Exception $e ) {
exit ( "error occurred" )
}
import io.gs2.core.model.Region ;
import io.gs2.core.model.BasicGs2Credential ;
import io.gs2.core.rest.Gs2RestSession ;
import io.gs2.core.exception.Gs2Exception ;
import io.gs2.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.DescribeFriendsByUserIdRequest ;
import io.gs2.friend.result.DescribeFriendsByUserIdResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
DescribeFriendsByUserIdResult result = client . describeFriendsByUserId (
new DescribeFriendsByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withUserId ( "user-0001" )
. withWithProfile ( true )
. withPageToken ( null )
. withLimit ( null )
. withTimeOffsetToken ( null )
);
List < FriendUser > 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.DescribeFriendsByUserIdRequest ;
using Gs2.Gs2Friend.Result.DescribeFriendsByUserIdResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . DescribeFriendsByUserIdResult > asyncResult = null ;
yield return client . DescribeFriendsByUserId (
new Gs2 . Gs2Friend . Request . DescribeFriendsByUserIdRequest ()
. WithNamespaceName ( "namespace2" )
. WithUserId ( "user-0001" )
. WithWithProfile ( true )
. WithPageToken ( null )
. WithLimit ( null )
. WithTimeOffsetToken ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var items = result . Items ;
var nextPageToken = result . NextPageToken ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . describeFriendsByUserId (
new Gs2Friend . DescribeFriendsByUserIdRequest ()
. withNamespaceName ( "namespace2" )
. withUserId ( "user-0001" )
. withWithProfile ( true )
. withPageToken ( null )
. withLimit ( null )
. withTimeOffsetToken ( null )
);
const items = result . getItems ();
const nextPageToken = result . getNextPageToken ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . describe_friends_by_user_id (
friend . DescribeFriendsByUserIdRequest ()
. with_namespace_name ( self . hash2 )
. with_user_id ( 'user-0001' )
. with_with_profile ( True )
. with_page_token ( None )
. with_limit ( None )
. with_time_offset_token ( None )
)
items = result . items
next_page_token = result . next_page_token
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.describe_friends_by_user_id ({
namespaceName = "namespace2" ,
userId = "user-0001" ,
withProfile = true ,
pageToken = nil ,
limit = nil ,
timeOffsetToken = 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 ;
describeBlackList Get Blacklist
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace name accessToken string ✓ ~ 128 chars User Id 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<string> Blacklisted user ID list 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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . DescribeBlackList (
& friend . DescribeBlackListRequest {
NamespaceName : pointy . String ( "namespace2" ),
AccessToken : pointy . String ( "accessToken-0001" ),
PageToken : nil ,
Limit : nil ,
}
)
if err != nil {
panic ( "error occurred" )
}
items := result . Items
nextPageToken := result . NextPageToken
use Gs2\Core\Model\BasicGs2Credential ;
use Gs2\Core\Model\Region ;
use Gs2\Core\Net\Gs2RestSession ;
use Gs2\Core\Exception\Gs2Exception ;
use Gs2\Friend\Gs2FriendRestClient ;
use Gs2\Friend\Request\DescribeBlackListRequest ;
$session = new Gs2RestSession (
new BasicGs2Credential (
"your client id" ,
"your client secret"
),
Region :: AP_NORTHEAST_1
);
$session -> open ();
$client = new Gs2AccountRestClient (
$session
);
try {
$result = $client -> describeBlackList (
( new DescribeBlackListRequest ())
-> withNamespaceName ( self :: namespace2 )
-> withAccessToken ( self :: $accessToken0001 )
-> 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.friend.rest.Gs2FriendRestClient ;
import io.gs2.friend.request.DescribeBlackListRequest ;
import io.gs2.friend.result.DescribeBlackListResult ;
Gs2RestSession session = new Gs2RestSession (
Region . AP_NORTHEAST_1 ,
new BasicGs2Credential (
' your client id ' ,
' your client secret '
)
);
session . connect ();
Gs2FriendRestClient client = new Gs2FriendRestClient ( session );
try {
DescribeBlackListResult result = client . describeBlackList (
new DescribeBlackListRequest ()
. withNamespaceName ( "namespace2" )
. withAccessToken ( "accessToken-0001" )
. withPageToken ( null )
. withLimit ( null )
);
List < String > 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.Gs2Friend.Gs2FriendRestClient ;
using Gs2.Gs2Friend.Request.DescribeBlackListRequest ;
using Gs2.Gs2Friend.Result.DescribeBlackListResult ;
var session = new Gs2RestSession (
new BasicGs2Credential (
' your client id ' ,
' your client secret '
),
Region . ApNortheast1
);
yield return session . Open ();
var client = new Gs2FriendRestClient ( session );
AsyncResult < Gs2 . Gs2Friend . Result . DescribeBlackListResult > asyncResult = null ;
yield return client . DescribeBlackList (
new Gs2 . Gs2Friend . Request . DescribeBlackListRequest ()
. WithNamespaceName ( "namespace2" )
. WithAccessToken ( "accessToken-0001" )
. WithPageToken ( null )
. WithLimit ( null ),
r => asyncResult = r
);
if ( asyncResult . Error != null ) {
throw asyncResult . Error ;
}
var result = asyncResult . Result ;
var items = result . Items ;
var nextPageToken = result . NextPageToken ;
import Gs2Core from '@/gs2/core' ;
import * as Gs2Friend from '@/gs2/friend' ;
const session = new Gs2Core . Gs2RestSession (
"ap-northeast-1" ,
new Gs2Core . BasicGs2Credential (
'your client id' ,
'your client secret'
)
);
await session . connect ();
const client = new Gs2Friend . Gs2FriendRestClient ( session );
try {
const result = await client . describeBlackList (
new Gs2Friend . DescribeBlackListRequest ()
. withNamespaceName ( "namespace2" )
. withAccessToken ( "accessToken-0001" )
. withPageToken ( null )
. withLimit ( null )
);
const items = result . getItems ();
const nextPageToken = result . getNextPageToken ();
} catch ( e ) {
process . exit ( 1 );
}
from gs2 import core
from gs2 import friend
session = core . Gs2RestSession (
core . BasicGs2Credential (
'your client id' ,
'your client secret'
),
"ap-northeast-1" ,
)
session . connect ()
client = friend . Gs2FriendRestClient ( session )
try :
result = client . describe_black_list (
friend . DescribeBlackListRequest ()
. with_namespace_name ( self . hash2 )
. with_access_token ( self . access_token_0001 )
. with_page_token ( None )
. with_limit ( None )
)
items = result . items
next_page_token = result . next_page_token
except core . Gs2Exception as e :
exit ( 1 )
client = gs2 ( 'friend' )
api_result = client.describe_black_list ({
namespaceName = "namespace2" ,
accessToken = "accessToken-0001" ,
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 ;
describeBlackListByUserId Get blacklist by specifying user ID
Request Type Condition Require Default Limitation Description namespaceName string ✓ ~ 128 chars Namespace name userId string ✓ ~ 128 chars User Id pageToken string ~ 1024 chars Token specifying the position from which to start acquiring data limit int ✓ 30 1 ~ 1000 Number of data acquired timeOffsetToken string ~ 1024 chars Time offset token
Result Type Description items List<string> Blacklisted user ID list 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/friend"
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 := friend . Gs2FriendRestClient {
Session : & session ,
}
result , err := client . DescribeBlackListByUserId (
& friend . DescribeBlackListByUserIdRequest {
NamespaceName : pointy . String ( "namespace2" ),
UserId : pointy . String ( "user-0001" ),
PageToken : nil ,
Limit : nil ,
TimeOffsetToken : nil ,
}
)
if err != nil {
panic ( "error occurred" )