GS2-Account SDK API Reference
Model
Namespace
Namespace
A Namespace allows multiple independent instances of the same service within a single project by separating data spaces and usage contexts. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the namespace differs, the data is treated as a completely independent data space.
Therefore, you must create a namespace before you can start using each service.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceId | string | * | ~ 1024 chars | Namespace GRN * Set automatically by the server | ||
| name | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| transactionSetting | TransactionSetting | Transaction Setting | ||||
| changePasswordIfTakeOver | bool | false | Whether to change the password when taking over the account Specifies whether to change the password when taking over the account. This setting allows you to restrict logins from the device used before the takeover after the takeover is completed. | |||
| differentUserIdForLoginAndDataRetention | bool | false | Whether to use different user IDs for login and data retention Specifies whether to use different user IDs for login and data retention. This setting may help comply with privacy requirements defined by the platform provider with less implementation effort. *This parameter can only be set when creating a namespace. | |||
| createAccountScript | ScriptSetting | Script to run when creating an account Used to implement custom logic for creating an account. Script Trigger Reference - createAccount | ||||
| authenticationScript | ScriptSetting | Script to run when authenticated Used to implement custom logic for authentication. Script Trigger Reference - authentication | ||||
| createTakeOverScript | ScriptSetting | Script to run when creating a takeover If you want to give a reward when you register takeover information for the first time, you can use this to add custom logic to increase the GS2-Mission counter. Script Trigger Reference - createTakeOver | ||||
| doTakeOverScript | ScriptSetting | Script to run when taking over Used to implement custom logic for taking over. Script Trigger Reference - doTakeOver | ||||
| banScript | ScriptSetting | Script to run when adding Account Ban Status Script Trigger Reference - ban | ||||
| unBanScript | ScriptSetting | Script to run when removing Account Ban Status Script Trigger Reference - unBan | ||||
| logSetting | LogSetting | Log Output Setting Manages Log Output Setting. This type holds the GS2-Log namespace information used to output log data. | ||||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
TransactionSetting
Transaction Setting
Transaction Setting controls how transactions are executed, including their consistency, asynchronous processing, and conflict avoidance mechanisms. Combining features like AutoRun, AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, and asynchronous Acquire Actions via GS2-JobQueue enables robust transaction management tailored to game logic.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| enableAutoRun | bool | false | Whether to automatically execute issued transactions on the server side | |||
| enableAtomicCommit | bool | {enableAutoRun} == true | false | Whether to commit the execution of transactions atomically * Applicable only if enableAutoRun is true | ||
| transactionUseDistributor | bool | {enableAtomicCommit} == true | false | Whether to execute transactions asynchronously * Applicable only if enableAtomicCommit is true | ||
| commitScriptResultInUseDistributor | bool | {transactionUseDistributor} == true | false | Whether to execute the commit processing of the script result asynchronously * Applicable only if transactionUseDistributor is true | ||
| acquireActionUseJobQueue | bool | {enableAtomicCommit} == true | false | Whether to use GS2-JobQueue to execute the acquire action * Applicable only if enableAtomicCommit is true | ||
| distributorNamespaceId | string | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024 chars | GS2-Distributor Namespace GRN used to execute transactions | ||
| queueNamespaceId | string | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024 chars | GS2-JobQueue Namespace GRN used to execute transactions |
ScriptSetting
Script Setting
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’s execution results to halt API execution or control the API’s response content.
In contrast, asynchronous execution does not block processing until the script has finished executing. However, because the script result cannot be used to stop the API execution or modify the API response, asynchronous execution does not affect the API response flow and is generally recommended.
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.
Details
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| triggerScriptId | string | ~ 1024 chars | GS2-Script script GRN
executed synchronously when the API is executed Must be specified in GRN format starting with “grn:gs2:”. | |||||||||||
| doneTriggerTargetType | String Enum enum { “none”, “gs2_script”, “aws” } | “none” | How to execute asynchronous scripts Specifies the type of script to use for asynchronous execution. You can choose from “Do not use asynchronous execution (none)”, “Use GS2-Script (gs2_script)”, and “Use Amazon EventBridge (aws)”.
| |||||||||||
| doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | GS2-Script script GRN
for asynchronous execution Must be specified in GRN format starting with “grn:gs2:”. * Applicable only if doneTriggerTargetType is “gs2_script” | ||||||||||
| doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024 chars | GS2-JobQueue namespace GRN
to execute asynchronous execution scripts If you want to execute asynchronous execution scripts via GS2-JobQueue instead of executing them directly, specify the GS2-JobQueue namespace GRN. There are not many cases where GS2-JobQueue is required, so you generally do not need to specify it unless you have a specific reason. * Applicable only if doneTriggerTargetType is “gs2_script” |
LogSetting
Log Output Setting
Log Output Setting defines how log data is exported. This type holds the GS2-Log namespace identifier (Namespace ID) used to export log data. Specify the GS2-Log namespace where log data is collected and stored in the GRN format for the Log Namespace ID (loggingNamespaceId). Configuring this setting ensures that log data for API requests and responses occurring within the specified namespace is output to the target GS2-Log namespace. GS2-Log provides real-time logs that can be used for system monitoring, analysis, debugging, and other operational purposes.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| loggingNamespaceId | string | ✓ | ~ 1024 chars | GS2-Log namespace GRN
to output logs Must be specified in GRN format starting with “grn:gs2:”. |
GitHubCheckoutSetting
Setup to check out master data from GitHub
Details
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| apiKeyId | string | ✓ | ~ 1024 chars | GitHub API Key GRN | ||||||||||
| repositoryName | string | ✓ | ~ 1024 chars | Repository Name | ||||||||||
| sourcePath | string | ✓ | ~ 1024 chars | Master data (JSON) file path | ||||||||||
| referenceType | String Enum enum { “commit_hash”, “branch”, “tag” } | ✓ | Source of code
| |||||||||||
| commitHash | string | {referenceType} == “commit_hash” | ✓* | ~ 1024 chars | Commit hash * Required if referenceType is “commit_hash” | |||||||||
| branchName | string | {referenceType} == “branch” | ✓* | ~ 1024 chars | Branch Name * Required if referenceType is “branch” | |||||||||
| tagName | string | {referenceType} == “tag” | ✓* | ~ 1024 chars | Tag Name * Required if referenceType is “tag” |
Account
Game Player Account
An entity of identity information that identifies a game player. Game player accounts are anonymous accounts and consist of a user ID (UUID) and password (a random 32-character string), so game players do not need to enter their email address or other information.
The issued Game Player Account is stored in the device’s local storage and is used for future logins.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| accountId | string | * | ~ 1024 chars | Game Player Account GRN * Set automatically by the server | ||
| userId | string | ✓ | UUID | ~ 128 chars | User ID | |
| password | string | ✓ | ~ 128 chars | Password Stores the password for securing the account. Passwords can be up to 128 characters long and play an important role in protecting your account. | ||
| timeOffset | int | 0 | 0 ~ 315360000 | Time offset from the current time (number of seconds relative to the current time) The time offset represents the difference from the current server time in seconds. This value is used when in-game events or features need to operate according to a specific time. | ||
| banStatuses | List<BanStatus> | [] | 0 ~ 10 items | List of Account Ban Statuses Stores detailed information about the BAN (access restriction) status associated with the account. Each entry contains the reason for the BAN, the period, and other related information. | ||
| banned | bool | false | Whether the Account is currently banned Indicates Whether the Account is currently banned. If true, the Account is in an access-restricted state, and if false, it is accessible. | |||
| lastAuthenticatedAt | long | Last authenticated time The last time the Account was authenticated. This value is updated each time the Account is authenticated. | ||||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
TakeOver
Takeover Information
Takeover Information is used when changing devices or moving/sharing an account across platforms. It consists of a unique string that identifies an individual and a password; by entering the correct combination, an Account (GS2 anonymous account) can be retrieved.
Multiple sets of Takeover Information can be configured for a single Account. To configure multiple sets, you must assign each one to a different slot. Slots can be specified from 0 to 1024, allowing for up to 1,025 types of Takeover Information to be set.
A typical example would be to store the account information for “Sign in with Apple” in slot 0 and the information for a Google account in slot 1. It should be noted that this Takeover Information serves only as a data holder; the authentication mechanism for social accounts must be prepared separately.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| takeOverId | string | * | ~ 1024 chars | Takeover Information GRN * Set automatically by the server | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. | ||
| userIdentifier | string | ✓ | ~ 1024 chars | User ID for takeover A unique key used to identify an individual when taking over an account. If the same userIdentifier is specified for different accounts, the value set later will take precedence. | ||
| password | string | ✓ | ~ 128 chars | Password For security reasons, this password is treated as confidential information and only the hash value is stored. | ||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
PlatformId
Platform ID
Holds IDs for various platforms such as X, Instagram, and Facebook. Other players can search for players using various platform IDs.
When importing Instagram followers or Facebook friends as in-game friends, it is used to identify the GS2-Account account.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| platformId | string | * | ~ 1024 chars | Platform Id GRN * Set automatically by the server | ||
| userId | string | ✓ | ~ 128 chars | GS2-Account User ID The GS2-Account user ID that this platform ID is linked to. Used to map between external platform identities and GS2 anonymous accounts. | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified within the range from 0 to 1024, it is used to identify the type of platform. | ||
| userIdentifier | string | ✓ | ~ 1024 chars | User ID on various platforms The user’s unique identifier on the external platform (e.g., social media user ID or email address). Used together with the slot number (type) to identify a specific platform account. | ||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
DataOwner
Data Owner
A Data Owner is used when “Whether to use different user IDs for login and data retention” is specified in the namespace settings. The user ID that can be obtained when a Data Owner ID that is different from the user ID is issued and an access token is received through the GS2-Account authentication process is the Data Owner ID.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| dataOwnerId | string | * | ~ 1024 chars | Data Owner setting GRN * Set automatically by the server | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| name | string | ✓ | UUID | ~ 36 chars | Data Owner ID Serves as a unique identifier for the data owner. The data owner ID represents the actual owner of the data and may be different from the user ID. | |
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
TakeOverTypeModel
Takeover Type Model
This model defines Takeover Information.
Takeover Information is used when changing devices or moving/sharing an account across platforms. It consists of a unique string that identifies an individual and a password; by entering the correct combination, an Account (GS2 anonymous account) can be retrieved.
Multiple sets of Takeover Information can be configured for a single Account. To configure multiple sets, you must assign each one to a different slot. Slots can be specified from 0 to 1024, allowing for up to 1,025 types of Takeover Information to be set.
A typical example would be to store the account information for “Sign in with Apple” in slot 0 and the information for a Google account in slot 1. It should be noted that this Takeover Information serves only as a data holder; the authentication mechanism for social accounts must be prepared separately.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| takeOverTypeModelId | string | * | ~ 1024 chars | Takeover Type Model GRN * Set automatically by the server | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different types of takeover information. | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| openIdConnectSetting | OpenIdConnectSetting | ✓ | OpenID Connect Configuration Configuration for integrating with an OpenID Connect-compliant Identity Provider (IdP). Includes the discovery URL, client credentials, and platform-specific settings such as Apple Sign In parameters. |
OpenIdConnectSetting
OpenID Connect Configuration
By registering the settings of an OpenID Connect-compliant IdP, IdP integration can be configured and used as Takeover Information.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| configurationPath | string | ✓ | ~ 1024 chars | OpenID Connect Configuration URL The discovery endpoint URL of the OpenID Connect provider. Must follow the well-known format (e.g., https://example.com/.well-known/openid-configuration). | ||
| clientId | string | ✓ | ~ 1024 chars | Client ID The client ID of the application registered with the IdP. | ||
| clientSecret | string | {configurationPath} != “https://appleid.apple.com/.well-known/openid-configuration” | ✓* | ~ 1024 chars | Client Secret * clientSecret is required when the configurationPath is not “https://appleid.apple.com/.well-known/openid-configuration”, i.e., for other IdP integrations. | |
| appleTeamId | string | {configurationPath} == “https://appleid.apple.com/.well-known/openid-configuration” | ✓* | ~ 1024 chars | Team ID of Apple Developer The team ID from the Apple Developer account. Required for Apple Sign In authentication. * Required if configurationPath is “https://appleid.apple.com/.well-known/openid-configuration” | |
| appleKeyId | string | {configurationPath} == “https://appleid.apple.com/.well-known/openid-configuration” | ✓* | ~ 1024 chars | Key ID registered with Apple The key ID registered in the Apple Developer account for Sign in with Apple. * Required if configurationPath is “https://appleid.apple.com/.well-known/openid-configuration” | |
| applePrivateKeyPem | string | {configurationPath} == “https://appleid.apple.com/.well-known/openid-configuration” | ✓* | ~ 10240 chars | Private Key received from Apple The private key in PEM format downloaded from the Apple Developer portal. Required for Apple Sign In authentication. * Required if configurationPath is “https://appleid.apple.com/.well-known/openid-configuration” | |
| doneEndpointUrl | string | ~ 1024 chars | URL to transition to when authentication is complete If not specified, it will transition to /authorization/done. id_token is attached to the Query String. | |||
| additionalScopeValues | List<ScopeValue> | [] | 0 ~ 10 items | Additional scopes obtained with OpenID Connect Additional OAuth scopes to request from the IdP beyond the default OpenID Connect scopes. Allows retrieving extra user information during authentication. | ||
| additionalReturnValues | List<string> | [] | 0 ~ 10 items | Additional return values obtained with OpenID Connect Additional claim names from the ID token or UserInfo response to include in the return values. Specified claims are extracted and returned alongside the standard authentication result. |
ScopeValue
Scope Value
A key-value pair representing an additional OAuth scope value obtained during OpenID Connect authentication. Used to store extra data retrieved from the IdP beyond the standard OpenID Connect claims.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| key | string | ✓ | ~ 64 chars | Name The scope name that was requested from the IdP during authentication. | ||
| value | string | ~ 51200 chars | Value The value returned by the IdP for the corresponding scope. |
PlatformUser
Various platform user information
Holds user information from external platforms. Contains the mapping between a platform-specific user identifier and the corresponding GS2-Account user ID, used for searching players by their platform identity.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified within the range from 0 to 1024, it is used to identify the type of platform. | ||
| userIdentifier | string | ✓ | ~ 1024 chars | User ID on various platforms The user’s unique identifier on the external platform (e.g., social media user ID or email address). Used together with the slot number (type) to identify a specific platform account. | ||
| userId | string | ✓ | ~ 128 chars | GS2-Account User ID The GS2-Account user ID that this platform user is linked to. Used to map between external platform identities and GS2 anonymous accounts. |
BanStatus
Account Ban Status
Represents information about the BAN (access restriction) status applied to a Game Player Account. This type includes detailed information such as the reason for the BAN, the name of the BAN, and the scheduled date and time for the BAN to be lifted. Ban status can be applied to an account for various reasons, such as cheating or violation of the terms of service, and this type helps to manage that status. The system uses this information to control the account’s access permissions and to restrict or release access as necessary.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | UUID | ~ 36 chars | Ban status name Maintains a unique name for each Ban status. The name can be set to any value. If omitted, it is automatically generated in UUID (Universally Unique Identifier) format and used to identify each Ban status. This ID allows for easy tracking of multiple Ban statuses. | |
| reason | string | ✓ | ~ 256 chars | Reason for BAN Explains the specific reason for the BAN. It can be up to 256 characters long and helps to clarify the cause of the BAN. This information is not only referenced by the account administrator and the operations team, but also included in the response value to the game client. | ||
| releaseTimestamp | long | ✓ | Date and time when the BAN will be released Indicates the date and time when the Account Ban will be released. Once this date and time has passed, the account will be automatically released from the BAN and normal access will be possible. |
CurrentModelMaster
Master data of the currently active Takeover Type Model
This master data describes the definitions of Takeover Type Models currently active within the namespace. GS2 uses JSON format files for managing master data. By uploading these files, the master data settings are updated on the server.
To create JSON files, GS2 provides a master data editor within the management console. Additionally, you can create tools better suited for game operations and export JSON files in the appropriate format.
Note
Please refer to Master Data Reference of GS2-Account for the JSON file format.Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceId | string | * | ~ 1024 chars | Namespace GRN * Set automatically by the server | ||
| settings | string | ✓ | ~ 5242880 bytes (5MB) | Master Data |
TakeOverTypeModelMaster
Takeover Type Model Master
Takeover Type Model Master is data used to edit and manage Takeover Type Models within the game. It is temporarily stored in the Management Console’s Master Data Editor. By performing import and update processes, it is reflected as Takeover Type Model actually referenced by the game.
Takeover Information is used when changing devices or moving/sharing an account across platforms. It consists of a unique string that identifies an individual and a password; by entering the correct combination, an Account (GS2 anonymous account) can be retrieved.
Multiple sets of Takeover Information can be configured for a single Account. To configure multiple sets, you must assign each one to a different slot. Slots can be specified from 0 to 1024, allowing for up to 1,025 types of Takeover Information to be set.
A typical example would be to store the account information for “Sign in with Apple” in slot 0 and the information for a Google account in slot 1. It should be noted that this Takeover Information serves only as a data holder; the authentication mechanism for social accounts must be prepared separately.
Details
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| takeOverTypeModelId | string | * | ~ 1024 chars | Takeover Type Model Master GRN * Set automatically by the server | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different types of takeover information. | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| openIdConnectSetting | OpenIdConnectSetting | ✓ | OpenID Connect Configuration Configuration for integrating with an OpenID Connect-compliant Identity Provider (IdP). Includes the discovery URL, client credentials, and platform-specific settings such as Apple Sign In parameters. | |||
| createdAt | long | * | Now | Datetime of creation Unix time, milliseconds * Set automatically by the server | ||
| updatedAt | long | * | Now | Datetime of last update Unix time, milliseconds * Set automatically by the server | ||
| revision | long | 0 | 0 ~ 9223372036854775805 | Revision |
Methods
describeNamespaces
Get a list of Namespaces
Retrieves a list of namespaces that have been created on a per-service basis within the project. You can use the optional page token to start acquiring data from a specific location in the list. You can also limit the number of namespaces to be acquired.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namePrefix | string | ~ 64 chars | Filter by Namespace name prefix | |||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<Namespace> | List of Namespace |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DescribeNamespaces(
&account.DescribeNamespacesRequest {
NamePrefix: nil,
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\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())
->withNamePrefix(null)
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeNamespacesRequest;
import io.gs2.account.result.DescribeNamespacesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DescribeNamespacesResult result = client.describeNamespaces(
new DescribeNamespacesRequest()
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
List<Namespace> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
new Gs2.Gs2Account.Request.DescribeNamespacesRequest()
.WithNamePrefix(null)
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.describeNamespaces(
new Gs2Account.DescribeNamespacesRequest()
.withNamePrefix(null)
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.describe_namespaces(
account.DescribeNamespacesRequest()
.with_name_prefix(None)
.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('account')
api_result = client.describe_namespaces({
namePrefix=nil,
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('account')
api_result_handler = client.describe_namespaces_async({
namePrefix=nil,
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createNamespace
Create a new Namespace
You must specify detailed information including the name, description, and various settings of the namespace.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| transactionSetting | TransactionSetting | Transaction Setting | ||||
| changePasswordIfTakeOver | bool | false | Whether to change the password when taking over the account Specifies whether to change the password when taking over the account. This setting allows you to restrict logins from the device used before the takeover after the takeover is completed. | |||
| differentUserIdForLoginAndDataRetention | bool | false | Whether to use different user IDs for login and data retention Specifies whether to use different user IDs for login and data retention. This setting may help comply with privacy requirements defined by the platform provider with less implementation effort. *This parameter can only be set when creating a namespace. | |||
| createAccountScript | ScriptSetting | Script to run when creating an account Used to implement custom logic for creating an account. Script Trigger Reference - createAccount | ||||
| authenticationScript | ScriptSetting | Script to run when authenticated Used to implement custom logic for authentication. Script Trigger Reference - authentication | ||||
| createTakeOverScript | ScriptSetting | Script to run when creating a takeover If you want to give a reward when you register takeover information for the first time, you can use this to add custom logic to increase the GS2-Mission counter. Script Trigger Reference - createTakeOver | ||||
| doTakeOverScript | ScriptSetting | Script to run when taking over Used to implement custom logic for taking over. Script Trigger Reference - doTakeOver | ||||
| banScript | ScriptSetting | Script to run when adding Account Ban Status Script Trigger Reference - ban | ||||
| unBanScript | ScriptSetting | Script to run when removing Account Ban Status Script Trigger Reference - unBan | ||||
| logSetting | LogSetting | Log Output Setting Manages Log Output Setting. This type holds the GS2-Log namespace information used to output log data. |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | Namespace created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.CreateNamespace(
&account.CreateNamespaceRequest {
Name: pointy.String("namespace-0001"),
Description: nil,
TransactionSetting: nil,
ChangePasswordIfTakeOver: pointy.Bool(false),
DifferentUserIdForLoginAndDataRetention: nil,
CreateAccountScript: nil,
AuthenticationScript: nil,
CreateTakeOverScript: nil,
DoTakeOverScript: nil,
BanScript: nil,
UnBanScript: nil,
LogSetting: &account.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\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("namespace-0001")
->withDescription(null)
->withTransactionSetting(null)
->withChangePasswordIfTakeOver(False)
->withDifferentUserIdForLoginAndDataRetention(null)
->withCreateAccountScript(null)
->withAuthenticationScript(null)
->withCreateTakeOverScript(null)
->withDoTakeOverScript(null)
->withBanScript(null)
->withUnBanScript(null)
->withLogSetting((new \Gs2\Account\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateNamespaceRequest;
import io.gs2.account.result.CreateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
CreateNamespaceResult result = client.createNamespace(
new CreateNamespaceRequest()
.withName("namespace-0001")
.withDescription(null)
.withTransactionSetting(null)
.withChangePasswordIfTakeOver(false)
.withDifferentUserIdForLoginAndDataRetention(null)
.withCreateAccountScript(null)
.withAuthenticationScript(null)
.withCreateTakeOverScript(null)
.withDoTakeOverScript(null)
.withBanScript(null)
.withUnBanScript(null)
.withLogSetting(new io.gs2.account.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
new Gs2.Gs2Account.Request.CreateNamespaceRequest()
.WithName("namespace-0001")
.WithDescription(null)
.WithTransactionSetting(null)
.WithChangePasswordIfTakeOver(false)
.WithDifferentUserIdForLoginAndDataRetention(null)
.WithCreateAccountScript(null)
.WithAuthenticationScript(null)
.WithCreateTakeOverScript(null)
.WithDoTakeOverScript(null)
.WithBanScript(null)
.WithUnBanScript(null)
.WithLogSetting(new Gs2.Gs2Account.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.createNamespace(
new Gs2Account.CreateNamespaceRequest()
.withName("namespace-0001")
.withDescription(null)
.withTransactionSetting(null)
.withChangePasswordIfTakeOver(false)
.withDifferentUserIdForLoginAndDataRetention(null)
.withCreateAccountScript(null)
.withAuthenticationScript(null)
.withCreateTakeOverScript(null)
.withDoTakeOverScript(null)
.withBanScript(null)
.withUnBanScript(null)
.withLogSetting(new Gs2Account.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.create_namespace(
account.CreateNamespaceRequest()
.with_name('namespace-0001')
.with_description(None)
.with_transaction_setting(None)
.with_change_password_if_take_over(False)
.with_different_user_id_for_login_and_data_retention(None)
.with_create_account_script(None)
.with_authentication_script(None)
.with_create_take_over_script(None)
.with_do_take_over_script(None)
.with_ban_script(None)
.with_un_ban_script(None)
.with_log_setting(
account.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.create_namespace({
name="namespace-0001",
description=nil,
transactionSetting=nil,
changePasswordIfTakeOver=false,
differentUserIdForLoginAndDataRetention=nil,
createAccountScript=nil,
authenticationScript=nil,
createTakeOverScript=nil,
doTakeOverScript=nil,
banScript=nil,
unBanScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.create_namespace_async({
name="namespace-0001",
description=nil,
transactionSetting=nil,
changePasswordIfTakeOver=false,
differentUserIdForLoginAndDataRetention=nil,
createAccountScript=nil,
authenticationScript=nil,
createTakeOverScript=nil,
doTakeOverScript=nil,
banScript=nil,
unBanScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getNamespaceStatus
Get Namespace status
Get the current status of the specified namespace. This includes whether the Namespace is active, pending, or in some other state.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| status | string |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.GetNamespaceStatus(
&account.GetNamespaceStatusRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
status := result.Statususe Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\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("namespace-0001")
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetNamespaceStatusRequest;
import io.gs2.account.result.GetNamespaceStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
GetNamespaceStatusResult result = client.getNamespaceStatus(
new GetNamespaceStatusRequest()
.withNamespaceName("namespace-0001")
);
String status = result.getStatus();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
new Gs2.Gs2Account.Request.GetNamespaceStatusRequest()
.WithNamespaceName("namespace-0001"),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.getNamespaceStatus(
new Gs2Account.GetNamespaceStatusRequest()
.withNamespaceName("namespace-0001")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.get_namespace_status(
account.GetNamespaceStatusRequest()
.with_namespace_name('namespace-0001')
)
status = result.status
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.get_namespace_status({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
status = result.status;client = gs2('account')
api_result_handler = client.get_namespace_status_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
status = result.status;getNamespace
Get namespace
Get detailed information about the specified namespace. This includes the name, description, and other settings of the namespace.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | Namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.GetNamespace(
&account.GetNamespaceRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\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("namespace-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetNamespaceRequest;
import io.gs2.account.result.GetNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
GetNamespaceResult result = client.getNamespace(
new GetNamespaceRequest()
.withNamespaceName("namespace-0001")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
new Gs2.Gs2Account.Request.GetNamespaceRequest()
.WithNamespaceName("namespace-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.getNamespace(
new Gs2Account.GetNamespaceRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.get_namespace(
account.GetNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.get_namespace({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.get_namespace_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateNamespace
Update Namespace
Update the settings of the specified namespace. You can change the description of the Namespace and specific settings.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| transactionSetting | TransactionSetting | Transaction Setting | ||||
| changePasswordIfTakeOver | bool | false | Whether to change the password when taking over the account Specifies whether to change the password when taking over the account. This setting allows you to restrict logins from the device used before the takeover after the takeover is completed. | |||
| createAccountScript | ScriptSetting | Script to run when creating an account Used to implement custom logic for creating an account. Script Trigger Reference - createAccount | ||||
| authenticationScript | ScriptSetting | Script to run when authenticated Used to implement custom logic for authentication. Script Trigger Reference - authentication | ||||
| createTakeOverScript | ScriptSetting | Script to run when creating a takeover If you want to give a reward when you register takeover information for the first time, you can use this to add custom logic to increase the GS2-Mission counter. Script Trigger Reference - createTakeOver | ||||
| doTakeOverScript | ScriptSetting | Script to run when taking over Used to implement custom logic for taking over. Script Trigger Reference - doTakeOver | ||||
| banScript | ScriptSetting | Script to run when adding Account Ban Status Script Trigger Reference - ban | ||||
| unBanScript | ScriptSetting | Script to run when removing Account Ban Status Script Trigger Reference - unBan | ||||
| logSetting | LogSetting | Log Output Setting Manages Log Output Setting. This type holds the GS2-Log namespace information used to output log data. |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | Namespace updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.UpdateNamespace(
&account.UpdateNamespaceRequest {
NamespaceName: pointy.String("namespace-0001"),
Description: pointy.String("description1"),
TransactionSetting: nil,
ChangePasswordIfTakeOver: pointy.Bool(true),
CreateAccountScript: &account.ScriptSetting{
TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001"),
DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002"),
},
AuthenticationScript: &account.ScriptSetting{
TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003"),
DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"),
},
CreateTakeOverScript: &account.ScriptSetting{
TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005"),
DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"),
},
DoTakeOverScript: &account.ScriptSetting{
TriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007"),
DoneTriggerScriptId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008"),
},
BanScript: nil,
UnBanScript: nil,
LogSetting: &account.LogSetting{
LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\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("namespace-0001")
->withDescription("description1")
->withTransactionSetting(null)
->withChangePasswordIfTakeOver(True)
->withCreateAccountScript((new \Gs2\Account\Model\ScriptSetting())
->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001")
->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002"))
->withAuthenticationScript((new \Gs2\Account\Model\ScriptSetting())
->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003")
->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"))
->withCreateTakeOverScript((new \Gs2\Account\Model\ScriptSetting())
->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005")
->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"))
->withDoTakeOverScript((new \Gs2\Account\Model\ScriptSetting())
->withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007")
->withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008"))
->withBanScript(null)
->withUnBanScript(null)
->withLogSetting((new \Gs2\Account\Model\LogSetting())
->withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateNamespaceRequest;
import io.gs2.account.result.UpdateNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
UpdateNamespaceResult result = client.updateNamespace(
new UpdateNamespaceRequest()
.withNamespaceName("namespace-0001")
.withDescription("description1")
.withTransactionSetting(null)
.withChangePasswordIfTakeOver(true)
.withCreateAccountScript(new io.gs2.account.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002"))
.withAuthenticationScript(new io.gs2.account.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"))
.withCreateTakeOverScript(new io.gs2.account.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"))
.withDoTakeOverScript(new io.gs2.account.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008"))
.withBanScript(null)
.withUnBanScript(null)
.withLogSetting(new io.gs2.account.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
new Gs2.Gs2Account.Request.UpdateNamespaceRequest()
.WithNamespaceName("namespace-0001")
.WithDescription("description1")
.WithTransactionSetting(null)
.WithChangePasswordIfTakeOver(true)
.WithCreateAccountScript(new Gs2.Gs2Account.Model.ScriptSetting()
.WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001")
.WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002"))
.WithAuthenticationScript(new Gs2.Gs2Account.Model.ScriptSetting()
.WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003")
.WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"))
.WithCreateTakeOverScript(new Gs2.Gs2Account.Model.ScriptSetting()
.WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005")
.WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"))
.WithDoTakeOverScript(new Gs2.Gs2Account.Model.ScriptSetting()
.WithTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007")
.WithDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008"))
.WithBanScript(null)
.WithUnBanScript(null)
.WithLogSetting(new Gs2.Gs2Account.Model.LogSetting()
.WithLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.updateNamespace(
new Gs2Account.UpdateNamespaceRequest()
.withNamespaceName("namespace-0001")
.withDescription("description1")
.withTransactionSetting(null)
.withChangePasswordIfTakeOver(true)
.withCreateAccountScript(new Gs2Account.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002"))
.withAuthenticationScript(new Gs2Account.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004"))
.withCreateTakeOverScript(new Gs2Account.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006"))
.withDoTakeOverScript(new Gs2Account.model.ScriptSetting()
.withTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007")
.withDoneTriggerScriptId("grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008"))
.withBanScript(null)
.withUnBanScript(null)
.withLogSetting(new Gs2Account.model.LogSetting()
.withLoggingNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.update_namespace(
account.UpdateNamespaceRequest()
.with_namespace_name('namespace-0001')
.with_description('description1')
.with_transaction_setting(None)
.with_change_password_if_take_over(True)
.with_create_account_script(
account.ScriptSetting()
.with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001')
.with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002'))
.with_authentication_script(
account.ScriptSetting()
.with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003')
.with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004'))
.with_create_take_over_script(
account.ScriptSetting()
.with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005')
.with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006'))
.with_do_take_over_script(
account.ScriptSetting()
.with_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007')
.with_done_trigger_script_id('grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008'))
.with_ban_script(None)
.with_un_ban_script(None)
.with_log_setting(
account.LogSetting()
.with_logging_namespace_id('grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.update_namespace({
namespaceName="namespace-0001",
description="description1",
transactionSetting=nil,
changePasswordIfTakeOver=true,
createAccountScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002",
},
authenticationScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004",
},
createTakeOverScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006",
},
doTakeOverScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008",
},
banScript=nil,
unBanScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.update_namespace_async({
namespaceName="namespace-0001",
description="description1",
transactionSetting=nil,
changePasswordIfTakeOver=true,
createAccountScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1001",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1002",
},
authenticationScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1003",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1004",
},
createTakeOverScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1005",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1006",
},
doTakeOverScript={
triggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1007",
doneTriggerScriptId="grn:gs2:ap-northeast-1:YourOwnerId:script:namespace-0001:script:script-1008",
},
banScript=nil,
unBanScript=nil,
logSetting={
loggingNamespaceId="grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteNamespace
Delete Namespace
Delete the specified namespace. This operation is irreversible and all data associated with the deleted Namespace will be lost.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | Namespace | The deleted Namespace |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DeleteNamespace(
&account.DeleteNamespaceRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\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("namespace-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteNamespaceRequest;
import io.gs2.account.result.DeleteNamespaceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DeleteNamespaceResult result = client.deleteNamespace(
new DeleteNamespaceRequest()
.withNamespaceName("namespace-0001")
);
Namespace item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
new Gs2.Gs2Account.Request.DeleteNamespaceRequest()
.WithNamespaceName("namespace-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.deleteNamespace(
new Gs2Account.DeleteNamespaceRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.delete_namespace(
account.DeleteNamespaceRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.delete_namespace({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.delete_namespace_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getServiceVersion
Get the microservice version
Details
Request
Request parameters: None
Result
| Type | Description | |
|---|---|---|
| item | string | Version |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.GetServiceVersion(
&account.GetServiceVersionRequest {
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetServiceVersionRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getServiceVersion(
(new GetServiceVersionRequest())
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetServiceVersionRequest;
import io.gs2.account.result.GetServiceVersionResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
GetServiceVersionResult result = client.getServiceVersion(
new GetServiceVersionRequest()
);
String item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
new Gs2.Gs2Account.Request.GetServiceVersionRequest(),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.getServiceVersion(
new Gs2Account.GetServiceVersionRequest()
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.get_service_version(
account.GetServiceVersionRequest()
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.get_service_version({
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.get_service_version_async({
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;dumpUserDataByUserId
Dump data associated with the specified user ID
Can be used to meet legal requirements for the protection of personal information, or to back up or migrate data.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description |
|---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DumpUserDataByUserId(
&account.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\Account\Gs2AccountRestClient;
use Gs2\Account\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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DumpUserDataByUserIdRequest;
import io.gs2.account.result.DumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DumpUserDataByUserIdResult result = client.dumpUserDataByUserId(
new DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
new Gs2.Gs2Account.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.dumpUserDataByUserId(
new Gs2Account.DumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.dump_user_data_by_user_id(
account.DumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)client = gs2('account')
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['errorMessage'])
end
result = api_result.resultclient = gs2('account')
api_result_handler = client.dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultcheckDumpUserDataByUserId
Check if the dump of the data associated with the specified user ID is complete
Details
Request
| Type | Condition | Required | Default | Value Limits | 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
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
&account.CheckDumpUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
url := result.Urluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.account.result.CheckDumpUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
new Gs2.Gs2Account.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.checkDumpUserDataByUserId(
new Gs2Account.CheckDumpUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
const url = result.getUrl();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.check_dump_user_data_by_user_id(
account.CheckDumpUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
url = result.url
except core.Gs2Exception as e:
exit(1)client = gs2('account')
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['errorMessage'])
end
result = api_result.result
url = result.url;client = gs2('account')
api_result_handler = client.check_dump_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
url = result.url;cleanUserDataByUserId
Delete user data
Execute cleaning of data associated with the specified user ID This allows you to safely delete specific user data from the project.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description |
|---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.CleanUserDataByUserId(
&account.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\Account\Gs2AccountRestClient;
use Gs2\Account\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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CleanUserDataByUserIdRequest;
import io.gs2.account.result.CleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
CleanUserDataByUserIdResult result = client.cleanUserDataByUserId(
new CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
new Gs2.Gs2Account.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.cleanUserDataByUserId(
new Gs2Account.CleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.clean_user_data_by_user_id(
account.CleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)client = gs2('account')
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['errorMessage'])
end
result = api_result.resultclient = gs2('account')
api_result_handler = client.clean_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultcheckCleanUserDataByUserId
Check if the cleaning of the data associated with the specified user ID is complete
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description |
|---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
&account.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\Account\Gs2AccountRestClient;
use Gs2\Account\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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.account.result.CheckCleanUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
CheckCleanUserDataByUserIdResult result = client.checkCleanUserDataByUserId(
new CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
new Gs2.Gs2Account.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.checkCleanUserDataByUserId(
new Gs2Account.CheckCleanUserDataByUserIdRequest()
.withUserId("user-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.check_clean_user_data_by_user_id(
account.CheckCleanUserDataByUserIdRequest()
.with_user_id('user-0001')
.with_time_offset_token(None)
)
except core.Gs2Exception as e:
exit(1)client = gs2('account')
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['errorMessage'])
end
result = api_result.resultclient = gs2('account')
api_result_handler = client.check_clean_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultprepareImportUserDataByUserId
Execute import of data associated with the specified user ID
The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.
You can start the actual import process by uploading the exported zip file to the URL returned in the return value of this API and calling importUserDataByUserId.
Details
Request
| Type | Condition | Required | Default | Value Limits | 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
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
&account.PrepareImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.account.result.PrepareImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
new Gs2.Gs2Account.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.prepareImportUserDataByUserId(
new Gs2Account.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 account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.prepare_import_user_data_by_user_id(
account.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('account')
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['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;client = gs2('account')
api_result_handler = client.prepare_import_user_data_by_user_id_async({
userId="user-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;importUserDataByUserId
Execute import of data associated with the specified user ID
The data that can be used for import is limited to the data exported by GS2, and old data may fail to import. You can import data with a user ID different from the one you exported, but if the user ID is included in the payload of the user data, this may not be the case.
Before calling this API, you must call prepareImportUserDataByUserId to complete the upload preparation.
Details
Request
| Type | Condition | Required | Default | Value Limits | 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 |
|---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.ImportUserDataByUserId(
&account.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\Account\Gs2AccountRestClient;
use Gs2\Account\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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.ImportUserDataByUserIdRequest;
import io.gs2.account.result.ImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
new Gs2.Gs2Account.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.importUserDataByUserId(
new Gs2Account.ImportUserDataByUserIdRequest()
.withUserId("user-0001")
.withUploadToken("upload-0001")
.withTimeOffsetToken(null)
);
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.import_user_data_by_user_id(
account.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('account')
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['errorMessage'])
end
result = api_result.resultclient = gs2('account')
api_result_handler = client.import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.resultcheckImportUserDataByUserId
Check if the import of the data associated with the specified user ID is complete
Details
Request
| Type | Condition | Required | Default | Value Limits | 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
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
&account.CheckImportUserDataByUserIdRequest {
UserId: pointy.String("user-0001"),
UploadToken: pointy.String("upload-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
url := result.Urluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CheckImportUserDataByUserIdRequest;
import io.gs2.account.result.CheckImportUserDataByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(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;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
new Gs2.Gs2Account.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.checkImportUserDataByUserId(
new Gs2Account.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 account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.check_import_user_data_by_user_id(
account.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('account')
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['errorMessage'])
end
result = api_result.result
url = result.url;client = gs2('account')
api_result_handler = client.check_import_user_data_by_user_id_async({
userId="user-0001",
uploadToken="upload-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
url = result.url;describeAccounts
Get a list of Game Player Accounts
Get a list of all Game Player Accounts in the specified namespace. The information for the Accounts retrieved includes the Account ID, status, and creation date. Supports pagination, limits the number of Accounts that can be retrieved at one time, and provides a token for the next page.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<Account> | List of Game Player Accounts |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DescribeAccounts(
&account.DescribeAccountsRequest {
NamespaceName: pointy.String("namespace-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeAccountsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeAccounts(
(new DescribeAccountsRequest())
->withNamespaceName("namespace-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeAccountsRequest;
import io.gs2.account.result.DescribeAccountsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DescribeAccountsResult result = client.describeAccounts(
new DescribeAccountsRequest()
.withNamespaceName("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
List<Account> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DescribeAccountsResult> asyncResult = null;
yield return client.DescribeAccounts(
new Gs2.Gs2Account.Request.DescribeAccountsRequest()
.WithNamespaceName("namespace-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.describeAccounts(
new Gs2Account.DescribeAccountsRequest()
.withNamespaceName("namespace-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 account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.describe_accounts(
account.DescribeAccountsRequest()
.with_namespace_name('namespace-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('account')
api_result = client.describe_accounts({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('account')
api_result_handler = client.describe_accounts_async({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createAccount
Create a new Game Player Account
This method creates a new Game Player Account. No user ID or password is required to create an Account. The user ID and password are automatically generated. When the creation is successful, the details of the newly created Account are returned as a response.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | Account | Game player Account created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.CreateAccount(
&account.CreateAccountRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateAccountRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createAccount(
(new CreateAccountRequest())
->withNamespaceName("namespace-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateAccountRequest;
import io.gs2.account.result.CreateAccountResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
CreateAccountResult result = client.createAccount(
new CreateAccountRequest()
.withNamespaceName("namespace-0001")
);
Account item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.CreateAccountResult> asyncResult = null;
yield return client.CreateAccount(
new Gs2.Gs2Account.Request.CreateAccountRequest()
.WithNamespaceName("namespace-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.createAccount(
new Gs2Account.CreateAccountRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.create_account(
account.CreateAccountRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.create_account({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.create_account_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateTimeOffset
Update the correction value for the current time of the game player’s Account
Update the correction value for the current time of the specified game player’s Account. This time correction can be used to test future event schedules in advance.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| timeOffset | int | 0 | 0 ~ 315360000 | Time offset from the current time (number of seconds relative to the current time) The time offset represents the difference from the current server time in seconds. This value is used when in-game events or features need to operate according to a specific time. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | Account | Game Player Account updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.UpdateTimeOffset(
&account.UpdateTimeOffsetRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
TimeOffset: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateTimeOffsetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateTimeOffset(
(new UpdateTimeOffsetRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-0001")
->withTimeOffset(null)
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateTimeOffsetRequest;
import io.gs2.account.result.UpdateTimeOffsetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
UpdateTimeOffsetResult result = client.updateTimeOffset(
new UpdateTimeOffsetRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withTimeOffset(null)
.withTimeOffsetToken(null)
);
Account item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.UpdateTimeOffsetResult> asyncResult = null;
yield return client.UpdateTimeOffset(
new Gs2.Gs2Account.Request.UpdateTimeOffsetRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-0001")
.WithTimeOffset(null)
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.updateTimeOffset(
new Gs2Account.UpdateTimeOffsetRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withTimeOffset(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.update_time_offset(
account.UpdateTimeOffsetRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_time_offset(None)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.update_time_offset({
namespaceName="namespace-0001",
userId="userId-0001",
timeOffset=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.update_time_offset_async({
namespaceName="namespace-0001",
userId="userId-0001",
timeOffset=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateBanned
Update on Account Ban Status of Game Player Account
This is used to update the BAN (access restriction) status of a specific Game Player Account. The Ban status of an Account can be enabled or disabled, which restricts the Account’s use in the game. Specify the Account ID and the new Ban status to update.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| banned | bool | false | Whether the Account is currently banned Indicates Whether the Account is currently banned. If true, the Account is in an access-restricted state, and if false, it is accessible. | |||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | Account | Game Player Account updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.UpdateBanned(
&account.UpdateBannedRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
Banned: pointy.Bool(true),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateBannedRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateBanned(
(new UpdateBannedRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-0001")
->withBanned(True)
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateBannedRequest;
import io.gs2.account.result.UpdateBannedResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
UpdateBannedResult result = client.updateBanned(
new UpdateBannedRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withBanned(true)
.withTimeOffsetToken(null)
);
Account item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.UpdateBannedResult> asyncResult = null;
yield return client.UpdateBanned(
new Gs2.Gs2Account.Request.UpdateBannedRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-0001")
.WithBanned(true)
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.updateBanned(
new Gs2Account.UpdateBannedRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withBanned(true)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.update_banned(
account.UpdateBannedRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_banned(True)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.update_banned({
namespaceName="namespace-0001",
userId="userId-0001",
banned=true,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.update_banned_async({
namespaceName="namespace-0001",
userId="userId-0001",
banned=true,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;addBan
Update the Account Ban Status for a Game Player Account
Used to add a new Account Ban Status to a Game Player Account. You can set temporary or permanent access restrictions for a specific Account. To add a BAN, you must specify the Account ID and the Ban status (including reason and duration).
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| banStatus | BanStatus | ✓ | Ban status | |||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | Account | Game Player Account updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.AddBan(
&account.AddBanRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
BanStatus: &account.BanStatus{
Name: pointy.String("feature1"),
Reason: pointy.String("reason"),
ReleaseTimestamp: pointy.Int64(1000000000000),
},
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\AddBanRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->addBan(
(new AddBanRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-0001")
->withBanStatus((new BanStatus())
->withName("feature1")
->withReason("reason")
->withReleaseTimestamp(1000000000000)
)
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.AddBanRequest;
import io.gs2.account.result.AddBanResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
AddBanResult result = client.addBan(
new AddBanRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withBanStatus(new BanStatus()
.withName("feature1")
.withReason("reason")
.withReleaseTimestamp(1000000000000L)
)
.withTimeOffsetToken(null)
);
Account item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.AddBanResult> asyncResult = null;
yield return client.AddBan(
new Gs2.Gs2Account.Request.AddBanRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-0001")
.WithBanStatus(new Gs2.Gs2Account.Model.BanStatus()
.WithName("feature1")
.WithReason("reason")
.WithReleaseTimestamp(1000000000000L)
)
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.addBan(
new Gs2Account.AddBanRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withBanStatus(new Gs2Account.model.BanStatus()
.withName("feature1")
.withReason("reason")
.withReleaseTimestamp(1000000000000)
)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.add_ban(
account.AddBanRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_ban_status(account.BanStatus()
.with_name('feature1')
.with_reason('reason')
.with_release_timestamp(1000000000000)
)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.add_ban({
namespaceName="namespace-0001",
userId="userId-0001",
banStatus={
name="feature1",
reason="reason",
release_timestamp=1000000000000,
},
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.add_ban_async({
namespaceName="namespace-0001",
userId="userId-0001",
banStatus={
name="feature1",
reason="reason",
release_timestamp=1000000000000,
},
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;removeBan
Delete the Account Ban Status for a Game Player Account
This is used to delete the Ban status applied to a specific Game Player Account. To delete, specify the User ID and the name of the Ban status to be deleted.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| banStatusName | string | ✓ | ~ 36 chars | Ban status name | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | Account | Game Player Account updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.RemoveBan(
&account.RemoveBanRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
BanStatusName: pointy.String("status-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\RemoveBanRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->removeBan(
(new RemoveBanRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-0001")
->withBanStatusName("status-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.RemoveBanRequest;
import io.gs2.account.result.RemoveBanResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
RemoveBanResult result = client.removeBan(
new RemoveBanRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withBanStatusName("status-0001")
.withTimeOffsetToken(null)
);
Account item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.RemoveBanResult> asyncResult = null;
yield return client.RemoveBan(
new Gs2.Gs2Account.Request.RemoveBanRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-0001")
.WithBanStatusName("status-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.removeBan(
new Gs2Account.RemoveBanRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withBanStatusName("status-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.remove_ban(
account.RemoveBanRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_ban_status_name('status-0001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.remove_ban({
namespaceName="namespace-0001",
userId="userId-0001",
banStatusName="status-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.remove_ban_async({
namespaceName="namespace-0001",
userId="userId-0001",
banStatusName="status-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getAccount
Get a Game Player Account
Get detailed information about a specific Game Player Account with the specified ID. The information retrieved includes the Account name, status, and creation date. This method is used to display detailed information about an Account.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | UUID | ~ 128 chars | User ID | |
| includeLastAuthenticatedAt | bool | false | Include last authenticated at | |||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | Account | Game Player Account |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.GetAccount(
&account.GetAccountRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
IncludeLastAuthenticatedAt: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetAccountRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getAccount(
(new GetAccountRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-0001")
->withIncludeLastAuthenticatedAt(null)
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetAccountRequest;
import io.gs2.account.result.GetAccountResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
GetAccountResult result = client.getAccount(
new GetAccountRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withIncludeLastAuthenticatedAt(null)
.withTimeOffsetToken(null)
);
Account item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.GetAccountResult> asyncResult = null;
yield return client.GetAccount(
new Gs2.Gs2Account.Request.GetAccountRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-0001")
.WithIncludeLastAuthenticatedAt(null)
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.getAccount(
new Gs2Account.GetAccountRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withIncludeLastAuthenticatedAt(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.get_account(
account.GetAccountRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_include_last_authenticated_at(None)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.get_account({
namespaceName="namespace-0001",
userId="userId-0001",
includeLastAuthenticatedAt=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.get_account_async({
namespaceName="namespace-0001",
userId="userId-0001",
includeLastAuthenticatedAt=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteAccount
Delete Game Player Account
This is used to delete a specific Game Player Account. When an Account is deleted, it can no longer be logged in with that Account, but any user data that is not managed by GS2-Account will remain in GS2. If you need to delete all user data as well, please use the user data complete deletion function accessible from the management console.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | UUID | ~ 128 chars | User ID | |
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | Account | Game Player Account deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DeleteAccount(
&account.DeleteAccountRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteAccountRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteAccount(
(new DeleteAccountRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteAccountRequest;
import io.gs2.account.result.DeleteAccountResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DeleteAccountResult result = client.deleteAccount(
new DeleteAccountRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withTimeOffsetToken(null)
);
Account item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DeleteAccountResult> asyncResult = null;
yield return client.DeleteAccount(
new Gs2.Gs2Account.Request.DeleteAccountRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.deleteAccount(
new Gs2Account.DeleteAccountRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.delete_account(
account.DeleteAccountRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.delete_account({
namespaceName="namespace-0001",
userId="userId-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.delete_account_async({
namespaceName="namespace-0001",
userId="userId-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;authentication
Authenticate Game Player Account
Used to authenticate a Game Player Account. When a user logs in to an Account, the username and password are checked. If the correct authentication information is provided, the Account information and its signature are issued. By passing this information to GS2-Auth, you can obtain an access token and access GS2’s various microservices as a user who has logged in.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024 chars | Encryption Key GRN | ||
| password | string | ✓ | ~ 128 chars | Password Stores the password for securing the account. Passwords can be up to 128 characters long and play an important role in protecting your account. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | Account | Game Player Account |
| banStatuses | List<BanStatus> | Ban status list |
| body | string | Account information for signing subject |
| signature | string | signature |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.Authentication(
&account.AuthenticationRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
KeyId: pointy.String("grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001"),
Password: pointy.String("password-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
banStatuses := result.BanStatuses
body := result.Body
signature := result.Signatureuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\AuthenticationRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->authentication(
(new AuthenticationRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withKeyId("grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001")
->withPassword("password-0001")
->withTimeOffsetToken(null)
);
$item = $result->getItem();
$banStatuses = $result->getBanStatuses();
$body = $result->getBody();
$signature = $result->getSignature();
} 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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.AuthenticationRequest;
import io.gs2.account.result.AuthenticationResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
AuthenticationResult result = client.authentication(
new AuthenticationRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withKeyId("grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001")
.withPassword("password-0001")
.withTimeOffsetToken(null)
);
Account item = result.getItem();
List<BanStatus> banStatuses = result.getBanStatuses();
String body = result.getBody();
String signature = result.getSignature();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.AuthenticationResult> asyncResult = null;
yield return client.Authentication(
new Gs2.Gs2Account.Request.AuthenticationRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithKeyId("grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001")
.WithPassword("password-0001")
.WithTimeOffsetToken(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var banStatuses = result.BanStatuses;
var body = result.Body;
var signature = result.Signature;import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.authentication(
new Gs2Account.AuthenticationRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withKeyId("grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001")
.withPassword("password-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
const banStatuses = result.getBanStatuses();
const body = result.getBody();
const signature = result.getSignature();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.authentication(
account.AuthenticationRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_key_id('grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001')
.with_password('password-0001')
.with_time_offset_token(None)
)
item = result.item
ban_statuses = result.ban_statuses
body = result.body
signature = result.signature
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.authentication({
namespaceName="namespace-0001",
userId="user-0001",
keyId="grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001",
password="password-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
banStatuses = result.banStatuses;
body = result.body;
signature = result.signature;client = gs2('account')
api_result_handler = client.authentication_async({
namespaceName="namespace-0001",
userId="user-0001",
keyId="grn:gs2:ap-northeast-1:owner_id:key:namespace-0001:key:key-0001",
password="password-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;
banStatuses = result.banStatuses;
body = result.body;
signature = result.signature;describeTakeOvers
Get a list of Takeover Information
Retrieves a list of Takeover Information registered for the currently logged-in Game Player Account. Takeover Information is used to transfer account data when changing devices or reinstalling the game. Supports pagination, allowing you to retrieve a limited number of records at a time and use a token to fetch the next page.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<TakeOver> | List of Takeover Setting |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DescribeTakeOvers(
&account.DescribeTakeOversRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeTakeOversRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeTakeOvers(
(new DescribeTakeOversRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeTakeOversRequest;
import io.gs2.account.result.DescribeTakeOversResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DescribeTakeOversResult result = client.describeTakeOvers(
new DescribeTakeOversRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
List<TakeOver> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DescribeTakeOversResult> asyncResult = null;
yield return client.DescribeTakeOvers(
new Gs2.Gs2Account.Request.DescribeTakeOversRequest()
.WithNamespaceName("namespace-0001")
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.describeTakeOvers(
new Gs2Account.DescribeTakeOversRequest()
.withNamespaceName("namespace-0001")
.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 account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.describe_take_overs(
account.DescribeTakeOversRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-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('account')
api_result = client.describe_take_overs({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('account')
api_result_handler = client.describe_take_overs_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;describeTakeOversByUserId
Get a list of Takeover Information by specifying a user ID
Retrieves a list of Takeover Information registered for the specified Game Player Account. Takeover Information is used to transfer account data when changing devices or reinstalling the game. Supports pagination, allowing you to retrieve a limited number of records at a time and use a token to fetch the next page.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| 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 items to retrieve | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<TakeOver> | List of Takeover Setting |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DescribeTakeOversByUserId(
&account.DescribeTakeOversByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeTakeOversByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeTakeOversByUserId(
(new DescribeTakeOversByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-0001")
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeTakeOversByUserIdRequest;
import io.gs2.account.result.DescribeTakeOversByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DescribeTakeOversByUserIdResult result = client.describeTakeOversByUserId(
new DescribeTakeOversByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<TakeOver> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DescribeTakeOversByUserIdResult> asyncResult = null;
yield return client.DescribeTakeOversByUserId(
new Gs2.Gs2Account.Request.DescribeTakeOversByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-0001")
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.describeTakeOversByUserId(
new Gs2Account.DescribeTakeOversByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.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 account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.describe_take_overs_by_user_id(
account.DescribeTakeOversByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.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('account')
api_result = client.describe_take_overs_by_user_id({
namespaceName="namespace-0001",
userId="userId-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('account')
api_result_handler = client.describe_take_overs_by_user_id_async({
namespaceName="namespace-0001",
userId="userId-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createTakeOver
Create a new Takeover Information
Registers new Takeover Information for the currently logged-in Game Player Account. The caller must specify a type slot (numeric), a user identifier (e.g., email address), and a password. The registered information can later be used to recover the account on a different device by providing the same user identifier and password.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. | ||
| userIdentifier | string | ✓ | ~ 1024 chars | User ID for takeover A unique key used to identify an individual when taking over an account. If the same userIdentifier is specified for different accounts, the value set later will take precedence. | ||
| password | string | ✓ | ~ 128 chars | Password For security reasons, this password is treated as confidential information and only the hash value is stored. |
Result
| Type | Description | |
|---|---|---|
| item | TakeOver | Takeover Information created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.CreateTakeOver(
&account.CreateTakeOverRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
Type: pointy.Int32(0),
UserIdentifier: pointy.String("user-0001@gs2.io"),
Password: pointy.String("password-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateTakeOverRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createTakeOver(
(new CreateTakeOverRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withType(0)
->withUserIdentifier("user-0001@gs2.io")
->withPassword("password-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateTakeOverRequest;
import io.gs2.account.result.CreateTakeOverResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
CreateTakeOverResult result = client.createTakeOver(
new CreateTakeOverRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
.withUserIdentifier("user-0001@gs2.io")
.withPassword("password-0001")
);
TakeOver item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.CreateTakeOverResult> asyncResult = null;
yield return client.CreateTakeOver(
new Gs2.Gs2Account.Request.CreateTakeOverRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithType(0)
.WithUserIdentifier("user-0001@gs2.io")
.WithPassword("password-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.createTakeOver(
new Gs2Account.CreateTakeOverRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
.withUserIdentifier("user-0001@gs2.io")
.withPassword("password-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.create_take_over(
account.CreateTakeOverRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_type(0)
.with_user_identifier('user-0001@gs2.io')
.with_password('password-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.create_take_over({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
userIdentifier="user-0001@gs2.io",
password="password-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.create_take_over_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
userIdentifier="user-0001@gs2.io",
password="password-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;createTakeOverByUserId
Create a new Takeover Information by specifying a user ID
Registers new Takeover Information for the specified Game Player Account. The caller must specify a type slot (numeric), a user identifier (e.g., email address), and a password. The registered information can later be used to recover the account on a different device by providing the same user identifier and password.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. | ||
| userIdentifier | string | ✓ | ~ 1024 chars | User ID for takeover A unique key used to identify an individual when taking over an account. If the same userIdentifier is specified for different accounts, the value set later will take precedence. | ||
| password | string | ✓ | ~ 128 chars | Password For security reasons, this password is treated as confidential information and only the hash value is stored. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | TakeOver | Takeover Information created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.CreateTakeOverByUserId(
&account.CreateTakeOverByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
Type: pointy.Int32(0),
UserIdentifier: pointy.String("user-0001@gs2.io"),
Password: pointy.String("password-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateTakeOverByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createTakeOverByUserId(
(new CreateTakeOverByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-0001")
->withType(0)
->withUserIdentifier("user-0001@gs2.io")
->withPassword("password-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateTakeOverByUserIdRequest;
import io.gs2.account.result.CreateTakeOverByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
CreateTakeOverByUserIdResult result = client.createTakeOverByUserId(
new CreateTakeOverByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withType(0)
.withUserIdentifier("user-0001@gs2.io")
.withPassword("password-0001")
.withTimeOffsetToken(null)
);
TakeOver item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.CreateTakeOverByUserIdResult> asyncResult = null;
yield return client.CreateTakeOverByUserId(
new Gs2.Gs2Account.Request.CreateTakeOverByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-0001")
.WithType(0)
.WithUserIdentifier("user-0001@gs2.io")
.WithPassword("password-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.createTakeOverByUserId(
new Gs2Account.CreateTakeOverByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withType(0)
.withUserIdentifier("user-0001@gs2.io")
.withPassword("password-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.create_take_over_by_user_id(
account.CreateTakeOverByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_type(0)
.with_user_identifier('user-0001@gs2.io')
.with_password('password-0001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.create_take_over_by_user_id({
namespaceName="namespace-0001",
userId="userId-0001",
type=0,
userIdentifier="user-0001@gs2.io",
password="password-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.create_take_over_by_user_id_async({
namespaceName="namespace-0001",
userId="userId-0001",
type=0,
userIdentifier="user-0001@gs2.io",
password="password-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;createTakeOverOpenIdConnect
Create a new Takeover Information using OpenID Connect
Registers new Takeover Information for the currently logged-in Game Player Account using an OpenID Connect ID Token. Instead of a password, the caller provides an ID Token obtained from an identity provider (e.g., Google, Apple). The subject (user identifier) is automatically extracted from the ID Token and associated with the account. The corresponding Takeover Type Model must have an OpenID Connect setting configured in advance.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. | ||
| idToken | string | ✓ | ~ 10240 chars | OpenID Connect ID Token |
Result
| Type | Description | |
|---|---|---|
| item | TakeOver | Takeover Information created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.CreateTakeOverOpenIdConnect(
&account.CreateTakeOverOpenIdConnectRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
Type: pointy.Int32(0),
IdToken: pointy.String("0123456789"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateTakeOverOpenIdConnectRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createTakeOverOpenIdConnect(
(new CreateTakeOverOpenIdConnectRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withType(0)
->withIdToken("0123456789")
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateTakeOverOpenIdConnectRequest;
import io.gs2.account.result.CreateTakeOverOpenIdConnectResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
CreateTakeOverOpenIdConnectResult result = client.createTakeOverOpenIdConnect(
new CreateTakeOverOpenIdConnectRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
.withIdToken("0123456789")
);
TakeOver item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.CreateTakeOverOpenIdConnectResult> asyncResult = null;
yield return client.CreateTakeOverOpenIdConnect(
new Gs2.Gs2Account.Request.CreateTakeOverOpenIdConnectRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithType(0)
.WithIdToken("0123456789"),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.createTakeOverOpenIdConnect(
new Gs2Account.CreateTakeOverOpenIdConnectRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
.withIdToken("0123456789")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.create_take_over_open_id_connect(
account.CreateTakeOverOpenIdConnectRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_type(0)
.with_id_token('0123456789')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.create_take_over_open_id_connect({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
idToken="0123456789",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.create_take_over_open_id_connect_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
idToken="0123456789",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;createTakeOverOpenIdConnectAndByUserId
Create a new Takeover Information using OpenID Connect by specifying a user ID
Registers new Takeover Information for the specified Game Player Account using an OpenID Connect ID Token. Instead of a password, the caller provides an ID Token obtained from an identity provider (e.g., Google, Apple). The subject (user identifier) is automatically extracted from the ID Token and associated with the account. The corresponding Takeover Type Model must have an OpenID Connect setting configured in advance.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. | ||
| idToken | string | ✓ | ~ 10240 chars | OpenID Connect ID Token | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | TakeOver | Takeover Information created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.CreateTakeOverOpenIdConnectAndByUserId(
&account.CreateTakeOverOpenIdConnectAndByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
Type: pointy.Int32(0),
IdToken: pointy.String("0123456789"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateTakeOverOpenIdConnectAndByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createTakeOverOpenIdConnectAndByUserId(
(new CreateTakeOverOpenIdConnectAndByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-0001")
->withType(0)
->withIdToken("0123456789")
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateTakeOverOpenIdConnectAndByUserIdRequest;
import io.gs2.account.result.CreateTakeOverOpenIdConnectAndByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
CreateTakeOverOpenIdConnectAndByUserIdResult result = client.createTakeOverOpenIdConnectAndByUserId(
new CreateTakeOverOpenIdConnectAndByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withType(0)
.withIdToken("0123456789")
.withTimeOffsetToken(null)
);
TakeOver item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.CreateTakeOverOpenIdConnectAndByUserIdResult> asyncResult = null;
yield return client.CreateTakeOverOpenIdConnectAndByUserId(
new Gs2.Gs2Account.Request.CreateTakeOverOpenIdConnectAndByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-0001")
.WithType(0)
.WithIdToken("0123456789")
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.createTakeOverOpenIdConnectAndByUserId(
new Gs2Account.CreateTakeOverOpenIdConnectAndByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withType(0)
.withIdToken("0123456789")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.create_take_over_open_id_connect_and_by_user_id(
account.CreateTakeOverOpenIdConnectAndByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_type(0)
.with_id_token('0123456789')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.create_take_over_open_id_connect_and_by_user_id({
namespaceName="namespace-0001",
userId="userId-0001",
type=0,
idToken="0123456789",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.create_take_over_open_id_connect_and_by_user_id_async({
namespaceName="namespace-0001",
userId="userId-0001",
type=0,
idToken="0123456789",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getTakeOver
Get Takeover Information
Retrieves the Takeover Information of the specified type registered for the currently logged-in Game Player Account. The retrieved information includes the type slot, user identifier, and creation date.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. |
Result
| Type | Description | |
|---|---|---|
| item | TakeOver | Takeover Information |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.GetTakeOver(
&account.GetTakeOverRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
Type: pointy.Int32(0),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetTakeOverRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getTakeOver(
(new GetTakeOverRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withType(0)
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetTakeOverRequest;
import io.gs2.account.result.GetTakeOverResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
GetTakeOverResult result = client.getTakeOver(
new GetTakeOverRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
);
TakeOver item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.GetTakeOverResult> asyncResult = null;
yield return client.GetTakeOver(
new Gs2.Gs2Account.Request.GetTakeOverRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithType(0),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.getTakeOver(
new Gs2Account.GetTakeOverRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.get_take_over(
account.GetTakeOverRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_type(0)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.get_take_over({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.get_take_over_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getTakeOverByUserId
Get Takeover Information by specifying a user ID
Retrieves the Takeover Information of the specified type registered for the specified Game Player Account. The retrieved information includes the type slot, user identifier, and creation date.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | TakeOver | Takeover Information |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.GetTakeOverByUserId(
&account.GetTakeOverByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
Type: pointy.Int32(0),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetTakeOverByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getTakeOverByUserId(
(new GetTakeOverByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-0001")
->withType(0)
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetTakeOverByUserIdRequest;
import io.gs2.account.result.GetTakeOverByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
GetTakeOverByUserIdResult result = client.getTakeOverByUserId(
new GetTakeOverByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withType(0)
.withTimeOffsetToken(null)
);
TakeOver item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.GetTakeOverByUserIdResult> asyncResult = null;
yield return client.GetTakeOverByUserId(
new Gs2.Gs2Account.Request.GetTakeOverByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-0001")
.WithType(0)
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.getTakeOverByUserId(
new Gs2Account.GetTakeOverByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withType(0)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.get_take_over_by_user_id(
account.GetTakeOverByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_type(0)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.get_take_over_by_user_id({
namespaceName="namespace-0001",
userId="userId-0001",
type=0,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.get_take_over_by_user_id_async({
namespaceName="namespace-0001",
userId="userId-0001",
type=0,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateTakeOver
Update Takeover Information
Updates the password of the Takeover Information of the specified type for the currently logged-in Game Player Account. The old password must be provided for verification before the new password can be set. If the old password does not match, a PasswordIncorrect error is returned.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. | ||
| oldPassword | string | ✓ | ~ 128 chars | Old Password | ||
| password | string | ✓ | ~ 128 chars | Password For security reasons, this password is treated as confidential information and only the hash value is stored. |
Result
| Type | Description | |
|---|---|---|
| item | TakeOver | Takeover Information updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.UpdateTakeOver(
&account.UpdateTakeOverRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
Type: pointy.Int32(0),
OldPassword: pointy.String("password-0001"),
Password: pointy.String("password-1001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateTakeOverRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateTakeOver(
(new UpdateTakeOverRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withType(0)
->withOldPassword("password-0001")
->withPassword("password-1001")
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateTakeOverRequest;
import io.gs2.account.result.UpdateTakeOverResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
UpdateTakeOverResult result = client.updateTakeOver(
new UpdateTakeOverRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
.withOldPassword("password-0001")
.withPassword("password-1001")
);
TakeOver item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.UpdateTakeOverResult> asyncResult = null;
yield return client.UpdateTakeOver(
new Gs2.Gs2Account.Request.UpdateTakeOverRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithType(0)
.WithOldPassword("password-0001")
.WithPassword("password-1001"),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.updateTakeOver(
new Gs2Account.UpdateTakeOverRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
.withOldPassword("password-0001")
.withPassword("password-1001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.update_take_over(
account.UpdateTakeOverRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_type(0)
.with_old_password('password-0001')
.with_password('password-1001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.update_take_over({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
oldPassword="password-0001",
password="password-1001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.update_take_over_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
oldPassword="password-0001",
password="password-1001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateTakeOverByUserId
Update Takeover Information by specifying a user ID
Updates the password of the Takeover Information of the specified type for the specified Game Player Account. The old password must be provided for verification before the new password can be set. If the old password does not match, a PasswordIncorrect error is returned.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. | ||
| oldPassword | string | ✓ | ~ 128 chars | Old Password | ||
| password | string | ✓ | ~ 128 chars | Password For security reasons, this password is treated as confidential information and only the hash value is stored. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | TakeOver | Takeover Information updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.UpdateTakeOverByUserId(
&account.UpdateTakeOverByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
Type: pointy.Int32(0),
OldPassword: pointy.String("password-0001"),
Password: pointy.String("password-0002"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateTakeOverByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateTakeOverByUserId(
(new UpdateTakeOverByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-0001")
->withType(0)
->withOldPassword("password-0001")
->withPassword("password-0002")
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateTakeOverByUserIdRequest;
import io.gs2.account.result.UpdateTakeOverByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
UpdateTakeOverByUserIdResult result = client.updateTakeOverByUserId(
new UpdateTakeOverByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withType(0)
.withOldPassword("password-0001")
.withPassword("password-0002")
.withTimeOffsetToken(null)
);
TakeOver item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.UpdateTakeOverByUserIdResult> asyncResult = null;
yield return client.UpdateTakeOverByUserId(
new Gs2.Gs2Account.Request.UpdateTakeOverByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-0001")
.WithType(0)
.WithOldPassword("password-0001")
.WithPassword("password-0002")
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.updateTakeOverByUserId(
new Gs2Account.UpdateTakeOverByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withType(0)
.withOldPassword("password-0001")
.withPassword("password-0002")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.update_take_over_by_user_id(
account.UpdateTakeOverByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_type(0)
.with_old_password('password-0001')
.with_password('password-0002')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.update_take_over_by_user_id({
namespaceName="namespace-0001",
userId="userId-0001",
type=0,
oldPassword="password-0001",
password="password-0002",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.update_take_over_by_user_id_async({
namespaceName="namespace-0001",
userId="userId-0001",
type=0,
oldPassword="password-0001",
password="password-0002",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteTakeOver
Delete Takeover Information
Deletes the Takeover Information of the specified type from the currently logged-in Game Player Account. Once deleted, the account can no longer be recovered using the user identifier and password of the deleted Takeover Information.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. |
Result
| Type | Description | |
|---|---|---|
| item | TakeOver | Takeover Information deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DeleteTakeOver(
&account.DeleteTakeOverRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
Type: pointy.Int32(0),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteTakeOverRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteTakeOver(
(new DeleteTakeOverRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withType(0)
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteTakeOverRequest;
import io.gs2.account.result.DeleteTakeOverResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DeleteTakeOverResult result = client.deleteTakeOver(
new DeleteTakeOverRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
);
TakeOver item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DeleteTakeOverResult> asyncResult = null;
yield return client.DeleteTakeOver(
new Gs2.Gs2Account.Request.DeleteTakeOverRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithType(0),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.deleteTakeOver(
new Gs2Account.DeleteTakeOverRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.delete_take_over(
account.DeleteTakeOverRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_type(0)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.delete_take_over({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.delete_take_over_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteTakeOverByUserIdentifier
Delete Takeover Information by specifying user Identifier
Deletes the Takeover Information by looking it up using the platform-side user identifier instead of the GS2 user ID. This is useful when you know the external user identifier (e.g., email address) but not the internal GS2 user ID. Once deleted, the account can no longer be recovered using the user identifier and password of the deleted Takeover Information.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. | ||
| userIdentifier | string | ~ 1024 chars | User ID for takeover |
Result
| Type | Description | |
|---|---|---|
| item | TakeOver | Takeover Information deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DeleteTakeOverByUserIdentifier(
&account.DeleteTakeOverByUserIdentifierRequest {
NamespaceName: pointy.String("namespace-0001"),
Type: pointy.Int32(0),
UserIdentifier: pointy.String("user-0001@gs2.io"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteTakeOverByUserIdentifierRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteTakeOverByUserIdentifier(
(new DeleteTakeOverByUserIdentifierRequest())
->withNamespaceName("namespace-0001")
->withType(0)
->withUserIdentifier("user-0001@gs2.io")
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteTakeOverByUserIdentifierRequest;
import io.gs2.account.result.DeleteTakeOverByUserIdentifierResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DeleteTakeOverByUserIdentifierResult result = client.deleteTakeOverByUserIdentifier(
new DeleteTakeOverByUserIdentifierRequest()
.withNamespaceName("namespace-0001")
.withType(0)
.withUserIdentifier("user-0001@gs2.io")
);
TakeOver item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DeleteTakeOverByUserIdentifierResult> asyncResult = null;
yield return client.DeleteTakeOverByUserIdentifier(
new Gs2.Gs2Account.Request.DeleteTakeOverByUserIdentifierRequest()
.WithNamespaceName("namespace-0001")
.WithType(0)
.WithUserIdentifier("user-0001@gs2.io"),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.deleteTakeOverByUserIdentifier(
new Gs2Account.DeleteTakeOverByUserIdentifierRequest()
.withNamespaceName("namespace-0001")
.withType(0)
.withUserIdentifier("user-0001@gs2.io")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.delete_take_over_by_user_identifier(
account.DeleteTakeOverByUserIdentifierRequest()
.with_namespace_name('namespace-0001')
.with_type(0)
.with_user_identifier('user-0001@gs2.io')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.delete_take_over_by_user_identifier({
namespaceName="namespace-0001",
type=0,
userIdentifier="user-0001@gs2.io",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.delete_take_over_by_user_identifier_async({
namespaceName="namespace-0001",
type=0,
userIdentifier="user-0001@gs2.io",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteTakeOverByUserId
Delete Takeover Information by specifying a user ID
Deletes the Takeover Information of the specified type from the specified Game Player Account using the GS2 user ID. Once deleted, the account can no longer be recovered using the user identifier and password of the deleted Takeover Information.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | TakeOver | Takeover Information deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DeleteTakeOverByUserId(
&account.DeleteTakeOverByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
Type: pointy.Int32(0),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteTakeOverByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteTakeOverByUserId(
(new DeleteTakeOverByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-0001")
->withType(0)
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteTakeOverByUserIdRequest;
import io.gs2.account.result.DeleteTakeOverByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DeleteTakeOverByUserIdResult result = client.deleteTakeOverByUserId(
new DeleteTakeOverByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withType(0)
.withTimeOffsetToken(null)
);
TakeOver item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DeleteTakeOverByUserIdResult> asyncResult = null;
yield return client.DeleteTakeOverByUserId(
new Gs2.Gs2Account.Request.DeleteTakeOverByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-0001")
.WithType(0)
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.deleteTakeOverByUserId(
new Gs2Account.DeleteTakeOverByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withType(0)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.delete_take_over_by_user_id(
account.DeleteTakeOverByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_type(0)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.delete_take_over_by_user_id({
namespaceName="namespace-0001",
userId="userId-0001",
type=0,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.delete_take_over_by_user_id_async({
namespaceName="namespace-0001",
userId="userId-0001",
type=0,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;doTakeOver
Execute Account Takeover
Executes the account takeover (recovery) process using a user identifier and password. This is used when a user wants to recover their account on a new device or after reinstalling the game. If the user identifier and password match a registered Takeover Information, the associated Game Player Account is returned. If the password does not match, a PasswordIncorrect error is returned.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. | ||
| userIdentifier | string | ✓ | ~ 1024 chars | User ID for takeover A unique key used to identify an individual when taking over an account. If the same userIdentifier is specified for different accounts, the value set later will take precedence. | ||
| password | string | ✓ | ~ 128 chars | Password For security reasons, this password is treated as confidential information and only the hash value is stored. |
Result
| Type | Description | |
|---|---|---|
| item | Account | Game Player Account |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DoTakeOver(
&account.DoTakeOverRequest {
NamespaceName: pointy.String("namespace-0001"),
Type: pointy.Int32(0),
UserIdentifier: pointy.String("user-0001@gs2.io"),
Password: pointy.String("password-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DoTakeOverRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->doTakeOver(
(new DoTakeOverRequest())
->withNamespaceName("namespace-0001")
->withType(0)
->withUserIdentifier("user-0001@gs2.io")
->withPassword("password-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DoTakeOverRequest;
import io.gs2.account.result.DoTakeOverResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DoTakeOverResult result = client.doTakeOver(
new DoTakeOverRequest()
.withNamespaceName("namespace-0001")
.withType(0)
.withUserIdentifier("user-0001@gs2.io")
.withPassword("password-0001")
);
Account item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DoTakeOverResult> asyncResult = null;
yield return client.DoTakeOver(
new Gs2.Gs2Account.Request.DoTakeOverRequest()
.WithNamespaceName("namespace-0001")
.WithType(0)
.WithUserIdentifier("user-0001@gs2.io")
.WithPassword("password-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.doTakeOver(
new Gs2Account.DoTakeOverRequest()
.withNamespaceName("namespace-0001")
.withType(0)
.withUserIdentifier("user-0001@gs2.io")
.withPassword("password-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.do_take_over(
account.DoTakeOverRequest()
.with_namespace_name('namespace-0001')
.with_type(0)
.with_user_identifier('user-0001@gs2.io')
.with_password('password-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.do_take_over({
namespaceName="namespace-0001",
type=0,
userIdentifier="user-0001@gs2.io",
password="password-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.do_take_over_async({
namespaceName="namespace-0001",
type=0,
userIdentifier="user-0001@gs2.io",
password="password-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;doTakeOverOpenIdConnect
Execute Account Takeover using OpenID Connect
Executes the account takeover (recovery) process using an OpenID Connect ID Token. This is the OIDC variant of the takeover execution, where the caller provides an ID Token from an identity provider (e.g., Google, Apple) instead of a password. The ID Token is validated and the subject is used to look up the associated Game Player Account. The corresponding Takeover Type Model must have an OpenID Connect setting configured in advance.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. | ||
| idToken | string | ✓ | ~ 10240 chars | OpenID Connect ID Token |
Result
| Type | Description | |
|---|---|---|
| item | Account | Game Player Account |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DoTakeOverOpenIdConnect(
&account.DoTakeOverOpenIdConnectRequest {
NamespaceName: pointy.String("namespace-0001"),
Type: nil,
IdToken: pointy.String("0123456789"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DoTakeOverOpenIdConnectRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->doTakeOverOpenIdConnect(
(new DoTakeOverOpenIdConnectRequest())
->withNamespaceName("namespace-0001")
->withType(null)
->withIdToken("0123456789")
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DoTakeOverOpenIdConnectRequest;
import io.gs2.account.result.DoTakeOverOpenIdConnectResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DoTakeOverOpenIdConnectResult result = client.doTakeOverOpenIdConnect(
new DoTakeOverOpenIdConnectRequest()
.withNamespaceName("namespace-0001")
.withType(null)
.withIdToken("0123456789")
);
Account item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DoTakeOverOpenIdConnectResult> asyncResult = null;
yield return client.DoTakeOverOpenIdConnect(
new Gs2.Gs2Account.Request.DoTakeOverOpenIdConnectRequest()
.WithNamespaceName("namespace-0001")
.WithType(null)
.WithIdToken("0123456789"),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.doTakeOverOpenIdConnect(
new Gs2Account.DoTakeOverOpenIdConnectRequest()
.withNamespaceName("namespace-0001")
.withType(null)
.withIdToken("0123456789")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.do_take_over_open_id_connect(
account.DoTakeOverOpenIdConnectRequest()
.with_namespace_name('namespace-0001')
.with_type(None)
.with_id_token('0123456789')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.do_take_over_open_id_connect({
namespaceName="namespace-0001",
type=nil,
idToken="0123456789",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.do_take_over_open_id_connect_async({
namespaceName="namespace-0001",
type=nil,
idToken="0123456789",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getAuthorizationUrl
Get authorization URL
Returns the authorization URL for the OpenID Connect flow of the specified takeover type. The client can use this URL to redirect the user to the identity provider’s authorization page. This is the entry point for initiating the OAuth/OIDC authorization flow for account takeover.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different Takeover Information. |
Result
| Type | Description | |
|---|---|---|
| authorizationUrl | string | Authorization URL |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.GetAuthorizationUrl(
&account.GetAuthorizationUrlRequest {
NamespaceName: pointy.String("namespace-0001"),
Type: pointy.Int32(0),
}
)
if err != nil {
panic("error occurred")
}
authorizationUrl := result.AuthorizationUrluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetAuthorizationUrlRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getAuthorizationUrl(
(new GetAuthorizationUrlRequest())
->withNamespaceName("namespace-0001")
->withType(0)
);
$authorizationUrl = $result->getAuthorizationUrl();
} 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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetAuthorizationUrlRequest;
import io.gs2.account.result.GetAuthorizationUrlResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
GetAuthorizationUrlResult result = client.getAuthorizationUrl(
new GetAuthorizationUrlRequest()
.withNamespaceName("namespace-0001")
.withType(0)
);
String authorizationUrl = result.getAuthorizationUrl();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.GetAuthorizationUrlResult> asyncResult = null;
yield return client.GetAuthorizationUrl(
new Gs2.Gs2Account.Request.GetAuthorizationUrlRequest()
.WithNamespaceName("namespace-0001")
.WithType(0),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var authorizationUrl = result.AuthorizationUrl;import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.getAuthorizationUrl(
new Gs2Account.GetAuthorizationUrlRequest()
.withNamespaceName("namespace-0001")
.withType(0)
);
const authorizationUrl = result.getAuthorizationUrl();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.get_authorization_url(
account.GetAuthorizationUrlRequest()
.with_namespace_name('namespace-0001')
.with_type(0)
)
authorization_url = result.authorization_url
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.get_authorization_url({
namespaceName="namespace-0001",
type=0,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
authorizationUrl = result.authorizationUrl;client = gs2('account')
api_result_handler = client.get_authorization_url_async({
namespaceName="namespace-0001",
type=0,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
authorizationUrl = result.authorizationUrl;describePlatformIds
Get a list of Platform IDs
The Platform ID is information used to hold IDs for various platforms such as X, Instagram, and Facebook.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<PlatformId> | List of Platform IDs |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DescribePlatformIds(
&account.DescribePlatformIdsRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribePlatformIdsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describePlatformIds(
(new DescribePlatformIdsRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribePlatformIdsRequest;
import io.gs2.account.result.DescribePlatformIdsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DescribePlatformIdsResult result = client.describePlatformIds(
new DescribePlatformIdsRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withPageToken(null)
.withLimit(null)
);
List<PlatformId> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DescribePlatformIdsResult> asyncResult = null;
yield return client.DescribePlatformIds(
new Gs2.Gs2Account.Request.DescribePlatformIdsRequest()
.WithNamespaceName("namespace-0001")
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.describePlatformIds(
new Gs2Account.DescribePlatformIdsRequest()
.withNamespaceName("namespace-0001")
.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 account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.describe_platform_ids(
account.DescribePlatformIdsRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-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('account')
api_result = client.describe_platform_ids({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('account')
api_result_handler = client.describe_platform_ids_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;describePlatformIdsByUserId
Get a list of Platform IDs by specifying GS2-Account user ID
Platform ID is information used to hold IDs for various platforms such as X, Instagram, and Facebook.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| 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 items to retrieve | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| items | List<PlatformId> | List of Platform IDs |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DescribePlatformIdsByUserId(
&account.DescribePlatformIdsByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
PageToken: nil,
Limit: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribePlatformIdsByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describePlatformIdsByUserId(
(new DescribePlatformIdsByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribePlatformIdsByUserIdRequest;
import io.gs2.account.result.DescribePlatformIdsByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DescribePlatformIdsByUserIdResult result = client.describePlatformIdsByUserId(
new DescribePlatformIdsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withPageToken(null)
.withLimit(null)
.withTimeOffsetToken(null)
);
List<PlatformId> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DescribePlatformIdsByUserIdResult> asyncResult = null;
yield return client.DescribePlatformIdsByUserId(
new Gs2.Gs2Account.Request.DescribePlatformIdsByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.describePlatformIdsByUserId(
new Gs2Account.DescribePlatformIdsByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.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 account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.describe_platform_ids_by_user_id(
account.DescribePlatformIdsByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.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('account')
api_result = client.describe_platform_ids_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('account')
api_result_handler = client.describe_platform_ids_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
pageToken=nil,
limit=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createPlatformId
Create a new Platform ID
Platform ID is information used to hold IDs for various platforms such as X, Instagram, and Facebook.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token The GS2-Account user ID that this platform ID is linked to. Used to map between external platform identities and GS2 anonymous accounts. | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified within the range from 0 to 1024, it is used to identify the type of platform. | ||
| userIdentifier | string | ✓ | ~ 1024 chars | User ID on various platforms The user’s unique identifier on the external platform (e.g., social media user ID or email address). Used together with the slot number (type) to identify a specific platform account. |
Result
| Type | Description | |
|---|---|---|
| item | PlatformId | Platform ID created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.CreatePlatformId(
&account.CreatePlatformIdRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
Type: pointy.Int32(0),
UserIdentifier: pointy.String("123456"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreatePlatformIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createPlatformId(
(new CreatePlatformIdRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withType(0)
->withUserIdentifier("123456")
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreatePlatformIdRequest;
import io.gs2.account.result.CreatePlatformIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
CreatePlatformIdResult result = client.createPlatformId(
new CreatePlatformIdRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
.withUserIdentifier("123456")
);
PlatformId item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.CreatePlatformIdResult> asyncResult = null;
yield return client.CreatePlatformId(
new Gs2.Gs2Account.Request.CreatePlatformIdRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithType(0)
.WithUserIdentifier("123456"),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.createPlatformId(
new Gs2Account.CreatePlatformIdRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
.withUserIdentifier("123456")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.create_platform_id(
account.CreatePlatformIdRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_type(0)
.with_user_identifier('123456')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.create_platform_id({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
userIdentifier="123456",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.create_platform_id_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
userIdentifier="123456",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;createPlatformIdByUserId
Create a new Platform ID by specifying GS2-Account user ID
Platform ID is information used to hold IDs for various platforms such as X, Instagram, and Facebook.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | GS2-Account User ID The GS2-Account user ID that this platform ID is linked to. Used to map between external platform identities and GS2 anonymous accounts. | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified within the range from 0 to 1024, it is used to identify the type of platform. | ||
| userIdentifier | string | ✓ | ~ 1024 chars | User ID on various platforms The user’s unique identifier on the external platform (e.g., social media user ID or email address). Used together with the slot number (type) to identify a specific platform account. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | PlatformId | Platform ID created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.CreatePlatformIdByUserId(
&account.CreatePlatformIdByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
Type: pointy.Int32(0),
UserIdentifier: pointy.String("123456789"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreatePlatformIdByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createPlatformIdByUserId(
(new CreatePlatformIdByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-0001")
->withType(0)
->withUserIdentifier("123456789")
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreatePlatformIdByUserIdRequest;
import io.gs2.account.result.CreatePlatformIdByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
CreatePlatformIdByUserIdResult result = client.createPlatformIdByUserId(
new CreatePlatformIdByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withType(0)
.withUserIdentifier("123456789")
.withTimeOffsetToken(null)
);
PlatformId item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.CreatePlatformIdByUserIdResult> asyncResult = null;
yield return client.CreatePlatformIdByUserId(
new Gs2.Gs2Account.Request.CreatePlatformIdByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-0001")
.WithType(0)
.WithUserIdentifier("123456789")
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.createPlatformIdByUserId(
new Gs2Account.CreatePlatformIdByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withType(0)
.withUserIdentifier("123456789")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.create_platform_id_by_user_id(
account.CreatePlatformIdByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_type(0)
.with_user_identifier('123456789')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.create_platform_id_by_user_id({
namespaceName="namespace-0001",
userId="userId-0001",
type=0,
userIdentifier="123456789",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.create_platform_id_by_user_id_async({
namespaceName="namespace-0001",
userId="userId-0001",
type=0,
userIdentifier="123456789",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getPlatformId
Get Platform ID
The Platform ID is information used to hold IDs for various platforms such as X, Instagram, and Facebook.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token The GS2-Account user ID that this platform ID is linked to. Used to map between external platform identities and GS2 anonymous accounts. | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified within the range from 0 to 1024, it is used to identify the type of platform. |
Result
| Type | Description | |
|---|---|---|
| item | PlatformId | Platform ID |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.GetPlatformId(
&account.GetPlatformIdRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
Type: pointy.Int32(0),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetPlatformIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getPlatformId(
(new GetPlatformIdRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withType(0)
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetPlatformIdRequest;
import io.gs2.account.result.GetPlatformIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
GetPlatformIdResult result = client.getPlatformId(
new GetPlatformIdRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
);
PlatformId item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.GetPlatformIdResult> asyncResult = null;
yield return client.GetPlatformId(
new Gs2.Gs2Account.Request.GetPlatformIdRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithType(0),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.getPlatformId(
new Gs2Account.GetPlatformIdRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.get_platform_id(
account.GetPlatformIdRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_type(0)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.get_platform_id({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.get_platform_id_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getPlatformIdByUserId
Get Platform ID by specifying a user ID
The Platform ID is information used to hold IDs for various platforms such as X, Instagram, and Facebook.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | GS2-Account User ID The GS2-Account user ID that this platform ID is linked to. Used to map between external platform identities and GS2 anonymous accounts. | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified within the range from 0 to 1024, it is used to identify the type of platform. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | PlatformId | Platform ID |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.GetPlatformIdByUserId(
&account.GetPlatformIdByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
Type: pointy.Int32(0),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetPlatformIdByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getPlatformIdByUserId(
(new GetPlatformIdByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-0001")
->withType(0)
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetPlatformIdByUserIdRequest;
import io.gs2.account.result.GetPlatformIdByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
GetPlatformIdByUserIdResult result = client.getPlatformIdByUserId(
new GetPlatformIdByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withType(0)
.withTimeOffsetToken(null)
);
PlatformId item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.GetPlatformIdByUserIdResult> asyncResult = null;
yield return client.GetPlatformIdByUserId(
new Gs2.Gs2Account.Request.GetPlatformIdByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-0001")
.WithType(0)
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.getPlatformIdByUserId(
new Gs2Account.GetPlatformIdByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withType(0)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.get_platform_id_by_user_id(
account.GetPlatformIdByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_type(0)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.get_platform_id_by_user_id({
namespaceName="namespace-0001",
userId="userId-0001",
type=0,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.get_platform_id_by_user_id_async({
namespaceName="namespace-0001",
userId="userId-0001",
type=0,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;findPlatformId
Find GS2-Account user ID by specifying Platform ID
If “Whether to use different user IDs for login and data retention” is enabled in the namespace settings, you can get the data owner ID.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token The GS2-Account user ID that this platform ID is linked to. Used to map between external platform identities and GS2 anonymous accounts. | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified within the range from 0 to 1024, it is used to identify the type of platform. | ||
| userIdentifier | string | ✓ | ~ 1024 chars | User ID on various platforms The user’s unique identifier on the external platform (e.g., social media user ID or email address). Used together with the slot number (type) to identify a specific platform account. |
Result
| Type | Description | |
|---|---|---|
| item | PlatformUser | Various platform user information |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.FindPlatformId(
&account.FindPlatformIdRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
Type: pointy.Int32(0),
UserIdentifier: pointy.String("123456"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\FindPlatformIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->findPlatformId(
(new FindPlatformIdRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withType(0)
->withUserIdentifier("123456")
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.FindPlatformIdRequest;
import io.gs2.account.result.FindPlatformIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
FindPlatformIdResult result = client.findPlatformId(
new FindPlatformIdRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
.withUserIdentifier("123456")
);
PlatformUser item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.FindPlatformIdResult> asyncResult = null;
yield return client.FindPlatformId(
new Gs2.Gs2Account.Request.FindPlatformIdRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithType(0)
.WithUserIdentifier("123456"),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.findPlatformId(
new Gs2Account.FindPlatformIdRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
.withUserIdentifier("123456")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.find_platform_id(
account.FindPlatformIdRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_type(0)
.with_user_identifier('123456')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.find_platform_id({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
userIdentifier="123456",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.find_platform_id_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
userIdentifier="123456",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;findPlatformIdByUserId
Get Platform ID by specifying GS2-Account user ID
If “Whether to use different user IDs for login and data retention” is enabled in the Namespace settings, you can get the data owner ID.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | GS2-Account User ID The GS2-Account user ID that this platform ID is linked to. Used to map between external platform identities and GS2 anonymous accounts. | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified within the range from 0 to 1024, it is used to identify the type of platform. | ||
| userIdentifier | string | ✓ | ~ 1024 chars | User ID on various platforms The user’s unique identifier on the external platform (e.g., social media user ID or email address). Used together with the slot number (type) to identify a specific platform account. | ||
| dontResolveDataOwner | bool? | false | Disable Data Owner ID resolution when different User IDs are used for login and data retention Set true to not resolve data owner ID even if ‘Whether to use different user IDs for login and data retention’ is enabled in the namespace settings. | |||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | PlatformUser | Various platform user information |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.FindPlatformIdByUserId(
&account.FindPlatformIdByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
Type: pointy.Int32(0),
UserIdentifier: pointy.String("123456"),
DontResolveDataOwner: nil,
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\FindPlatformIdByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->findPlatformIdByUserId(
(new FindPlatformIdByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withType(0)
->withUserIdentifier("123456")
->withDontResolveDataOwner(null)
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.FindPlatformIdByUserIdRequest;
import io.gs2.account.result.FindPlatformIdByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
FindPlatformIdByUserIdResult result = client.findPlatformIdByUserId(
new FindPlatformIdByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withType(0)
.withUserIdentifier("123456")
.withDontResolveDataOwner(null)
.withTimeOffsetToken(null)
);
PlatformUser item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.FindPlatformIdByUserIdResult> asyncResult = null;
yield return client.FindPlatformIdByUserId(
new Gs2.Gs2Account.Request.FindPlatformIdByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithType(0)
.WithUserIdentifier("123456")
.WithDontResolveDataOwner(null)
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.findPlatformIdByUserId(
new Gs2Account.FindPlatformIdByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withType(0)
.withUserIdentifier("123456")
.withDontResolveDataOwner(null)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.find_platform_id_by_user_id(
account.FindPlatformIdByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_type(0)
.with_user_identifier('123456')
.with_dont_resolve_data_owner(None)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.find_platform_id_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
type=0,
userIdentifier="123456",
dontResolveDataOwner=nil,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.find_platform_id_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
type=0,
userIdentifier="123456",
dontResolveDataOwner=nil,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deletePlatformId
Delete Platform ID
Deletes the Platform ID of the specified type from the currently logged-in Game Player Account. Once deleted, the association between the GS2 account and the platform identity is removed.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| accessToken | string | ✓ | ~ 128 chars | Access token The GS2-Account user ID that this platform ID is linked to. Used to map between external platform identities and GS2 anonymous accounts. | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified within the range from 0 to 1024, it is used to identify the type of platform. | ||
| userIdentifier | string | ~ 1024 chars | User ID for platform id |
Result
| Type | Description | |
|---|---|---|
| item | PlatformId | Platform ID deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DeletePlatformId(
&account.DeletePlatformIdRequest {
NamespaceName: pointy.String("namespace-0001"),
AccessToken: pointy.String("accessToken-0001"),
Type: pointy.Int32(0),
UserIdentifier: pointy.String("123456"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeletePlatformIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deletePlatformId(
(new DeletePlatformIdRequest())
->withNamespaceName("namespace-0001")
->withAccessToken("accessToken-0001")
->withType(0)
->withUserIdentifier("123456")
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeletePlatformIdRequest;
import io.gs2.account.result.DeletePlatformIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DeletePlatformIdResult result = client.deletePlatformId(
new DeletePlatformIdRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
.withUserIdentifier("123456")
);
PlatformId item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DeletePlatformIdResult> asyncResult = null;
yield return client.DeletePlatformId(
new Gs2.Gs2Account.Request.DeletePlatformIdRequest()
.WithNamespaceName("namespace-0001")
.WithAccessToken("accessToken-0001")
.WithType(0)
.WithUserIdentifier("123456"),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.deletePlatformId(
new Gs2Account.DeletePlatformIdRequest()
.withNamespaceName("namespace-0001")
.withAccessToken("accessToken-0001")
.withType(0)
.withUserIdentifier("123456")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.delete_platform_id(
account.DeletePlatformIdRequest()
.with_namespace_name('namespace-0001')
.with_access_token('accessToken-0001')
.with_type(0)
.with_user_identifier('123456')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.delete_platform_id({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
userIdentifier="123456",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.delete_platform_id_async({
namespaceName="namespace-0001",
accessToken="accessToken-0001",
type=0,
userIdentifier="123456",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deletePlatformIdByUserIdentifier
Delete Platform ID by specifying a user ID on various platforms
Deletes the Platform ID by looking it up using the platform-side user identifier instead of the GS2 user ID. This is useful when you know the external user identifier on the platform but not the internal GS2 user ID. Once deleted, the association between the GS2 account and the platform identity is removed.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified within the range from 0 to 1024, it is used to identify the type of platform. | ||
| userIdentifier | string | ~ 1024 chars | User ID for platform id |
Result
| Type | Description | |
|---|---|---|
| item | PlatformId | Platform ID deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DeletePlatformIdByUserIdentifier(
&account.DeletePlatformIdByUserIdentifierRequest {
NamespaceName: pointy.String("namespace-0001"),
Type: pointy.Int32(0),
UserIdentifier: pointy.String("123456789"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeletePlatformIdByUserIdentifierRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deletePlatformIdByUserIdentifier(
(new DeletePlatformIdByUserIdentifierRequest())
->withNamespaceName("namespace-0001")
->withType(0)
->withUserIdentifier("123456789")
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeletePlatformIdByUserIdentifierRequest;
import io.gs2.account.result.DeletePlatformIdByUserIdentifierResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DeletePlatformIdByUserIdentifierResult result = client.deletePlatformIdByUserIdentifier(
new DeletePlatformIdByUserIdentifierRequest()
.withNamespaceName("namespace-0001")
.withType(0)
.withUserIdentifier("123456789")
);
PlatformId item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DeletePlatformIdByUserIdentifierResult> asyncResult = null;
yield return client.DeletePlatformIdByUserIdentifier(
new Gs2.Gs2Account.Request.DeletePlatformIdByUserIdentifierRequest()
.WithNamespaceName("namespace-0001")
.WithType(0)
.WithUserIdentifier("123456789"),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.deletePlatformIdByUserIdentifier(
new Gs2Account.DeletePlatformIdByUserIdentifierRequest()
.withNamespaceName("namespace-0001")
.withType(0)
.withUserIdentifier("123456789")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.delete_platform_id_by_user_identifier(
account.DeletePlatformIdByUserIdentifierRequest()
.with_namespace_name('namespace-0001')
.with_type(0)
.with_user_identifier('123456789')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.delete_platform_id_by_user_identifier({
namespaceName="namespace-0001",
type=0,
userIdentifier="123456789",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.delete_platform_id_by_user_identifier_async({
namespaceName="namespace-0001",
type=0,
userIdentifier="123456789",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deletePlatformIdByUserId
Delete Platform ID by specifying GS2-Account user ID
Deletes the Platform ID of the specified type from the specified Game Player Account using the GS2 user ID. Once deleted, the association between the GS2 account and the platform identity is removed.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | ~ 128 chars | GS2-Account User ID The GS2-Account user ID that this platform ID is linked to. Used to map between external platform identities and GS2 anonymous accounts. | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified within the range from 0 to 1024, it is used to identify the type of platform. | ||
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | PlatformId | Platform ID deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DeletePlatformIdByUserId(
&account.DeletePlatformIdByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("user-0001"),
Type: pointy.Int32(0),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeletePlatformIdByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deletePlatformIdByUserId(
(new DeletePlatformIdByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("user-0001")
->withType(0)
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeletePlatformIdByUserIdRequest;
import io.gs2.account.result.DeletePlatformIdByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DeletePlatformIdByUserIdResult result = client.deletePlatformIdByUserId(
new DeletePlatformIdByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withType(0)
.withTimeOffsetToken(null)
);
PlatformId item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DeletePlatformIdByUserIdResult> asyncResult = null;
yield return client.DeletePlatformIdByUserId(
new Gs2.Gs2Account.Request.DeletePlatformIdByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("user-0001")
.WithType(0)
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.deletePlatformIdByUserId(
new Gs2Account.DeletePlatformIdByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("user-0001")
.withType(0)
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.delete_platform_id_by_user_id(
account.DeletePlatformIdByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('user-0001')
.with_type(0)
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.delete_platform_id_by_user_id({
namespaceName="namespace-0001",
userId="user-0001",
type=0,
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.delete_platform_id_by_user_id_async({
namespaceName="namespace-0001",
userId="user-0001",
type=0,
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getDataOwnerByUserId
Get Data Owner
This action is used to get information about a data owner associated with a specified user ID. This action returns detailed information about a data owner associated with a specific account in the specified namespace. Data owner information includes data owner ID, associated user ID, and other related information.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | UUID | ~ 128 chars | User ID | |
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | DataOwner | DataOwner |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.GetDataOwnerByUserId(
&account.GetDataOwnerByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetDataOwnerByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getDataOwnerByUserId(
(new GetDataOwnerByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetDataOwnerByUserIdRequest;
import io.gs2.account.result.GetDataOwnerByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
GetDataOwnerByUserIdResult result = client.getDataOwnerByUserId(
new GetDataOwnerByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withTimeOffsetToken(null)
);
DataOwner item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.GetDataOwnerByUserIdResult> asyncResult = null;
yield return client.GetDataOwnerByUserId(
new Gs2.Gs2Account.Request.GetDataOwnerByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.getDataOwnerByUserId(
new Gs2Account.GetDataOwnerByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.get_data_owner_by_user_id(
account.GetDataOwnerByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.get_data_owner_by_user_id({
namespaceName="namespace-0001",
userId="userId-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.get_data_owner_by_user_id_async({
namespaceName="namespace-0001",
userId="userId-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateDataOwnerByUserId
Update Data Owner
Updates the data owner name associated with the specified user ID. The data owner is used to manage the mapping between the user ID used for login and the user ID used for data retention when “Whether to use different user IDs for login and data retention” is enabled in the namespace settings.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | UUID | ~ 128 chars | User ID | |
| dataOwnerName | string | ✓ | UUID | ~ 36 chars | Data Owner ID Serves as a unique identifier for the data owner. The data owner ID represents the actual owner of the data and may be different from the user ID. | |
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | DataOwner | DataOwner |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.UpdateDataOwnerByUserId(
&account.UpdateDataOwnerByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
DataOwnerName: pointy.String("data-owner-1001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateDataOwnerByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateDataOwnerByUserId(
(new UpdateDataOwnerByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-0001")
->withDataOwnerName("data-owner-1001")
->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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateDataOwnerByUserIdRequest;
import io.gs2.account.result.UpdateDataOwnerByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
UpdateDataOwnerByUserIdResult result = client.updateDataOwnerByUserId(
new UpdateDataOwnerByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withDataOwnerName("data-owner-1001")
.withTimeOffsetToken(null)
);
DataOwner item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.UpdateDataOwnerByUserIdResult> asyncResult = null;
yield return client.UpdateDataOwnerByUserId(
new Gs2.Gs2Account.Request.UpdateDataOwnerByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-0001")
.WithDataOwnerName("data-owner-1001")
.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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.updateDataOwnerByUserId(
new Gs2Account.UpdateDataOwnerByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withDataOwnerName("data-owner-1001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.update_data_owner_by_user_id(
account.UpdateDataOwnerByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_data_owner_name('data-owner-1001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.update_data_owner_by_user_id({
namespaceName="namespace-0001",
userId="userId-0001",
dataOwnerName="data-owner-1001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.update_data_owner_by_user_id_async({
namespaceName="namespace-0001",
userId="userId-0001",
dataOwnerName="data-owner-1001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteDataOwnerByUserId
Delete Data Owner
This action is used to delete information about a data owner associated with a specified user ID. This action completely deletes the data owner associated with the specified account in the specified namespace from the system. The relationship between the user ID and the data owner ID is lost, and it is unknown whose data it is unless the user ID is included in the user data managed by GS2.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| userId | string | ✓ | UUID | ~ 128 chars | User ID | |
| timeOffsetToken | string | ~ 1024 chars | Time offset token |
Result
| Type | Description | |
|---|---|---|
| item | DataOwner | The deleted Data Owner |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DeleteDataOwnerByUserId(
&account.DeleteDataOwnerByUserIdRequest {
NamespaceName: pointy.String("namespace-0001"),
UserId: pointy.String("userId-0001"),
TimeOffsetToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteDataOwnerByUserIdRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteDataOwnerByUserId(
(new DeleteDataOwnerByUserIdRequest())
->withNamespaceName("namespace-0001")
->withUserId("userId-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteDataOwnerByUserIdRequest;
import io.gs2.account.result.DeleteDataOwnerByUserIdResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DeleteDataOwnerByUserIdResult result = client.deleteDataOwnerByUserId(
new DeleteDataOwnerByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withTimeOffsetToken(null)
);
DataOwner item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DeleteDataOwnerByUserIdResult> asyncResult = null;
yield return client.DeleteDataOwnerByUserId(
new Gs2.Gs2Account.Request.DeleteDataOwnerByUserIdRequest()
.WithNamespaceName("namespace-0001")
.WithUserId("userId-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.deleteDataOwnerByUserId(
new Gs2Account.DeleteDataOwnerByUserIdRequest()
.withNamespaceName("namespace-0001")
.withUserId("userId-0001")
.withTimeOffsetToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.delete_data_owner_by_user_id(
account.DeleteDataOwnerByUserIdRequest()
.with_namespace_name('namespace-0001')
.with_user_id('userId-0001')
.with_time_offset_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.delete_data_owner_by_user_id({
namespaceName="namespace-0001",
userId="userId-0001",
timeOffsetToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.delete_data_owner_by_user_id_async({
namespaceName="namespace-0001",
userId="userId-0001",
timeOffsetToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;describeTakeOverTypeModels
Get a list of Takeover Type Models
Retrieves all currently active Takeover Type Models in the specified namespace. Takeover Type Models define the types of account takeover methods available, such as email/password-based or OpenID Connect-based takeover. Each type model includes settings such as the OpenID Connect configuration for the identity provider. Unlike the master variant, this returns only the activated (published) models without pagination.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<TakeOverTypeModel> | List of Takeover Type Models |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DescribeTakeOverTypeModels(
&account.DescribeTakeOverTypeModelsRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Itemsuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeTakeOverTypeModelsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeTakeOverTypeModels(
(new DescribeTakeOverTypeModelsRequest())
->withNamespaceName("namespace-0001")
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeTakeOverTypeModelsRequest;
import io.gs2.account.result.DescribeTakeOverTypeModelsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DescribeTakeOverTypeModelsResult result = client.describeTakeOverTypeModels(
new DescribeTakeOverTypeModelsRequest()
.withNamespaceName("namespace-0001")
);
List<TakeOverTypeModel> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DescribeTakeOverTypeModelsResult> asyncResult = null;
yield return client.DescribeTakeOverTypeModels(
new Gs2.Gs2Account.Request.DescribeTakeOverTypeModelsRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.describeTakeOverTypeModels(
new Gs2Account.DescribeTakeOverTypeModelsRequest()
.withNamespaceName("namespace-0001")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.describe_take_over_type_models(
account.DescribeTakeOverTypeModelsRequest()
.with_namespace_name('namespace-0001')
)
items = result.items
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.describe_take_over_type_models({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;client = gs2('account')
api_result_handler = client.describe_take_over_type_models_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;getTakeOverTypeModel
Get Takeover Type Model
Retrieves the currently active Takeover Type Model of the specified type in the specified namespace. The type model includes the OpenID Connect configuration and other settings for the identity provider associated with this takeover type.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different types of takeover information. |
Result
| Type | Description | |
|---|---|---|
| item | TakeOverTypeModel | Takeover Type Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.GetTakeOverTypeModel(
&account.GetTakeOverTypeModelRequest {
NamespaceName: pointy.String("namespace-0001"),
Type: pointy.Int32(0),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetTakeOverTypeModelRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getTakeOverTypeModel(
(new GetTakeOverTypeModelRequest())
->withNamespaceName("namespace-0001")
->withType(0)
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetTakeOverTypeModelRequest;
import io.gs2.account.result.GetTakeOverTypeModelResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
GetTakeOverTypeModelResult result = client.getTakeOverTypeModel(
new GetTakeOverTypeModelRequest()
.withNamespaceName("namespace-0001")
.withType(0)
);
TakeOverTypeModel item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.GetTakeOverTypeModelResult> asyncResult = null;
yield return client.GetTakeOverTypeModel(
new Gs2.Gs2Account.Request.GetTakeOverTypeModelRequest()
.WithNamespaceName("namespace-0001")
.WithType(0),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.getTakeOverTypeModel(
new Gs2Account.GetTakeOverTypeModelRequest()
.withNamespaceName("namespace-0001")
.withType(0)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.get_take_over_type_model(
account.GetTakeOverTypeModelRequest()
.with_namespace_name('namespace-0001')
.with_type(0)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.get_take_over_type_model({
namespaceName="namespace-0001",
type=0,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.get_take_over_type_model_async({
namespaceName="namespace-0001",
type=0,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;exportMaster
Export Takeover Type Model Master in a master data format that can be activated
Exports the current Takeover Type Model Master data in a format that can be used for activation. The exported data can be used to back up the current master configuration, or to import it into another namespace.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | CurrentModelMaster | Takeover Type Model master data that can be activated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.ExportMaster(
&account.ExportMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\ExportMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->exportMaster(
(new ExportMasterRequest())
->withNamespaceName("namespace-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.ExportMasterRequest;
import io.gs2.account.result.ExportMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
ExportMasterResult result = client.exportMaster(
new ExportMasterRequest()
.withNamespaceName("namespace-0001")
);
CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
new Gs2.Gs2Account.Request.ExportMasterRequest()
.WithNamespaceName("namespace-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.exportMaster(
new Gs2Account.ExportMasterRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.export_master(
account.ExportMasterRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.export_master({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.export_master_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getCurrentModelMaster
Get master data of the currently active Takeover Type Model
Retrieves the master data of the Takeover Type Models that are currently active (published) in the specified namespace. This represents the configuration that is actually being used in production, as opposed to the editable master data.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | CurrentModelMaster | Master data of the currently active Takeover Type Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.GetCurrentModelMaster(
&account.GetCurrentModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetCurrentModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getCurrentModelMaster(
(new GetCurrentModelMasterRequest())
->withNamespaceName("namespace-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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetCurrentModelMasterRequest;
import io.gs2.account.result.GetCurrentModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
GetCurrentModelMasterResult result = client.getCurrentModelMaster(
new GetCurrentModelMasterRequest()
.withNamespaceName("namespace-0001")
);
CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.GetCurrentModelMasterResult> asyncResult = null;
yield return client.GetCurrentModelMaster(
new Gs2.Gs2Account.Request.GetCurrentModelMasterRequest()
.WithNamespaceName("namespace-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.getCurrentModelMaster(
new Gs2Account.GetCurrentModelMasterRequest()
.withNamespaceName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.get_current_model_master(
account.GetCurrentModelMasterRequest()
.with_namespace_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.get_current_model_master({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.get_current_model_master_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;preUpdateCurrentModelMaster
Update master data of the currently active Takeover Type Model (3-phase version)
When uploading master data larger than 1MB, the update is performed in 3 phases.
- Execute this API to obtain a token and URL for uploading.
- Upload the master data to the obtained URL.
- Execute UpdateCurrentModelMaster in preUpload mode, passing the token used for the upload, to reflect the master data.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| uploadToken | string | Token used to reflect results after upload |
| uploadUrl | string | URL used to upload |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.PreUpdateCurrentModelMaster(
&account.PreUpdateCurrentModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrluse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\PreUpdateCurrentModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->preUpdateCurrentModelMaster(
(new PreUpdateCurrentModelMasterRequest())
->withNamespaceName("namespace-0001")
);
$uploadToken = $result->getUploadToken();
$uploadUrl = $result->getUploadUrl();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.PreUpdateCurrentModelMasterRequest;
import io.gs2.account.result.PreUpdateCurrentModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
PreUpdateCurrentModelMasterResult result = client.preUpdateCurrentModelMaster(
new PreUpdateCurrentModelMasterRequest()
.withNamespaceName("namespace-0001")
);
String uploadToken = result.getUploadToken();
String uploadUrl = result.getUploadUrl();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.PreUpdateCurrentModelMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentModelMaster(
new Gs2.Gs2Account.Request.PreUpdateCurrentModelMasterRequest()
.WithNamespaceName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var uploadToken = result.UploadToken;
var uploadUrl = result.UploadUrl;import Gs2Core from '@/gs2/core';
import * as Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.preUpdateCurrentModelMaster(
new Gs2Account.PreUpdateCurrentModelMasterRequest()
.withNamespaceName("namespace-0001")
);
const uploadToken = result.getUploadToken();
const uploadUrl = result.getUploadUrl();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.pre_update_current_model_master(
account.PreUpdateCurrentModelMasterRequest()
.with_namespace_name('namespace-0001')
)
upload_token = result.upload_token
upload_url = result.upload_url
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.pre_update_current_model_master({
namespaceName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;client = gs2('account')
api_result_handler = client.pre_update_current_model_master_async({
namespaceName="namespace-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
uploadToken = result.uploadToken;
uploadUrl = result.uploadUrl;updateCurrentModelMaster
Update master data of the currently active Takeover Type Model
Updates and activates (publishes) the master data of the Takeover Type Models in the specified namespace. Supports two modes: ‘direct’ mode for inline master data, and ‘preUpload’ mode for master data that was uploaded in advance. For master data larger than 1MB, use the 3-phase update flow: PreUpdate -> Upload -> Update (preUpload mode).
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| mode | String Enum enum { “direct”, “preUpload” } | “direct” | Update mode
| |||||||||
| settings | string | {mode} == “direct” | ✓* | ~ 5242880 chars | Master Data * Required if mode is “direct” | |||||||
| uploadToken | string | {mode} == “preUpload” | ✓* | ~ 1024 chars | Token obtained by pre-upload Used to apply the uploaded master data. * Required if mode is “preUpload” |
Result
| Type | Description | |
|---|---|---|
| item | CurrentModelMaster | Updated master data of the currently active Takeover Type Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.UpdateCurrentModelMaster(
&account.UpdateCurrentModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Mode: pointy.String("direct"),
Settings: pointy.String("{\"version\": \"2024-07-30\", \"takeOverTypeModels\": [{\"type\": 0, \"metadata\": \"Google\", \"openIdConnectSetting\": {\"configurationPath\": \"https://accounts.google.com/.well-known/openid-configuration\", \"clientId\": \"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com\", \"clientSecret\": \"secret\"}}, {\"type\": 1, \"metadata\": \"Apple\", \"openIdConnectSetting\": {\"configurationPath\": \"https://appleid.apple.com/.well-known/openid-configuration\", \"clientId\": \"io.gs2.sample.auth\", \"appleTeamId\": \"9LX9LA85H8\", \"appleKeyId\": \"P937MLY6Z7\", \"applePrivateKeyPem\": \"-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----\"}}]}"),
UploadToken: nil,
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateCurrentModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentModelMaster(
(new UpdateCurrentModelMasterRequest())
->withNamespaceName("namespace-0001")
->withMode("direct")
->withSettings("{\"version\": \"2024-07-30\", \"takeOverTypeModels\": [{\"type\": 0, \"metadata\": \"Google\", \"openIdConnectSetting\": {\"configurationPath\": \"https://accounts.google.com/.well-known/openid-configuration\", \"clientId\": \"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com\", \"clientSecret\": \"secret\"}}, {\"type\": 1, \"metadata\": \"Apple\", \"openIdConnectSetting\": {\"configurationPath\": \"https://appleid.apple.com/.well-known/openid-configuration\", \"clientId\": \"io.gs2.sample.auth\", \"appleTeamId\": \"9LX9LA85H8\", \"appleKeyId\": \"P937MLY6Z7\", \"applePrivateKeyPem\": \"-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----\"}}]}")
->withUploadToken(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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateCurrentModelMasterRequest;
import io.gs2.account.result.UpdateCurrentModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
UpdateCurrentModelMasterResult result = client.updateCurrentModelMaster(
new UpdateCurrentModelMasterRequest()
.withNamespaceName("namespace-0001")
.withMode("direct")
.withSettings("{\"version\": \"2024-07-30\", \"takeOverTypeModels\": [{\"type\": 0, \"metadata\": \"Google\", \"openIdConnectSetting\": {\"configurationPath\": \"https://accounts.google.com/.well-known/openid-configuration\", \"clientId\": \"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com\", \"clientSecret\": \"secret\"}}, {\"type\": 1, \"metadata\": \"Apple\", \"openIdConnectSetting\": {\"configurationPath\": \"https://appleid.apple.com/.well-known/openid-configuration\", \"clientId\": \"io.gs2.sample.auth\", \"appleTeamId\": \"9LX9LA85H8\", \"appleKeyId\": \"P937MLY6Z7\", \"applePrivateKeyPem\": \"-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----\"}}]}")
.withUploadToken(null)
);
CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.UpdateCurrentModelMasterResult> asyncResult = null;
yield return client.UpdateCurrentModelMaster(
new Gs2.Gs2Account.Request.UpdateCurrentModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithMode("direct")
.WithSettings("{\"version\": \"2024-07-30\", \"takeOverTypeModels\": [{\"type\": 0, \"metadata\": \"Google\", \"openIdConnectSetting\": {\"configurationPath\": \"https://accounts.google.com/.well-known/openid-configuration\", \"clientId\": \"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com\", \"clientSecret\": \"secret\"}}, {\"type\": 1, \"metadata\": \"Apple\", \"openIdConnectSetting\": {\"configurationPath\": \"https://appleid.apple.com/.well-known/openid-configuration\", \"clientId\": \"io.gs2.sample.auth\", \"appleTeamId\": \"9LX9LA85H8\", \"appleKeyId\": \"P937MLY6Z7\", \"applePrivateKeyPem\": \"-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----\"}}]}")
.WithUploadToken(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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.updateCurrentModelMaster(
new Gs2Account.UpdateCurrentModelMasterRequest()
.withNamespaceName("namespace-0001")
.withMode("direct")
.withSettings("{\"version\": \"2024-07-30\", \"takeOverTypeModels\": [{\"type\": 0, \"metadata\": \"Google\", \"openIdConnectSetting\": {\"configurationPath\": \"https://accounts.google.com/.well-known/openid-configuration\", \"clientId\": \"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com\", \"clientSecret\": \"secret\"}}, {\"type\": 1, \"metadata\": \"Apple\", \"openIdConnectSetting\": {\"configurationPath\": \"https://appleid.apple.com/.well-known/openid-configuration\", \"clientId\": \"io.gs2.sample.auth\", \"appleTeamId\": \"9LX9LA85H8\", \"appleKeyId\": \"P937MLY6Z7\", \"applePrivateKeyPem\": \"-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----\"}}]}")
.withUploadToken(null)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.update_current_model_master(
account.UpdateCurrentModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_mode('direct')
.with_settings('{"version": "2024-07-30", "takeOverTypeModels": [{"type": 0, "metadata": "Google", "openIdConnectSetting": {"configurationPath": "https://accounts.google.com/.well-known/openid-configuration", "clientId": "695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com", "clientSecret": "secret"}}, {"type": 1, "metadata": "Apple", "openIdConnectSetting": {"configurationPath": "https://appleid.apple.com/.well-known/openid-configuration", "clientId": "io.gs2.sample.auth", "appleTeamId": "9LX9LA85H8", "appleKeyId": "P937MLY6Z7", "applePrivateKeyPem": "-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----"}}]}')
.with_upload_token(None)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.update_current_model_master({
namespaceName="namespace-0001",
mode="direct",
settings="{\"version\": \"2024-07-30\", \"takeOverTypeModels\": [{\"type\": 0, \"metadata\": \"Google\", \"openIdConnectSetting\": {\"configurationPath\": \"https://accounts.google.com/.well-known/openid-configuration\", \"clientId\": \"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com\", \"clientSecret\": \"secret\"}}, {\"type\": 1, \"metadata\": \"Apple\", \"openIdConnectSetting\": {\"configurationPath\": \"https://appleid.apple.com/.well-known/openid-configuration\", \"clientId\": \"io.gs2.sample.auth\", \"appleTeamId\": \"9LX9LA85H8\", \"appleKeyId\": \"P937MLY6Z7\", \"applePrivateKeyPem\": \"-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----\"}}]}",
uploadToken=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.update_current_model_master_async({
namespaceName="namespace-0001",
mode="direct",
settings="{\"version\": \"2024-07-30\", \"takeOverTypeModels\": [{\"type\": 0, \"metadata\": \"Google\", \"openIdConnectSetting\": {\"configurationPath\": \"https://accounts.google.com/.well-known/openid-configuration\", \"clientId\": \"695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com\", \"clientSecret\": \"secret\"}}, {\"type\": 1, \"metadata\": \"Apple\", \"openIdConnectSetting\": {\"configurationPath\": \"https://appleid.apple.com/.well-known/openid-configuration\", \"clientId\": \"io.gs2.sample.auth\", \"appleTeamId\": \"9LX9LA85H8\", \"appleKeyId\": \"P937MLY6Z7\", \"applePrivateKeyPem\": \"-----BEGIN PRIVATE KEY-----\\\\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\\n-----END PRIVATE KEY-----\"}}]}",
uploadToken=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateCurrentModelMasterFromGitHub
Update master data of the currently active Takeover Type Model from GitHub
Updates and activates (publishes) the master data by fetching it directly from a GitHub repository. The checkout settings specify the repository, branch/tag, and file path to use. This is useful for managing master data in version control and deploying it directly.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| checkoutSetting | GitHubCheckoutSetting | ✓ | Setup to check out master data from GitHub |
Result
| Type | Description | |
|---|---|---|
| item | CurrentModelMaster | Updated master data of the currently active Takeover Type Model |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.UpdateCurrentModelMasterFromGitHub(
&account.UpdateCurrentModelMasterFromGitHubRequest {
NamespaceName: pointy.String("namespace-0001"),
CheckoutSetting: &account.GitHubCheckoutSetting{
ApiKeyId: pointy.String("apiKeyId-0001"),
RepositoryName: pointy.String("gs2io/master-data"),
SourcePath: pointy.String("path/to/file.json"),
ReferenceType: pointy.String("branch"),
BranchName: pointy.String("develop"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateCurrentModelMasterFromGitHubRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateCurrentModelMasterFromGitHub(
(new UpdateCurrentModelMasterFromGitHubRequest())
->withNamespaceName("namespace-0001")
->withCheckoutSetting((new GitHubCheckoutSetting())
->withApiKeyId("apiKeyId-0001")
->withRepositoryName("gs2io/master-data")
->withSourcePath("path/to/file.json")
->withReferenceType("branch")
->withBranchName("develop")
)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateCurrentModelMasterFromGitHubRequest;
import io.gs2.account.result.UpdateCurrentModelMasterFromGitHubResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
UpdateCurrentModelMasterFromGitHubResult result = client.updateCurrentModelMasterFromGitHub(
new UpdateCurrentModelMasterFromGitHubRequest()
.withNamespaceName("namespace-0001")
.withCheckoutSetting(new GitHubCheckoutSetting()
.withApiKeyId("apiKeyId-0001")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
CurrentModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.UpdateCurrentModelMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentModelMasterFromGitHub(
new Gs2.Gs2Account.Request.UpdateCurrentModelMasterFromGitHubRequest()
.WithNamespaceName("namespace-0001")
.WithCheckoutSetting(new Gs2.Gs2Account.Model.GitHubCheckoutSetting()
.WithApiKeyId("apiKeyId-0001")
.WithRepositoryName("gs2io/master-data")
.WithSourcePath("path/to/file.json")
.WithReferenceType("branch")
.WithBranchName("develop")
),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.updateCurrentModelMasterFromGitHub(
new Gs2Account.UpdateCurrentModelMasterFromGitHubRequest()
.withNamespaceName("namespace-0001")
.withCheckoutSetting(new Gs2Account.model.GitHubCheckoutSetting()
.withApiKeyId("apiKeyId-0001")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.update_current_model_master_from_git_hub(
account.UpdateCurrentModelMasterFromGitHubRequest()
.with_namespace_name('namespace-0001')
.with_checkout_setting(account.GitHubCheckoutSetting()
.with_api_key_id('apiKeyId-0001')
.with_repository_name('gs2io/master-data')
.with_source_path('path/to/file.json')
.with_reference_type('branch')
.with_branch_name('develop')
)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.update_current_model_master_from_git_hub({
namespaceName="namespace-0001",
checkoutSetting={
api_key_id="apiKeyId-0001",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.update_current_model_master_from_git_hub_async({
namespaceName="namespace-0001",
checkoutSetting={
api_key_id="apiKeyId-0001",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;describeTakeOverTypeModelMasters
Get a list of Takeover Type Model Masters
Retrieves a paginated list of Takeover Type Model Masters in the specified namespace. Takeover Type Model Masters are the editable versions of Takeover Type Models that define the types of account takeover methods available. Changes to master data do not take effect until the master data is activated (published) via the Current Model Master.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<TakeOverTypeModelMaster> | List of Takeover Type Model Masters |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DescribeTakeOverTypeModelMasters(
&account.DescribeTakeOverTypeModelMastersRequest {
NamespaceName: pointy.String("namespace-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageTokenuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DescribeTakeOverTypeModelMastersRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeTakeOverTypeModelMasters(
(new DescribeTakeOverTypeModelMastersRequest())
->withNamespaceName("namespace-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DescribeTakeOverTypeModelMastersRequest;
import io.gs2.account.result.DescribeTakeOverTypeModelMastersResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DescribeTakeOverTypeModelMastersResult result = client.describeTakeOverTypeModelMasters(
new DescribeTakeOverTypeModelMastersRequest()
.withNamespaceName("namespace-0001")
.withPageToken(null)
.withLimit(null)
);
List<TakeOverTypeModelMaster> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DescribeTakeOverTypeModelMastersResult> asyncResult = null;
yield return client.DescribeTakeOverTypeModelMasters(
new Gs2.Gs2Account.Request.DescribeTakeOverTypeModelMastersRequest()
.WithNamespaceName("namespace-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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.describeTakeOverTypeModelMasters(
new Gs2Account.DescribeTakeOverTypeModelMastersRequest()
.withNamespaceName("namespace-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 account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.describe_take_over_type_model_masters(
account.DescribeTakeOverTypeModelMastersRequest()
.with_namespace_name('namespace-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('account')
api_result = client.describe_take_over_type_model_masters({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;client = gs2('account')
api_result_handler = client.describe_take_over_type_model_masters_async({
namespaceName="namespace-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;createTakeOverTypeModelMaster
Create a new Takeover Type Model Master
Creates a new Takeover Type Model Master that defines a type of account takeover method. You can configure the type slot (numeric), description, metadata, and OpenID Connect settings for the identity provider. The OpenID Connect settings include the client ID, client secret, issuer, and other OIDC configuration required for identity provider integration. Changes do not take effect until the master data is activated (published) via the Current Model Master.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different types of takeover information. | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| openIdConnectSetting | OpenIdConnectSetting | ✓ | OpenID Connect Configuration Configuration for integrating with an OpenID Connect-compliant Identity Provider (IdP). Includes the discovery URL, client credentials, and platform-specific settings such as Apple Sign In parameters. |
Result
| Type | Description | |
|---|---|---|
| item | TakeOverTypeModelMaster | Takeover Type Model Master created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.CreateTakeOverTypeModelMaster(
&account.CreateTakeOverTypeModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Type: pointy.Int32(0),
Description: nil,
Metadata: pointy.String("Google"),
OpenIdConnectSetting: &account.OpenIdConnectSetting{
ConfigurationPath: pointy.String("https://accounts.google.com/.well-known/openid-configuration"),
ClientId: pointy.String("695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com"),
ClientSecret: pointy.String("secret"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\CreateTakeOverTypeModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createTakeOverTypeModelMaster(
(new CreateTakeOverTypeModelMasterRequest())
->withNamespaceName("namespace-0001")
->withType(0)
->withDescription(null)
->withMetadata("Google")
->withOpenIdConnectSetting((new \Gs2\Account\Model\OpenIdConnectSetting())
->withConfigurationPath("https://accounts.google.com/.well-known/openid-configuration")
->withClientId("695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com")
->withClientSecret("secret"))
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.CreateTakeOverTypeModelMasterRequest;
import io.gs2.account.result.CreateTakeOverTypeModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
CreateTakeOverTypeModelMasterResult result = client.createTakeOverTypeModelMaster(
new CreateTakeOverTypeModelMasterRequest()
.withNamespaceName("namespace-0001")
.withType(0)
.withDescription(null)
.withMetadata("Google")
.withOpenIdConnectSetting(new io.gs2.account.model.OpenIdConnectSetting()
.withConfigurationPath("https://accounts.google.com/.well-known/openid-configuration")
.withClientId("695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com")
.withClientSecret("secret"))
);
TakeOverTypeModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.CreateTakeOverTypeModelMasterResult> asyncResult = null;
yield return client.CreateTakeOverTypeModelMaster(
new Gs2.Gs2Account.Request.CreateTakeOverTypeModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithType(0)
.WithDescription(null)
.WithMetadata("Google")
.WithOpenIdConnectSetting(new Gs2.Gs2Account.Model.OpenIdConnectSetting()
.WithConfigurationPath("https://accounts.google.com/.well-known/openid-configuration")
.WithClientId("695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com")
.WithClientSecret("secret")),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.createTakeOverTypeModelMaster(
new Gs2Account.CreateTakeOverTypeModelMasterRequest()
.withNamespaceName("namespace-0001")
.withType(0)
.withDescription(null)
.withMetadata("Google")
.withOpenIdConnectSetting(new Gs2Account.model.OpenIdConnectSetting()
.withConfigurationPath("https://accounts.google.com/.well-known/openid-configuration")
.withClientId("695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com")
.withClientSecret("secret"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.create_take_over_type_model_master(
account.CreateTakeOverTypeModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_type(0)
.with_description(None)
.with_metadata('Google')
.with_open_id_connect_setting(
account.OpenIdConnectSetting()
.with_configuration_path('https://accounts.google.com/.well-known/openid-configuration')
.with_client_id('695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com')
.with_client_secret('secret'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.create_take_over_type_model_master({
namespaceName="namespace-0001",
type=0,
description=nil,
metadata="Google",
openIdConnectSetting={
configurationPath="https://accounts.google.com/.well-known/openid-configuration",
clientId="695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com",
clientSecret="secret",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.create_take_over_type_model_master_async({
namespaceName="namespace-0001",
type=0,
description=nil,
metadata="Google",
openIdConnectSetting={
configurationPath="https://accounts.google.com/.well-known/openid-configuration",
clientId="695893071400-qelt0dsu8tkotl13psnq5d1ko7kki4sl.apps.googleusercontent.com",
clientSecret="secret",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;getTakeOverTypeModelMaster
Get Takeover Type Model Master
Retrieves a specific Takeover Type Model Master by type in the specified namespace. The retrieved information includes the type slot, description, metadata, and OpenID Connect settings.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different types of takeover information. |
Result
| Type | Description | |
|---|---|---|
| item | TakeOverTypeModelMaster | Type of Takeover Type Model Master |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.GetTakeOverTypeModelMaster(
&account.GetTakeOverTypeModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Type: pointy.Int32(0),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\GetTakeOverTypeModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getTakeOverTypeModelMaster(
(new GetTakeOverTypeModelMasterRequest())
->withNamespaceName("namespace-0001")
->withType(0)
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.GetTakeOverTypeModelMasterRequest;
import io.gs2.account.result.GetTakeOverTypeModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
GetTakeOverTypeModelMasterResult result = client.getTakeOverTypeModelMaster(
new GetTakeOverTypeModelMasterRequest()
.withNamespaceName("namespace-0001")
.withType(0)
);
TakeOverTypeModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.GetTakeOverTypeModelMasterResult> asyncResult = null;
yield return client.GetTakeOverTypeModelMaster(
new Gs2.Gs2Account.Request.GetTakeOverTypeModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithType(0),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.getTakeOverTypeModelMaster(
new Gs2Account.GetTakeOverTypeModelMasterRequest()
.withNamespaceName("namespace-0001")
.withType(0)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.get_take_over_type_model_master(
account.GetTakeOverTypeModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_type(0)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.get_take_over_type_model_master({
namespaceName="namespace-0001",
type=0,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.get_take_over_type_model_master_async({
namespaceName="namespace-0001",
type=0,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;updateTakeOverTypeModelMaster
Update Takeover Type Model Master
Updates the specified Takeover Type Model Master. You can change the description, metadata, and OpenID Connect settings for the identity provider. Changes do not take effect until the master data is activated (published) via the Current Model Master.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different types of takeover information. | ||
| description | string | ~ 1024 chars | Description | |||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| openIdConnectSetting | OpenIdConnectSetting | ✓ | OpenID Connect Configuration Configuration for integrating with an OpenID Connect-compliant Identity Provider (IdP). Includes the discovery URL, client credentials, and platform-specific settings such as Apple Sign In parameters. |
Result
| Type | Description | |
|---|---|---|
| item | TakeOverTypeModelMaster | Takeover Type Model Master updated |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.UpdateTakeOverTypeModelMaster(
&account.UpdateTakeOverTypeModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Type: pointy.Int32(0),
Description: pointy.String("description1"),
Metadata: pointy.String("Microsoft"),
OpenIdConnectSetting: &account.OpenIdConnectSetting{
ConfigurationPath: pointy.String("https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration"),
ClientId: pointy.String("io.gs2.sample.auth"),
ClientSecret: pointy.String("secret"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\UpdateTakeOverTypeModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateTakeOverTypeModelMaster(
(new UpdateTakeOverTypeModelMasterRequest())
->withNamespaceName("namespace-0001")
->withType(0)
->withDescription("description1")
->withMetadata("Microsoft")
->withOpenIdConnectSetting((new \Gs2\Account\Model\OpenIdConnectSetting())
->withConfigurationPath("https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration")
->withClientId("io.gs2.sample.auth")
->withClientSecret("secret"))
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.UpdateTakeOverTypeModelMasterRequest;
import io.gs2.account.result.UpdateTakeOverTypeModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
UpdateTakeOverTypeModelMasterResult result = client.updateTakeOverTypeModelMaster(
new UpdateTakeOverTypeModelMasterRequest()
.withNamespaceName("namespace-0001")
.withType(0)
.withDescription("description1")
.withMetadata("Microsoft")
.withOpenIdConnectSetting(new io.gs2.account.model.OpenIdConnectSetting()
.withConfigurationPath("https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration")
.withClientId("io.gs2.sample.auth")
.withClientSecret("secret"))
);
TakeOverTypeModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.UpdateTakeOverTypeModelMasterResult> asyncResult = null;
yield return client.UpdateTakeOverTypeModelMaster(
new Gs2.Gs2Account.Request.UpdateTakeOverTypeModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithType(0)
.WithDescription("description1")
.WithMetadata("Microsoft")
.WithOpenIdConnectSetting(new Gs2.Gs2Account.Model.OpenIdConnectSetting()
.WithConfigurationPath("https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration")
.WithClientId("io.gs2.sample.auth")
.WithClientSecret("secret")),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.updateTakeOverTypeModelMaster(
new Gs2Account.UpdateTakeOverTypeModelMasterRequest()
.withNamespaceName("namespace-0001")
.withType(0)
.withDescription("description1")
.withMetadata("Microsoft")
.withOpenIdConnectSetting(new Gs2Account.model.OpenIdConnectSetting()
.withConfigurationPath("https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration")
.withClientId("io.gs2.sample.auth")
.withClientSecret("secret"))
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.update_take_over_type_model_master(
account.UpdateTakeOverTypeModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_type(0)
.with_description('description1')
.with_metadata('Microsoft')
.with_open_id_connect_setting(
account.OpenIdConnectSetting()
.with_configuration_path('https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration')
.with_client_id('io.gs2.sample.auth')
.with_client_secret('secret'))
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.update_take_over_type_model_master({
namespaceName="namespace-0001",
type=0,
description="description1",
metadata="Microsoft",
openIdConnectSetting={
configurationPath="https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration",
clientId="io.gs2.sample.auth",
clientSecret="secret",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.update_take_over_type_model_master_async({
namespaceName="namespace-0001",
type=0,
description="description1",
metadata="Microsoft",
openIdConnectSetting={
configurationPath="https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration",
clientId="io.gs2.sample.auth",
clientSecret="secret",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;deleteTakeOverTypeModelMaster
Delete Takeover Type Model Master
Deletes the specified Takeover Type Model Master from the specified namespace. Once deleted, this takeover type will no longer be available after the next master data activation. This operation only affects the master data; the currently active model remains unchanged until the master data is re-activated.
Details
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| type | int | ✓ | 0 ~ 1024 | Slot Number Specified in the range of 0 to 1024 to distinguish different types of takeover information. |
Result
| Type | Description | |
|---|---|---|
| item | TakeOverTypeModelMaster | Takeover Type Model Master deleted |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/account"
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 := account.Gs2AccountRestClient{
Session: &session,
}
result, err := client.DeleteTakeOverTypeModelMaster(
&account.DeleteTakeOverTypeModelMasterRequest {
NamespaceName: pointy.String("namespace-0001"),
Type: pointy.Int32(0),
}
)
if err != nil {
panic("error occurred")
}
item := result.Itemuse Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Account\Gs2AccountRestClient;
use Gs2\Account\Request\DeleteTakeOverTypeModelMasterRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteTakeOverTypeModelMaster(
(new DeleteTakeOverTypeModelMasterRequest())
->withNamespaceName("namespace-0001")
->withType(0)
);
$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.account.rest.Gs2AccountRestClient;
import io.gs2.account.request.DeleteTakeOverTypeModelMasterRequest;
import io.gs2.account.result.DeleteTakeOverTypeModelMasterResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
"your client id",
"your client secret"
)
);
session.connect();
Gs2AccountRestClient client = new Gs2AccountRestClient(session);
try {
DeleteTakeOverTypeModelMasterResult result = client.deleteTakeOverTypeModelMaster(
new DeleteTakeOverTypeModelMasterRequest()
.withNamespaceName("namespace-0001")
.withType(0)
);
TakeOverTypeModelMaster item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}using Gs2.Core;
using Gs2.Core.Model;
using Gs2.Core.Net;
using Gs2.Core.Exception;
var session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region.ApNortheast1
);
yield return session.OpenAsync(r => { });
var client = new Gs2AccountRestClient(session);
AsyncResult<Gs2.Gs2Account.Result.DeleteTakeOverTypeModelMasterResult> asyncResult = null;
yield return client.DeleteTakeOverTypeModelMaster(
new Gs2.Gs2Account.Request.DeleteTakeOverTypeModelMasterRequest()
.WithNamespaceName("namespace-0001")
.WithType(0),
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 Gs2Account from '@/gs2/account';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Account.Gs2AccountRestClient(session);
try {
const result = await client.deleteTakeOverTypeModelMaster(
new Gs2Account.DeleteTakeOverTypeModelMasterRequest()
.withNamespaceName("namespace-0001")
.withType(0)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}from gs2 import core
from gs2 import account
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = account.Gs2AccountRestClient(session)
try:
result = client.delete_take_over_type_model_master(
account.DeleteTakeOverTypeModelMasterRequest()
.with_namespace_name('namespace-0001')
.with_type(0)
)
item = result.item
except core.Gs2Exception as e:
exit(1)client = gs2('account')
api_result = client.delete_take_over_type_model_master({
namespaceName="namespace-0001",
type=0,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;client = gs2('account')
api_result_handler = client.delete_take_over_type_model_master_async({
namespaceName="namespace-0001",
type=0,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['errorMessage'])
end
result = api_result.result
item = result.item;