GS2-Ranking2 SDK API Reference

Specification of models and API references for GS2-Ranking2 SDK for various programming languages

Models

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
Settings for distributed transactions used to grant ranking rewards. Supports auto-run to automatically execute transactions and atomic commit for all-or-nothing guarantee.
logSetting LogSetting Log Output Setting
Specifies the GS2-Log namespace for outputting API request and response logs. Used for tracking score submissions and ranking reward distributions.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

TransactionSetting

Transaction Setting

Transaction Setting controls execution methods, consistency, asynchronous processing, and conflict avoidance mechanisms of transactions. Combining features like AutoRun, AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, and asynchronous processing of 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
* Enabled only if enableAutoRun is true
transactionUseDistributor bool {enableAtomicCommit} == true false Whether to execute transactions asynchronously
* Enabled only if enableAtomicCommit is true
commitScriptResultInUseDistributor bool {transactionUseDistributor} == true false Whether to execute the commit processing of the script result asynchronously
* Enabled only if transactionUseDistributor is true
acquireActionUseJobQueue bool {enableAtomicCommit} == true false Whether to use GS2-JobQueue to execute the acquire action
* Enabled 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

LogSetting

Log Output Setting

Log Output Setting defines how log data is exported. This type holds the GS2-Log namespace identifier (Namespace ID), which is 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

Setting for checking 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
DefinitionDescription
“commit_hash”Commit hash
“branch”Branch
“tag”Tag
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”

GlobalRankingScore

Global Ranking Score

Stores a user’s submitted score for a global ranking in a specific season. When the sum mode is enabled, multiple submitted scores are accumulated.

Details
Type Condition Required Default Value Limits Description
globalRankingScoreId string
*
~ 1024 chars Global Ranking Score GRN
* Set automatically by the server
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
season long
0 ~ 9223372036854775805 Season
The season number corresponding to the GS2-Schedule event repeat count. Increments with each new ranking period.
score long
0 ~ 9223372036854775805 Score
The score value submitted by the user. Must be within the range defined by the ranking model’s minimumValue and maximumValue settings.
metadata string ~ 512 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.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

GlobalRankingReceivedReward

Global Ranking Reward Received History

It is possible to set rewards for global ranking positions. To set rewards, set the ranking threshold and reward details.

Details
Type Condition Required Default Value Limits Description
globalRankingReceivedRewardId string
*
~ 1024 chars Global Ranking Received Reward GRN
* Set automatically by the server
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
season long
0 ~ 9223372036854775805 Season
The season number corresponding to the GS2-Schedule event repeat count. Increments with each new ranking period.
receivedAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

GlobalRankingData

Global Ranking

Represents a ranked entry in the global ranking for a specific season. Contains the user’s score, 0-based index (sorted position), and 1-based rank (which accounts for ties). The rank is calculated as index + 1.

Details
Type Condition Required Default Value Limits Description
globalRankingDataId string
*
~ 1024 chars Global Ranking GRN
* Set automatically by the server
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long
0 ~ 9223372036854775805 Season
The season number corresponding to the GS2-Schedule event repeat count. Increments with each new ranking period.
userId string
~ 128 chars User ID
index int 0 ~ 2147483646 Index
The 0-based unique sorted position of this entry in the ranking. Unlike rank, index is always unique even when scores are tied. Used for index-based reward calculation.
rank int 0 ~ 2147483646 Rank
The 1-based ranking position. Players with the same score share the same rank. Calculated as index + 1. Used for rank-based reward calculation.
score long
0 ~ 9223372036854775805 Score
metadata string ~ 512 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.
invertUpdatedAt long
0 ~ 9223372036854775805 Inverted value of updatedAt (used for sorting)
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

ClusterRankingScore

Cluster Ranking Score

Stores a user’s submitted score for a cluster ranking in a specific season and cluster. The user’s cluster membership is verified based on the cluster type setting before the score is accepted.

Details
Type Condition Required Default Value Limits Description
clusterRankingScoreId string
*
~ 1024 chars Cluster Ranking Score GRN
* Set automatically by the server
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or arbitrary group) that this score belongs to. Verified against the cluster type setting to ensure the user is a member.
season long
0 ~ 9223372036854775805 Season
The season number corresponding to the GS2-Schedule event repeat count.
userId string
~ 128 chars User ID
score long
0 ~ 9223372036854775805 Score
The score value submitted by the user within this cluster.
metadata string ~ 512 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.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

ClusterRankingReceivedReward

Cluster Ranking Reward Received History

You can set rewards according to the cluster ranking. To set rewards, set the ranking threshold and reward details.

Details
Type Condition Required Default Value Limits Description
clusterRankingReceivedRewardId string
*
~ 1024 chars Cluster Ranking Received Reward GRN
* Set automatically by the server
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster for which the ranking reward was received.
season long
0 ~ 9223372036854775805 Season
The season number corresponding to the GS2-Schedule event repeat count.
userId string
~ 128 chars User ID
receivedAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

ClusterRankingData

Cluster Ranking

Represents a ranked entry in a cluster ranking for a specific season and cluster. Contains the user’s score, 0-based index, and 1-based rank within the cluster.

Details
Type Condition Required Default Value Limits Description
clusterRankingDataId string
*
~ 1024 chars Cluster Ranking GRN
* Set automatically by the server
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or group) that this season belongs to.
season long
0 ~ 9223372036854775805 Season
The season number corresponding to the GS2-Schedule event repeat count.
userId string
~ 128 chars User ID
index int 0 ~ 2147483646 Index
The 0-based unique sorted position within the cluster ranking. Always unique even when scores are tied.
rank int 0 ~ 2147483646 Rank
The 1-based ranking position within the cluster. Players with the same score share the same rank. Calculated as index + 1.
score long
0 ~ 9223372036854775805 Score
metadata string ~ 512 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.
invertUpdatedAt long
0 ~ 9223372036854775805 Inverted value of updatedAt (used for sorting)
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

Subscribe

Subscribe

By subscribing to other players, you can have their latest scores reflected on your own leaderboard.

Details
Type Condition Required Default Value Limits Description
subscribeId string
*
~ 1024 chars Subscribe Score GRN
* Set automatically by the server
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
targetUserIds List<string> [] 0 ~ 1000 items Subscribe Target User IDs
List of user IDs that this user has subscribed to. Their scores will appear in this user’s subscribe ranking. Maximum 1000 users can be subscribed to. Duplicate subscriptions are prevented.
fromUserIds List<string> [] 0 ~ 1000 items Subscribe From User IDs
List of user IDs who have subscribed to this user. This is the reverse relationship of targetUserIds, tracking which users are following this user’s scores.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

SubscribeRankingScore

Subscribe Ranking Score

Stores a user’s submitted score for a subscribe ranking in a specific season. This score is visible to users who have subscribed to this user, forming their personalized friend ranking.

Details
Type Condition Required Default Value Limits Description
subscribeRankingScoreId string
*
~ 1024 chars Subscribe Ranking Score GRN
* Set automatically by the server
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long
0 ~ 9223372036854775805 Season
The season number corresponding to the GS2-Schedule event repeat count.
userId string
~ 128 chars User ID
score long
0 ~ 9223372036854775805 Score
metadata string ~ 512 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.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

SubscribeRankingData

Subscribe Ranking

Represents a ranked entry in a user’s personalized subscribe ranking for a specific season. Contains scores from subscribed users, ranked among the user’s friend list. Each entry includes the scorer’s user ID to identify who achieved the score.

Details
Type Condition Required Default Value Limits Description
subscribeRankingDataId string
*
~ 1024 chars Subscribe Ranking GRN
* Set automatically by the server
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long
0 ~ 9223372036854775805 Season
The season number corresponding to the GS2-Schedule event repeat count.
userId string
~ 128 chars User ID
index int 0 ~ 2147483646 Index
The 0-based unique sorted position within the subscribe ranking.
rank int 0 ~ 2147483646 Rank
The 1-based ranking position within the subscribe ranking. Calculated as index + 1.
scorerUserId string
~ 128 chars Scorer User ID
The user ID of the player who achieved this score. In a subscribe ranking, entries come from subscribed users, so this field identifies which friend’s score this entry represents.
score long
0 ~ 9223372036854775805 Score
metadata string ~ 512 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.
invertUpdatedAt long
0 ~ 9223372036854775805 Inverted value of updatedAt (used for sorting)
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

SubscribeUser

Subscribed User Information

Represents a subscription relationship between two users for the subscribe ranking.

Details
Type Condition Required Default Value Limits Description
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
targetUserId string
~ 128 chars Subscribe Target User ID
The user ID of the player being subscribed to. This player’s scores will be included in the subscriber’s personalized ranking.

GlobalRankingModel

Global Ranking Model

The global ranking is a model that allows you to create a ranking that targets all players. You can display the top 1000 rankings.

By associating it with the repeat event of GS2-Schedule, you can reset the ranking according to the number of repetitions.

Details
Type Condition Required Default Value Limits Description
globalRankingModelId string
*
~ 1024 chars Global Ranking GRN
* Set automatically by the server
name string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 1024 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.
minimumValue long 0 ~ 9223372036854775805 Minimum Score
The minimum allowed score value. Scores below this value will be rejected when submitted. Used to filter out invalid or unintended score values.
maximumValue long 0 ~ 9223372036854775805 Maximum Score
The maximum allowed score value. Scores above this value will be rejected when submitted. Used to prevent abnormally high scores from being registered.
sum bool false Sum Scores
When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score (highest or lowest depending on sort direction) is used for ranking.
orderDirection string (enum)
enum {
  “asc”,
  “desc”
}
Order Direction
The sort direction for ranking scores. Use “asc” for rankings where lower scores are better (e.g., time trials), or “desc” for rankings where higher scores are better (e.g., high scores).
DefinitionDescription
“asc”ascending-order
“desc”descending-order
entryPeriodEventId string ~ 1024 chars Entry Period Event GRN
GS2-Schedule event GRN that defines the period during which scores can be submitted. When linked to a repeating event, the ranking resets with each repeat cycle, enabling seasonal rankings.
rankingRewards List<RankingReward> {entryPeriodEventId} != null [] 0 ~ 100 items Ranking Rewards
List of rewards granted based on ranking position at the end of each season. Only available when an entry period event is configured. Each reward defines a rank threshold and the acquire actions to execute.
accessPeriodEventId string ~ 1024 chars Access Period Event GRN
GS2-Schedule event GRN that defines the period during which ranking results can be viewed and rewards can be claimed. Typically set to the interval between score entry periods.
rewardCalculationIndex string (enum)
enum {
  “rank”,
  “index”
}
“rank” Reward Calculation Index
Determines how rewards are matched to players. “rank” uses the 1-based ranking position (players with tied scores share the same rank), while “index” uses the 0-based unique sorted position (no ties). Choose “rank” for most typical use cases.
DefinitionDescription
“rank”Determine rewards based on rank
“index”Determine rewards based on index

ClusterRankingModel

Cluster Ranking Model

The cluster ranking model enables rankings for players within guilds or gatherings. You can display the top 1000 rankings.

By associating it with the repeat event of GS2-Schedule, you can reset the ranking according to the number of repetitions.

Details
Type Condition Required Default Value Limits Description
clusterRankingModelId string
*
~ 1024 chars Cluster Ranking GRN
* Set automatically by the server
name string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 1024 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.
clusterType string (enum)
enum {
  “Raw”,
  “Gs2Guild::Guild”,
  “Gs2Matchmaking::SeasonGathering”
}
Cluster Type
Defines the type of group (cluster) used for ranking segmentation. “Raw” allows arbitrary cluster names without membership verification, “Gs2Guild::Guild” verifies the user belongs to a GS2-Guild guild, and “Gs2Matchmaking::SeasonGathering” verifies membership in a GS2-Matchmaking season gathering.
DefinitionDescription
“Raw”No verification
“Gs2Guild::Guild”GS2-Guild Guild
“Gs2Matchmaking::SeasonGathering”GS2-Matchmaking Season Gathering
minimumValue long 0 ~ 9223372036854775805 Minimum Score
The minimum allowed score value. Scores below this value will be rejected when submitted.
maximumValue long 0 ~ 9223372036854775805 Maximum Score
The maximum allowed score value. Scores above this value will be rejected when submitted.
sum bool false Sum Scores
When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score is used for ranking.
orderDirection string (enum)
enum {
  “asc”,
  “desc”
}
Order Direction
The sort direction for ranking scores. Use “asc” for lower-is-better rankings, or “desc” for higher-is-better rankings.
DefinitionDescription
“asc”ascending-order
“desc”descending-order
entryPeriodEventId string ~ 1024 chars Entry Period Event GRN
GS2-Schedule event GRN that defines the period during which scores can be submitted. When linked to a repeating event, the ranking resets with each repeat cycle, enabling seasonal rankings.
rankingRewards List<RankingReward> {entryPeriodEventId} != null [] 0 ~ 100 items Ranking Rewards
List of rewards granted based on ranking position at the end of each season. Only available when an entry period event is configured.
accessPeriodEventId string ~ 1024 chars Access Period Event GRN
GS2-Schedule event GRN that defines the period during which ranking results can be viewed and rewards can be claimed.
rewardCalculationIndex string (enum)
enum {
  “rank”,
  “index”
}
“rank” Reward Calculation Index
Determines how rewards are matched to players. “rank” uses the 1-based ranking position (tied scores share same rank), “index” uses the 0-based unique sorted position (no ties).
DefinitionDescription
“rank”Determine rewards based on rank
“index”Determine rewards based on index

SubscribeRankingModel

Subscribe Ranking Model

A model that aggregates scores of other players that the user has subscribed to and creates a ranking.

Details
Type Condition Required Default Value Limits Description
subscribeRankingModelId string
*
~ 1024 chars Subscribe Ranking GRN
* Set automatically by the server
name string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadata string ~ 1024 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.
minimumValue long 0 ~ 9223372036854775805 Minimum Score
The minimum allowed score value. Scores below this value will be rejected when submitted.
maximumValue long 0 ~ 9223372036854775805 Maximum Score
The maximum allowed score value. Scores above this value will be rejected when submitted.
sum bool false Sum Scores
When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score is used for ranking.
orderDirection string (enum)
enum {
  “asc”,
  “desc”
}
Order Direction
The sort direction for ranking scores. Use “asc” for lower-is-better rankings, or “desc” for higher-is-better rankings.
DefinitionDescription
“asc”ascending-order
“desc”descending-order
entryPeriodEventId string ~ 1024 chars Entry Period Event GRN
GS2-Schedule event GRN that defines the period during which scores can be submitted. When linked to a repeating event, the ranking resets with each repeat cycle, enabling seasonal rankings.
accessPeriodEventId string ~ 1024 chars Access Period Event GRN
GS2-Schedule event GRN that defines the period during which ranking results can be viewed.

RankingReward

Ranking Reward

Set the rewards that can be received during the reference period when the score registration period is set in the ranking. If the repeat setting is enabled, the most recently ended period ranking will be the target for receiving rewards.

Details
Type Condition Required Default Value Limits Description
thresholdRank int
1 ~ 1001 Rank Threshold
The rank threshold for this reward tier. Players whose rank (or index, depending on rewardCalculationIndex setting) is at or above this threshold receive this reward. Set to 1001 to define rewards for unranked players (those outside the top 1000).
metadata string ~ 1024 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.
acquireActions List<AcquireAction> [] 0 ~ 100 items List of Acquire Actions
List of acquire actions executed when the player claims this ranking reward. These define the actual items, currency, or other resources granted as the reward for achieving this rank threshold.

VerifyActionResult

Verify Action execution result

Details
Type Condition Required Default Value Limits Description
action string (enum)
enum {
"Gs2Dictionary:VerifyEntryByUserId",
"Gs2Distributor:IfExpressionByUserId",
"Gs2Distributor:AndExpressionByUserId",
"Gs2Distributor:OrExpressionByUserId",
"Gs2Enchant:VerifyRarityParameterStatusByUserId",
"Gs2Experience:VerifyRankByUserId",
"Gs2Experience:VerifyRankCapByUserId",
"Gs2Grade:VerifyGradeByUserId",
"Gs2Grade:VerifyGradeUpMaterialByUserId",
"Gs2Guild:VerifyCurrentMaximumMemberCountByGuildName",
"Gs2Guild:VerifyIncludeMemberByUserId",
"Gs2Inventory:VerifyInventoryCurrentMaxCapacityByUserId",
"Gs2Inventory:VerifyItemSetByUserId",
"Gs2Inventory:VerifyReferenceOfByUserId",
"Gs2Inventory:VerifySimpleItemByUserId",
"Gs2Inventory:VerifyBigItemByUserId",
"Gs2Limit:VerifyCounterByUserId",
"Gs2Matchmaking:VerifyIncludeParticipantByUserId",
"Gs2Mission:VerifyCompleteByUserId",
"Gs2Mission:VerifyCounterValueByUserId",
"Gs2Ranking2:VerifyGlobalRankingScoreByUserId",
"Gs2Ranking2:VerifyClusterRankingScoreByUserId",
"Gs2Ranking2:VerifySubscribeRankingScoreByUserId",
"Gs2Schedule:VerifyTriggerByUserId",
"Gs2Schedule:VerifyEventByUserId",
"Gs2SerialKey:VerifyCodeByUserId",
"Gs2Stamina:VerifyStaminaValueByUserId",
"Gs2Stamina:VerifyStaminaMaxValueByUserId",
"Gs2Stamina:VerifyStaminaRecoverIntervalMinutesByUserId",
"Gs2Stamina:VerifyStaminaRecoverValueByUserId",
"Gs2Stamina:VerifyStaminaOverflowValueByUserId",
}
Type of Verify Action
verifyRequest string
~ 524288 chars JSON string of the request used when executing the action
statusCode int 0 ~ 999 Status code
verifyResult string ~ 1048576 chars Result content

ConsumeActionResult

Consume Action execution result

Details
Type Condition Required Default Value Limits Description
action string (enum)
enum {
"Gs2AdReward:ConsumePointByUserId",
"Gs2Dictionary:DeleteEntriesByUserId",
"Gs2Enhance:DeleteProgressByUserId",
"Gs2Exchange:DeleteAwaitByUserId",
"Gs2Experience:SubExperienceByUserId",
"Gs2Experience:SubRankCapByUserId",
"Gs2Formation:SubMoldCapacityByUserId",
"Gs2Grade:SubGradeByUserId",
"Gs2Guild:DecreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:DecreaseMaximumIdleMinutesByUserId",
"Gs2Inbox:OpenMessageByUserId",
"Gs2Inbox:DeleteMessageByUserId",
"Gs2Inventory:ConsumeItemSetByUserId",
"Gs2Inventory:ConsumeSimpleItemsByUserId",
"Gs2Inventory:ConsumeBigItemByUserId",
"Gs2JobQueue:DeleteJobByUserId",
"Gs2Limit:CountUpByUserId",
"Gs2LoginReward:MarkReceivedByUserId",
"Gs2Mission:ReceiveByUserId",
"Gs2Mission:BatchReceiveByUserId",
"Gs2Mission:DecreaseCounterByUserId",
"Gs2Mission:ResetCounterByUserId",
"Gs2Money:WithdrawByUserId",
"Gs2Money:RecordReceipt",
"Gs2Money2:WithdrawByUserId",
"Gs2Money2:VerifyReceiptByUserId",
"Gs2Quest:DeleteProgressByUserId",
"Gs2Ranking2:CreateGlobalRankingReceivedRewardByUserId",
"Gs2Ranking2:CreateClusterRankingReceivedRewardByUserId",
"Gs2Schedule:DeleteTriggerByUserId",
"Gs2SerialKey:UseByUserId",
"Gs2Showcase:IncrementPurchaseCountByUserId",
"Gs2SkillTree:MarkRestrainByUserId",
"Gs2Stamina:DecreaseMaxValueByUserId",
"Gs2Stamina:ConsumeStaminaByUserId",
}
Type of Consume Action
consumeRequest string
~ 524288 chars JSON string of the request used when executing the action
statusCode int 0 ~ 999 Status code
consumeResult string ~ 1048576 chars Result content

AcquireActionResult

Acquire Action execution result

Details
Type Condition Required Default Value Limits Description
action string (enum)
enum {
"Gs2AdReward:AcquirePointByUserId",
"Gs2Dictionary:AddEntriesByUserId",
"Gs2Enchant:ReDrawBalanceParameterStatusByUserId",
"Gs2Enchant:SetBalanceParameterStatusByUserId",
"Gs2Enchant:ReDrawRarityParameterStatusByUserId",
"Gs2Enchant:AddRarityParameterStatusByUserId",
"Gs2Enchant:SetRarityParameterStatusByUserId",
"Gs2Enhance:DirectEnhanceByUserId",
"Gs2Enhance:UnleashByUserId",
"Gs2Enhance:CreateProgressByUserId",
"Gs2Exchange:ExchangeByUserId",
"Gs2Exchange:IncrementalExchangeByUserId",
"Gs2Exchange:CreateAwaitByUserId",
"Gs2Exchange:AcquireForceByUserId",
"Gs2Exchange:SkipByUserId",
"Gs2Experience:AddExperienceByUserId",
"Gs2Experience:SetExperienceByUserId",
"Gs2Experience:AddRankCapByUserId",
"Gs2Experience:SetRankCapByUserId",
"Gs2Experience:MultiplyAcquireActionsByUserId",
"Gs2Formation:AddMoldCapacityByUserId",
"Gs2Formation:SetMoldCapacityByUserId",
"Gs2Formation:AcquireActionsToFormProperties",
"Gs2Formation:SetFormByUserId",
"Gs2Formation:AcquireActionsToPropertyFormProperties",
"Gs2Friend:UpdateProfileByUserId",
"Gs2Grade:AddGradeByUserId",
"Gs2Grade:ApplyRankCapByUserId",
"Gs2Grade:MultiplyAcquireActionsByUserId",
"Gs2Guild:IncreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Guild:SetMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:IncreaseMaximumIdleMinutesByUserId",
"Gs2Idle:SetMaximumIdleMinutesByUserId",
"Gs2Idle:ReceiveByUserId",
"Gs2Inbox:SendMessageByUserId",
"Gs2Inventory:AddCapacityByUserId",
"Gs2Inventory:SetCapacityByUserId",
"Gs2Inventory:AcquireItemSetByUserId",
"Gs2Inventory:AcquireItemSetWithGradeByUserId",
"Gs2Inventory:AddReferenceOfByUserId",
"Gs2Inventory:DeleteReferenceOfByUserId",
"Gs2Inventory:AcquireSimpleItemsByUserId",
"Gs2Inventory:SetSimpleItemsByUserId",
"Gs2Inventory:AcquireBigItemByUserId",
"Gs2Inventory:SetBigItemByUserId",
"Gs2JobQueue:PushByUserId",
"Gs2Limit:CountDownByUserId",
"Gs2Limit:DeleteCounterByUserId",
"Gs2LoginReward:DeleteReceiveStatusByUserId",
"Gs2LoginReward:UnmarkReceivedByUserId",
"Gs2Lottery:DrawByUserId",
"Gs2Lottery:ResetBoxByUserId",
"Gs2Mission:RevertReceiveByUserId",
"Gs2Mission:IncreaseCounterByUserId",
"Gs2Mission:SetCounterByUserId",
"Gs2Money:DepositByUserId",
"Gs2Money:RevertRecordReceipt",
"Gs2Money2:DepositByUserId",
"Gs2Quest:CreateProgressByUserId",
"Gs2Schedule:TriggerByUserId",
"Gs2Schedule:ExtendTriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
Type of Acquire Action
acquireRequest string
~ 524288 chars JSON string of the request used when executing the action
statusCode int 0 ~ 999 Status code
acquireResult string ~ 1048576 chars Result content

TransactionResult

Transaction execution result

Result of a transaction executed using the server-side automatic execution feature

Details
Type Condition Required Default Value Limits Description
transactionId string
36 ~ 36 chars Transaction ID
verifyResults List<VerifyActionResult> 0 ~ 10 items List of verify action execution results
consumeResults List<ConsumeActionResult> [] 0 ~ 10 items List of Consume Action execution results
acquireResults List<AcquireActionResult> [] 0 ~ 100 items List of Acquire Action execution results
hasError bool false Whether an error occurred during transaction execution

AcquireAction

Acquire Action

Details
Type Condition Required Default Value Limits Description
action string (enum)
enum {
"Gs2AdReward:AcquirePointByUserId",
"Gs2Dictionary:AddEntriesByUserId",
"Gs2Enchant:ReDrawBalanceParameterStatusByUserId",
"Gs2Enchant:SetBalanceParameterStatusByUserId",
"Gs2Enchant:ReDrawRarityParameterStatusByUserId",
"Gs2Enchant:AddRarityParameterStatusByUserId",
"Gs2Enchant:SetRarityParameterStatusByUserId",
"Gs2Enhance:DirectEnhanceByUserId",
"Gs2Enhance:UnleashByUserId",
"Gs2Enhance:CreateProgressByUserId",
"Gs2Exchange:ExchangeByUserId",
"Gs2Exchange:IncrementalExchangeByUserId",
"Gs2Exchange:CreateAwaitByUserId",
"Gs2Exchange:AcquireForceByUserId",
"Gs2Exchange:SkipByUserId",
"Gs2Experience:AddExperienceByUserId",
"Gs2Experience:SetExperienceByUserId",
"Gs2Experience:AddRankCapByUserId",
"Gs2Experience:SetRankCapByUserId",
"Gs2Experience:MultiplyAcquireActionsByUserId",
"Gs2Formation:AddMoldCapacityByUserId",
"Gs2Formation:SetMoldCapacityByUserId",
"Gs2Formation:AcquireActionsToFormProperties",
"Gs2Formation:SetFormByUserId",
"Gs2Formation:AcquireActionsToPropertyFormProperties",
"Gs2Friend:UpdateProfileByUserId",
"Gs2Grade:AddGradeByUserId",
"Gs2Grade:ApplyRankCapByUserId",
"Gs2Grade:MultiplyAcquireActionsByUserId",
"Gs2Guild:IncreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Guild:SetMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:IncreaseMaximumIdleMinutesByUserId",
"Gs2Idle:SetMaximumIdleMinutesByUserId",
"Gs2Idle:ReceiveByUserId",
"Gs2Inbox:SendMessageByUserId",
"Gs2Inventory:AddCapacityByUserId",
"Gs2Inventory:SetCapacityByUserId",
"Gs2Inventory:AcquireItemSetByUserId",
"Gs2Inventory:AcquireItemSetWithGradeByUserId",
"Gs2Inventory:AddReferenceOfByUserId",
"Gs2Inventory:DeleteReferenceOfByUserId",
"Gs2Inventory:AcquireSimpleItemsByUserId",
"Gs2Inventory:SetSimpleItemsByUserId",
"Gs2Inventory:AcquireBigItemByUserId",
"Gs2Inventory:SetBigItemByUserId",
"Gs2JobQueue:PushByUserId",
"Gs2Limit:CountDownByUserId",
"Gs2Limit:DeleteCounterByUserId",
"Gs2LoginReward:DeleteReceiveStatusByUserId",
"Gs2LoginReward:UnmarkReceivedByUserId",
"Gs2Lottery:DrawByUserId",
"Gs2Lottery:ResetBoxByUserId",
"Gs2Mission:RevertReceiveByUserId",
"Gs2Mission:IncreaseCounterByUserId",
"Gs2Mission:SetCounterByUserId",
"Gs2Money:DepositByUserId",
"Gs2Money:RevertRecordReceipt",
"Gs2Money2:DepositByUserId",
"Gs2Quest:CreateProgressByUserId",
"Gs2Schedule:TriggerByUserId",
"Gs2Schedule:ExtendTriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
Type of Acquire Action
request string
~ 524288 chars JSON string of the request used when executing the action

Config

Configuration

Configuration values applied to transaction variables

Details
Type Condition Required Default Value Limits Description
key string
~ 64 chars Name
value string ~ 51200 chars Value

CurrentRankingMaster

Currently active Ranking Model master data

This master data defines the Ranking Models currently active within the namespace. GS2 uses JSON format files for managing master data. By uploading these files, the master data 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.

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

GlobalRankingModelMaster

Global Ranking Model Master

Global Ranking Model Master is data used to edit and manage global ranking model 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 global ranking model actually referenced by the game.

The global ranking model is a model that allows you to create a ranking that targets all players. You can display the top 1000 rankings.

By associating it with the repeat event of GS2-Schedule, you can reset the ranking according to the number of repetitions.

Details
Type Condition Required Default Value Limits Description
globalRankingModelId string
*
~ 1024 chars Global Ranking Master GRN
* Set automatically by the server
name string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 1024 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.
minimumValue long 0 ~ 9223372036854775805 Minimum Score
The minimum allowed score value. Scores below this value will be rejected when submitted. Used to filter out invalid or unintended score values.
maximumValue long 0 ~ 9223372036854775805 Maximum Score
The maximum allowed score value. Scores above this value will be rejected when submitted. Used to prevent abnormally high scores from being registered.
sum bool false Sum Scores
When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score (highest or lowest depending on sort direction) is used for ranking.
orderDirection string (enum)
enum {
  “asc”,
  “desc”
}
Order Direction
The sort direction for ranking scores. Use “asc” for rankings where lower scores are better (e.g., time trials), or “desc” for rankings where higher scores are better (e.g., high scores).
DefinitionDescription
“asc”ascending-order
“desc”descending-order
entryPeriodEventId string ~ 1024 chars Entry Period Event GRN
GS2-Schedule event GRN that defines the period during which scores can be submitted. When linked to a repeating event, the ranking resets with each repeat cycle, enabling seasonal rankings.
rankingRewards List<RankingReward> {entryPeriodEventId} != null [] 0 ~ 100 items Ranking Rewards
List of rewards granted based on ranking position at the end of each season. Only available when an entry period event is configured. Each reward defines a rank threshold and the acquire actions to execute.
accessPeriodEventId string ~ 1024 chars Access Period Event GRN
GS2-Schedule event GRN that defines the period during which ranking results can be viewed and rewards can be claimed. Typically set to the interval between score entry periods.
rewardCalculationIndex string (enum)
enum {
  “rank”,
  “index”
}
“rank” Reward Calculation Index
Determines how rewards are matched to players. “rank” uses the 1-based ranking position (players with tied scores share the same rank), while “index” uses the 0-based unique sorted position (no ties). Choose “rank” for most typical use cases.
DefinitionDescription
“rank”Determine rewards based on rank
“index”Determine rewards based on index
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

ClusterRankingModelMaster

Cluster Ranking Model Master

Cluster Ranking Model Master is data used to edit and manage cluster ranking model 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 cluster ranking model actually referenced by the game.

The cluster ranking model is a model for realizing rankings targeting players in guilds or gatherings. You can display the top 1000 rankings.

By associating it with the repeat event of GS2-Schedule, you can reset the ranking according to the number of repetitions.

Details
Type Condition Required Default Value Limits Description
clusterRankingModelId string
*
~ 1024 chars Cluster Ranking Master GRN
* Set automatically by the server
name string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 1024 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.
clusterType string (enum)
enum {
  “Raw”,
  “Gs2Guild::Guild”,
  “Gs2Matchmaking::SeasonGathering”
}
Cluster Type
Defines the type of group (cluster) used for ranking segmentation. “Raw” allows arbitrary cluster names without membership verification, “Gs2Guild::Guild” verifies the user belongs to a GS2-Guild guild, and “Gs2Matchmaking::SeasonGathering” verifies membership in a GS2-Matchmaking season gathering.
DefinitionDescription
“Raw”No verification
“Gs2Guild::Guild”GS2-Guild Guild
“Gs2Matchmaking::SeasonGathering”GS2-Matchmaking Season Gathering
minimumValue long 0 ~ 9223372036854775805 Minimum Score
The minimum allowed score value. Scores below this value will be rejected when submitted.
maximumValue long 0 ~ 9223372036854775805 Maximum Score
The maximum allowed score value. Scores above this value will be rejected when submitted.
sum bool false Sum Scores
When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score is used for ranking.
orderDirection string (enum)
enum {
  “asc”,
  “desc”
}
Order Direction
The sort direction for ranking scores. Use “asc” for lower-is-better rankings, or “desc” for higher-is-better rankings.
DefinitionDescription
“asc”ascending-order
“desc”descending-order
entryPeriodEventId string ~ 1024 chars Entry Period Event GRN
GS2-Schedule event GRN that defines the period during which scores can be submitted. When linked to a repeating event, the ranking resets with each repeat cycle, enabling seasonal rankings.
rankingRewards List<RankingReward> {entryPeriodEventId} != null [] 0 ~ 100 items Ranking Rewards
List of rewards granted based on ranking position at the end of each season. Only available when an entry period event is configured.
accessPeriodEventId string ~ 1024 chars Access Period Event GRN
GS2-Schedule event GRN that defines the period during which ranking results can be viewed and rewards can be claimed.
rewardCalculationIndex string (enum)
enum {
  “rank”,
  “index”
}
“rank” Reward Calculation Index
Determines how rewards are matched to players. “rank” uses the 1-based ranking position (tied scores share same rank), “index” uses the 0-based unique sorted position (no ties).
DefinitionDescription
“rank”Determine rewards based on rank
“index”Determine rewards based on index
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
Unix time, milliseconds
* Set automatically by the server
revision long 0 0 ~ 9223372036854775805 Revision

SubscribeRankingModelMaster

Subscribe Ranking Model Master

Subscribe Ranking Model Master is data used to edit and manage subscribe ranking model 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 subscribe ranking model actually referenced by the game.

The Subscription Ranking Model that aggregates scores of other players that the user has subscribed to and creates a ranking.

Details
Type Condition Required Default Value Limits Description
subscribeRankingModelId string
*
~ 1024 chars Subscribe Ranking Master GRN
* Set automatically by the server
name string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 1024 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.
minimumValue long 0 ~ 9223372036854775805 Minimum Score
The minimum allowed score value. Scores below this value will be rejected when submitted.
maximumValue long 0 ~ 9223372036854775805 Maximum Score
The maximum allowed score value. Scores above this value will be rejected when submitted.
sum bool false Sum Scores
When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score is used for ranking.
orderDirection string (enum)
enum {
  “asc”,
  “desc”
}
Order Direction
The sort direction for ranking scores. Use “asc” for lower-is-better rankings, or “desc” for higher-is-better rankings.
DefinitionDescription
“asc”ascending-order
“desc”descending-order
entryPeriodEventId string ~ 1024 chars Entry Period Event GRN
GS2-Schedule event GRN that defines the period during which scores can be submitted. When linked to a repeating event, the ranking resets with each repeat cycle, enabling seasonal rankings.
accessPeriodEventId string ~ 1024 chars Access Period Event GRN
GS2-Schedule event GRN that defines the period during which ranking results can be viewed.
createdAt long
*
Current time Creation Timestamp
Unix time, milliseconds
* Set automatically by the server
updatedAt long
*
Current time Last Updated Timestamp
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 Namespaces
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeNamespaces(
    &ranking2.DescribeNamespacesRequest {
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeNamespacesRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeNamespacesRequest;
import io.gs2.ranking2.result.DescribeNamespacesResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Ranking2RestClient client = new Gs2Ranking2RestClient(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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeNamespacesResult> asyncResult = null;
yield return client.DescribeNamespaces(
    new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

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

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

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

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('ranking2')

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
Settings for distributed transactions used to grant ranking rewards. Supports auto-run to automatically execute transactions and atomic commit for all-or-nothing guarantee.
logSetting LogSetting Log Output Setting
Specifies the GS2-Log namespace for outputting API request and response logs. Used for tracking score submissions and ranking reward distributions.

Result

Type Description
item Namespace Namespace created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateNamespace(
    &ranking2.CreateNamespaceRequest {
        Name: pointy.String("namespace-0001"),
        Description: nil,
        TransactionSetting: nil,
        LogSetting: &ranking2.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateNamespaceRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createNamespace(
        (new CreateNamespaceRequest())
            ->withName("namespace-0001")
            ->withDescription(null)
            ->withTransactionSetting(null)
            ->withLogSetting((new \Gs2\Ranking2\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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateNamespaceRequest;
import io.gs2.ranking2.result.CreateNamespaceResult;

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

try {
    CreateNamespaceResult result = client.createNamespace(
        new CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withLogSetting(new io.gs2.ranking2.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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateNamespaceResult> asyncResult = null;
yield return client.CreateNamespace(
    new Gs2.Gs2Ranking2.Request.CreateNamespaceRequest()
        .WithName("namespace-0001")
        .WithDescription(null)
        .WithTransactionSetting(null)
        .WithLogSetting(new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createNamespace(
        new Gs2Ranking2.CreateNamespaceRequest()
            .withName("namespace-0001")
            .withDescription(null)
            .withTransactionSetting(null)
            .withLogSetting(new Gs2Ranking2.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 ranking2

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

try:
    result = client.create_namespace(
        ranking2.CreateNamespaceRequest()
            .with_name('namespace-0001')
            .with_description(None)
            .with_transaction_setting(None)
            .with_log_setting(
                ranking2.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('ranking2')

api_result = client.create_namespace({
    name="namespace-0001",
    description=nil,
    transactionSetting=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('ranking2')

api_result_handler = client.create_namespace_async({
    name="namespace-0001",
    description=nil,
    transactionSetting=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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetNamespaceStatus(
    &ranking2.GetNamespaceStatusRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetNamespaceStatusRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetNamespaceStatusRequest;
import io.gs2.ranking2.result.GetNamespaceStatusResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Ranking2RestClient client = new Gs2Ranking2RestClient(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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetNamespaceStatusResult> asyncResult = null;
yield return client.GetNamespaceStatus(
    new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getNamespaceStatus(
        new Gs2Ranking2.GetNamespaceStatusRequest()
            .withNamespaceName("namespace-0001")
    );
    const status = result.getStatus();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_namespace_status(
        ranking2.GetNamespaceStatusRequest()
            .with_namespace_name('namespace-0001')
    )
    status = result.status
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

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('ranking2')

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 a 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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetNamespace(
    &ranking2.GetNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetNamespaceRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetNamespaceRequest;
import io.gs2.ranking2.result.GetNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Ranking2RestClient client = new Gs2Ranking2RestClient(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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetNamespaceResult> asyncResult = null;
yield return client.GetNamespace(
    new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getNamespace(
        new Gs2Ranking2.GetNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_namespace(
        ranking2.GetNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

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('ranking2')

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 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 (.).
description string ~ 1024 chars Description
transactionSetting TransactionSetting
Transaction Setting
Settings for distributed transactions used to grant ranking rewards. Supports auto-run to automatically execute transactions and atomic commit for all-or-nothing guarantee.
logSetting LogSetting Log Output Setting
Specifies the GS2-Log namespace for outputting API request and response logs. Used for tracking score submissions and ranking reward distributions.

Result

Type Description
item Namespace Namespace updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.UpdateNamespace(
    &ranking2.UpdateNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Description: pointy.String("description1"),
        TransactionSetting: nil,
        LogSetting: &ranking2.LogSetting{
            LoggingNamespaceId: pointy.String("grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"),
        },
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\UpdateNamespaceRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->updateNamespace(
        (new UpdateNamespaceRequest())
            ->withNamespaceName("namespace-0001")
            ->withDescription("description1")
            ->withTransactionSetting(null)
            ->withLogSetting((new \Gs2\Ranking2\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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.UpdateNamespaceRequest;
import io.gs2.ranking2.result.UpdateNamespaceResult;

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

try {
    UpdateNamespaceResult result = client.updateNamespace(
        new UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withLogSetting(new io.gs2.ranking2.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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.UpdateNamespaceResult> asyncResult = null;
yield return client.UpdateNamespace(
    new Gs2.Gs2Ranking2.Request.UpdateNamespaceRequest()
        .WithNamespaceName("namespace-0001")
        .WithDescription("description1")
        .WithTransactionSetting(null)
        .WithLogSetting(new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.updateNamespace(
        new Gs2Ranking2.UpdateNamespaceRequest()
            .withNamespaceName("namespace-0001")
            .withDescription("description1")
            .withTransactionSetting(null)
            .withLogSetting(new Gs2Ranking2.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 ranking2

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

try:
    result = client.update_namespace(
        ranking2.UpdateNamespaceRequest()
            .with_namespace_name('namespace-0001')
            .with_description('description1')
            .with_transaction_setting(None)
            .with_log_setting(
                ranking2.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('ranking2')

api_result = client.update_namespace({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=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('ranking2')

api_result_handler = client.update_namespace_async({
    namespaceName="namespace-0001",
    description="description1",
    transactionSetting=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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteNamespace(
    &ranking2.DeleteNamespaceRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteNamespaceRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteNamespaceRequest;
import io.gs2.ranking2.result.DeleteNamespaceResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Ranking2RestClient client = new Gs2Ranking2RestClient(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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteNamespaceResult> asyncResult = null;
yield return client.DeleteNamespace(
    new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteNamespace(
        new Gs2Ranking2.DeleteNamespaceRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_namespace(
        ranking2.DeleteNamespaceRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

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('ranking2')

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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetServiceVersion(
    &ranking2.GetServiceVersionRequest {
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetServiceVersionRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetServiceVersionRequest;
import io.gs2.ranking2.result.GetServiceVersionResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Ranking2RestClient client = new Gs2Ranking2RestClient(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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetServiceVersionResult> asyncResult = null;
yield return client.GetServiceVersion(
    new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getServiceVersion(
        new Gs2Ranking2.GetServiceVersionRequest()
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_service_version(
        ranking2.GetServiceVersionRequest()
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

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('ranking2')

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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DumpUserDataByUserId(
    &ranking2.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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DumpUserDataByUserIdRequest;
import io.gs2.ranking2.result.DumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Ranking2RestClient client = new Gs2Ranking2RestClient(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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DumpUserDataByUserIdResult> asyncResult = null;
yield return client.DumpUserDataByUserId(
    new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.dumpUserDataByUserId(
        new Gs2Ranking2.DumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.dump_user_data_by_user_id(
        ranking2.DumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

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.result
client = gs2('ranking2')

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.result

checkDumpUserDataByUserId

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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CheckDumpUserDataByUserId(
    &ranking2.CheckDumpUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CheckDumpUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CheckDumpUserDataByUserIdRequest;
import io.gs2.ranking2.result.CheckDumpUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Ranking2RestClient client = new Gs2Ranking2RestClient(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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CheckDumpUserDataByUserIdResult> asyncResult = null;
yield return client.CheckDumpUserDataByUserId(
    new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.checkDumpUserDataByUserId(
        new Gs2Ranking2.CheckDumpUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
    const url = result.getUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.check_dump_user_data_by_user_id(
        ranking2.CheckDumpUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
    url = result.url
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

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('ranking2')

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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CleanUserDataByUserId(
    &ranking2.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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CleanUserDataByUserIdRequest;
import io.gs2.ranking2.result.CleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Ranking2RestClient client = new Gs2Ranking2RestClient(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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CleanUserDataByUserIdResult> asyncResult = null;
yield return client.CleanUserDataByUserId(
    new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.cleanUserDataByUserId(
        new Gs2Ranking2.CleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.clean_user_data_by_user_id(
        ranking2.CleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

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.result
client = gs2('ranking2')

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.result

checkCleanUserDataByUserId

Check if the clean 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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CheckCleanUserDataByUserId(
    &ranking2.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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CheckCleanUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CheckCleanUserDataByUserIdRequest;
import io.gs2.ranking2.result.CheckCleanUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Ranking2RestClient client = new Gs2Ranking2RestClient(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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CheckCleanUserDataByUserIdResult> asyncResult = null;
yield return client.CheckCleanUserDataByUserId(
    new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.checkCleanUserDataByUserId(
        new Gs2Ranking2.CheckCleanUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.check_clean_user_data_by_user_id(
        ranking2.CheckCleanUserDataByUserIdRequest()
            .with_user_id('user-0001')
            .with_time_offset_token(None)
    )
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

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.result
client = gs2('ranking2')

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.result

prepareImportUserDataByUserId

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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PrepareImportUserDataByUserId(
    &ranking2.PrepareImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PrepareImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PrepareImportUserDataByUserIdRequest;
import io.gs2.ranking2.result.PrepareImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Ranking2RestClient client = new Gs2Ranking2RestClient(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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PrepareImportUserDataByUserIdResult> asyncResult = null;
yield return client.PrepareImportUserDataByUserId(
    new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.prepareImportUserDataByUserId(
        new Gs2Ranking2.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 ranking2

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

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

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('ranking2')

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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.ImportUserDataByUserId(
    &ranking2.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\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\ImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.ImportUserDataByUserIdRequest;
import io.gs2.ranking2.result.ImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Ranking2RestClient client = new Gs2Ranking2RestClient(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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.ImportUserDataByUserIdResult> asyncResult = null;
yield return client.ImportUserDataByUserId(
    new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.importUserDataByUserId(
        new Gs2Ranking2.ImportUserDataByUserIdRequest()
            .withUserId("user-0001")
            .withUploadToken("upload-0001")
            .withTimeOffsetToken(null)
    );
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

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

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.result
client = gs2('ranking2')

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.result

checkImportUserDataByUserId

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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CheckImportUserDataByUserId(
    &ranking2.CheckImportUserDataByUserIdRequest {
        UserId: pointy.String("user-0001"),
        UploadToken: pointy.String("upload-0001"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
url := result.Url
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CheckImportUserDataByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CheckImportUserDataByUserIdRequest;
import io.gs2.ranking2.result.CheckImportUserDataByUserIdResult;

Gs2RestSession session = new Gs2RestSession(
    Region.AP_NORTHEAST_1,
    new BasicGs2Credential(
        "your client id",
        "your client secret"
    )
);
session.connect();
Gs2Ranking2RestClient client = new Gs2Ranking2RestClient(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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CheckImportUserDataByUserIdResult> asyncResult = null;
yield return client.CheckImportUserDataByUserId(
    new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.checkImportUserDataByUserId(
        new Gs2Ranking2.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 ranking2

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

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

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('ranking2')

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;

describeGlobalRankingScores

Get a list of Global Ranking Scores

Retrieves a paginated list of global ranking scores registered by the requesting user. Can filter by ranking name.

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
rankingName string ~ 128 chars Global Ranking Model name
Global Ranking Model-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<GlobalRankingScore> List of Global Ranking Scores
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankingScores(
    &ranking2.DescribeGlobalRankingScoresRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingScoresRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankingScores(
        (new DescribeGlobalRankingScoresRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingScoresRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingScoresResult;

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

try {
    DescribeGlobalRankingScoresResult result = client.describeGlobalRankingScores(
        new DescribeGlobalRankingScoresRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<GlobalRankingScore> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingScoresResult> asyncResult = null;
yield return client.DescribeGlobalRankingScores(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingScoresRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankingScores(
        new Gs2Ranking2.DescribeGlobalRankingScoresRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-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 ranking2

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

try:
    result = client.describe_global_ranking_scores(
        ranking2.DescribeGlobalRankingScoresRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-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('ranking2')

api_result = client.describe_global_ranking_scores({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-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('ranking2')

api_result_handler = client.describe_global_ranking_scores_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-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;

describeGlobalRankingScoresByUserId

Get a list of Global Ranking Scores by specifying a user ID

Retrieves a paginated list of global ranking scores registered by the specified user. Can filter by ranking name.

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
rankingName string ~ 128 chars Global Ranking Model name
Global Ranking Model-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
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
items List<GlobalRankingScore> List of Global Ranking Scores
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankingScoresByUserId(
    &ranking2.DescribeGlobalRankingScoresByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingScoresByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankingScoresByUserId(
        (new DescribeGlobalRankingScoresByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName(null)
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingScoresByUserIdRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingScoresByUserIdResult;

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

try {
    DescribeGlobalRankingScoresByUserIdResult result = client.describeGlobalRankingScoresByUserId(
        new DescribeGlobalRankingScoresByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<GlobalRankingScore> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingScoresByUserIdResult> asyncResult = null;
yield return client.DescribeGlobalRankingScoresByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingScoresByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName(null)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankingScoresByUserId(
        new Gs2Ranking2.DescribeGlobalRankingScoresByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName(null)
            .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 ranking2

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

try:
    result = client.describe_global_ranking_scores_by_user_id(
        ranking2.DescribeGlobalRankingScoresByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name(None)
            .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('ranking2')

api_result = client.describe_global_ranking_scores_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName=nil,
    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('ranking2')

api_result_handler = client.describe_global_ranking_scores_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName=nil,
    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;

putGlobalRankingScore

Register Global Ranking Score

Registers a score for the specified global ranking. The score must be within the range defined by the ranking model. If the entry period event is configured, scores can only be registered during the active period.

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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
score long
0 ~ 9223372036854775805 Score
The score value submitted by the user. Must be within the range defined by the ranking model’s minimumValue and maximumValue settings.
metadata string ~ 512 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.

Result

Type Description
item GlobalRankingScore Registered Global Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PutGlobalRankingScore(
    &ranking2.PutGlobalRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Score: pointy.Int64(100),
        Metadata: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PutGlobalRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->putGlobalRankingScore(
        (new PutGlobalRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withScore(100)
            ->withMetadata(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PutGlobalRankingScoreRequest;
import io.gs2.ranking2.result.PutGlobalRankingScoreResult;

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

try {
    PutGlobalRankingScoreResult result = client.putGlobalRankingScore(
        new PutGlobalRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withScore(100L)
            .withMetadata(null)
    );
    GlobalRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PutGlobalRankingScoreResult> asyncResult = null;
yield return client.PutGlobalRankingScore(
    new Gs2.Gs2Ranking2.Request.PutGlobalRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithScore(100L)
        .WithMetadata(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.putGlobalRankingScore(
        new Gs2Ranking2.PutGlobalRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withScore(100)
            .withMetadata(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.put_global_ranking_score(
        ranking2.PutGlobalRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_score(100)
            .with_metadata(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.put_global_ranking_score({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    score=100,
    metadata=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('ranking2')

api_result_handler = client.put_global_ranking_score_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    score=100,
    metadata=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;

putGlobalRankingScoreByUserId

Register Global Ranking Score specifying User ID

Registers a score for the specified global ranking on behalf of the specified user. The score must be within the range defined by the ranking model.

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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
score long
0 ~ 9223372036854775805 Score
The score value submitted by the user. Must be within the range defined by the ranking model’s minimumValue and maximumValue settings.
metadata string ~ 512 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.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item GlobalRankingScore Registered Global Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PutGlobalRankingScoreByUserId(
    &ranking2.PutGlobalRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Score: nil,
        Metadata: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PutGlobalRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->putGlobalRankingScoreByUserId(
        (new PutGlobalRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withScore(null)
            ->withMetadata(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PutGlobalRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.PutGlobalRankingScoreByUserIdResult;

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

try {
    PutGlobalRankingScoreByUserIdResult result = client.putGlobalRankingScoreByUserId(
        new PutGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withScore(null)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    GlobalRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PutGlobalRankingScoreByUserIdResult> asyncResult = null;
yield return client.PutGlobalRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.PutGlobalRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithScore(null)
        .WithMetadata(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.putGlobalRankingScoreByUserId(
        new Gs2Ranking2.PutGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withScore(null)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.put_global_ranking_score_by_user_id(
        ranking2.PutGlobalRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_score(None)
            .with_metadata(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.put_global_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    score=nil,
    metadata=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('ranking2')

api_result_handler = client.put_global_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    score=nil,
    metadata=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;

getGlobalRankingScore

Get Global Ranking Score

Retrieves the global ranking score registered by the requesting user for the specified ranking. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
season long 0 ~ 9223372036854775805 Season

Result

Type Description
item GlobalRankingScore Global Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRankingScore(
    &ranking2.GetGlobalRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: pointy.Int64(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRankingScore(
        (new GetGlobalRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingScoreRequest;
import io.gs2.ranking2.result.GetGlobalRankingScoreResult;

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

try {
    GetGlobalRankingScoreResult result = client.getGlobalRankingScore(
        new GetGlobalRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0L)
    );
    GlobalRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingScoreResult> asyncResult = null;
yield return client.GetGlobalRankingScore(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(0L),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRankingScore(
        new Gs2Ranking2.GetGlobalRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking_score(
        ranking2.GetGlobalRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_global_ranking_score({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.get_global_ranking_score_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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;

getGlobalRankingScoreByUserId

Get Global Ranking Score specifying User ID

Retrieves the global ranking score registered by the specified user for the specified ranking. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
season long 0 ~ 9223372036854775805 Season
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item GlobalRankingScore Global Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRankingScoreByUserId(
    &ranking2.GetGlobalRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRankingScoreByUserId(
        (new GetGlobalRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.GetGlobalRankingScoreByUserIdResult;

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

try {
    GetGlobalRankingScoreByUserIdResult result = client.getGlobalRankingScoreByUserId(
        new GetGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    GlobalRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingScoreByUserIdResult> asyncResult = null;
yield return client.GetGlobalRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRankingScoreByUserId(
        new Gs2Ranking2.GetGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking_score_by_user_id(
        ranking2.GetGlobalRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_global_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.get_global_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

deleteGlobalRankingScoreByUserId

Delete Global Ranking Score specifying User ID

Deletes the global ranking score registered by the specified user for the specified ranking and season.

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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
season long 0 ~ 9223372036854775805 Season
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item GlobalRankingScore Global Ranking Score deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteGlobalRankingScoreByUserId(
    &ranking2.DeleteGlobalRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteGlobalRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteGlobalRankingScoreByUserId(
        (new DeleteGlobalRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteGlobalRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.DeleteGlobalRankingScoreByUserIdResult;

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

try {
    DeleteGlobalRankingScoreByUserIdResult result = client.deleteGlobalRankingScoreByUserId(
        new DeleteGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    GlobalRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteGlobalRankingScoreByUserIdResult> asyncResult = null;
yield return client.DeleteGlobalRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.DeleteGlobalRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteGlobalRankingScoreByUserId(
        new Gs2Ranking2.DeleteGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_global_ranking_score_by_user_id(
        ranking2.DeleteGlobalRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.delete_global_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.delete_global_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

verifyGlobalRankingScore

Verify the score of the global ranking

Verifies the global ranking score against a specified value using comparison operators (less, lessEqual, greater, greaterEqual, equal, notEqual). Can optionally specify a season.

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
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Score is less than the specified value
“lessEqual”Score is less than or equal to the specified value
“greater”Score is greater than the specified value
“greaterEqual”Score is greater than or equal to the specified value
“equal”Score is equal to the specified value
“notEqual”Score is not equal to the specified value
season long 0 ~ 9223372036854775805 Season
score long
0 ~ 9223372036854775805 Score
The score value submitted by the user. Must be within the range defined by the ranking model’s minimumValue and maximumValue settings.
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity

Result

Type Description
item GlobalRankingScore Global Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.VerifyGlobalRankingScore(
    &ranking2.VerifyGlobalRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        VerifyType: pointy.String("less"),
        Season: nil,
        Score: pointy.Int64(100),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\VerifyGlobalRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->verifyGlobalRankingScore(
        (new VerifyGlobalRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withVerifyType("less")
            ->withSeason(null)
            ->withScore(100)
            ->withMultiplyValueSpecifyingQuantity(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.VerifyGlobalRankingScoreRequest;
import io.gs2.ranking2.result.VerifyGlobalRankingScoreResult;

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

try {
    VerifyGlobalRankingScoreResult result = client.verifyGlobalRankingScore(
        new VerifyGlobalRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100L)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    GlobalRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.VerifyGlobalRankingScoreResult> asyncResult = null;
yield return client.VerifyGlobalRankingScore(
    new Gs2.Gs2Ranking2.Request.VerifyGlobalRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithVerifyType("less")
        .WithSeason(null)
        .WithScore(100L)
        .WithMultiplyValueSpecifyingQuantity(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.verifyGlobalRankingScore(
        new Gs2Ranking2.VerifyGlobalRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.verify_global_ranking_score(
        ranking2.VerifyGlobalRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_verify_type('less')
            .with_season(None)
            .with_score(100)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.verify_global_ranking_score({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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('ranking2')

api_result_handler = client.verify_global_ranking_score_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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;

verifyGlobalRankingScoreByUserId

Verify the score of the global ranking specifying User ID

Verifies the global ranking score of the specified user against a specified value using comparison operators (less, lessEqual, greater, greaterEqual, equal, notEqual).

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
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Score is less than the specified value
“lessEqual”Score is less than or equal to the specified value
“greater”Score is greater than the specified value
“greaterEqual”Score is greater than or equal to the specified value
“equal”Score is equal to the specified value
“notEqual”Score is not equal to the specified value
season long 0 ~ 9223372036854775805 Season
score long
0 ~ 9223372036854775805 Score
The score value submitted by the user. Must be within the range defined by the ranking model’s minimumValue and maximumValue settings.
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item GlobalRankingScore Global Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.VerifyGlobalRankingScoreByUserId(
    &ranking2.VerifyGlobalRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        VerifyType: pointy.String("less"),
        Season: nil,
        Score: pointy.Int64(100),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\VerifyGlobalRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->verifyGlobalRankingScoreByUserId(
        (new VerifyGlobalRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withVerifyType("less")
            ->withSeason(null)
            ->withScore(100)
            ->withMultiplyValueSpecifyingQuantity(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.VerifyGlobalRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.VerifyGlobalRankingScoreByUserIdResult;

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

try {
    VerifyGlobalRankingScoreByUserIdResult result = client.verifyGlobalRankingScoreByUserId(
        new VerifyGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100L)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    GlobalRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.VerifyGlobalRankingScoreByUserIdResult> asyncResult = null;
yield return client.VerifyGlobalRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.VerifyGlobalRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithVerifyType("less")
        .WithSeason(null)
        .WithScore(100L)
        .WithMultiplyValueSpecifyingQuantity(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.verifyGlobalRankingScoreByUserId(
        new Gs2Ranking2.VerifyGlobalRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.verify_global_ranking_score_by_user_id(
        ranking2.VerifyGlobalRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_verify_type('less')
            .with_season(None)
            .with_score(100)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.verify_global_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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('ranking2')

api_result_handler = client.verify_global_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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;

describeGlobalRankingReceivedRewards

Get a list of Global Ranking Rewards Received

Retrieves a paginated list of global ranking reward receipt history for the requesting user. Can filter by ranking name and season.

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
rankingName string ~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long 0 ~ 9223372036854775805 Season
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<GlobalRankingReceivedReward> List of Global Ranking Rewards Received
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankingReceivedRewards(
    &ranking2.DescribeGlobalRankingReceivedRewardsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: pointy.Int64(0),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingReceivedRewardsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankingReceivedRewards(
        (new DescribeGlobalRankingReceivedRewardsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(0)
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingReceivedRewardsRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingReceivedRewardsResult;

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

try {
    DescribeGlobalRankingReceivedRewardsResult result = client.describeGlobalRankingReceivedRewards(
        new DescribeGlobalRankingReceivedRewardsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(0L)
            .withPageToken(null)
            .withLimit(null)
    );
    List<GlobalRankingReceivedReward> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingReceivedRewardsResult> asyncResult = null;
yield return client.DescribeGlobalRankingReceivedRewards(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingReceivedRewardsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankingReceivedRewards(
        new Gs2Ranking2.DescribeGlobalRankingReceivedRewardsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(0)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_global_ranking_received_rewards(
        ranking2.DescribeGlobalRankingReceivedRewardsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_season(0)
            .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('ranking2')

api_result = client.describe_global_ranking_received_rewards({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=0,
    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('ranking2')

api_result_handler = client.describe_global_ranking_received_rewards_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=0,
    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;

describeGlobalRankingReceivedRewardsByUserId

Get a list of Global Ranking Rewards Received by specifying a user ID

Retrieves a paginated list of global ranking reward receipt history for the specified user. Can filter by ranking name and season.

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
rankingName string ~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long 0 ~ 9223372036854775805 Season
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<GlobalRankingReceivedReward> List of Global Ranking Rewards Received
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankingReceivedRewardsByUserId(
    &ranking2.DescribeGlobalRankingReceivedRewardsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingReceivedRewardsByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankingReceivedRewardsByUserId(
        (new DescribeGlobalRankingReceivedRewardsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(null)
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingReceivedRewardsByUserIdRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingReceivedRewardsByUserIdResult;

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

try {
    DescribeGlobalRankingReceivedRewardsByUserIdResult result = client.describeGlobalRankingReceivedRewardsByUserId(
        new DescribeGlobalRankingReceivedRewardsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<GlobalRankingReceivedReward> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingReceivedRewardsByUserIdResult> asyncResult = null;
yield return client.DescribeGlobalRankingReceivedRewardsByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingReceivedRewardsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(null)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankingReceivedRewardsByUserId(
        new Gs2Ranking2.DescribeGlobalRankingReceivedRewardsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .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 ranking2

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

try:
    result = client.describe_global_ranking_received_rewards_by_user_id(
        ranking2.DescribeGlobalRankingReceivedRewardsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_season(None)
            .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('ranking2')

api_result = client.describe_global_ranking_received_rewards_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    season=nil,
    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('ranking2')

api_result_handler = client.describe_global_ranking_received_rewards_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    season=nil,
    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;

createGlobalRankingReceivedReward

Record global ranking reward receipt history

Records a reward receipt history for the specified global ranking. This must be done before actually receiving the reward. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
season long 0 ~ 9223372036854775805 Season

Result

Type Description
item GlobalRankingReceivedReward Global Ranking Reward Received History

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateGlobalRankingReceivedReward(
    &ranking2.CreateGlobalRankingReceivedRewardRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: pointy.Int64(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateGlobalRankingReceivedRewardRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createGlobalRankingReceivedReward(
        (new CreateGlobalRankingReceivedRewardRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateGlobalRankingReceivedRewardRequest;
import io.gs2.ranking2.result.CreateGlobalRankingReceivedRewardResult;

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

try {
    CreateGlobalRankingReceivedRewardResult result = client.createGlobalRankingReceivedReward(
        new CreateGlobalRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0L)
    );
    GlobalRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateGlobalRankingReceivedRewardResult> asyncResult = null;
yield return client.CreateGlobalRankingReceivedReward(
    new Gs2.Gs2Ranking2.Request.CreateGlobalRankingReceivedRewardRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(0L),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createGlobalRankingReceivedReward(
        new Gs2Ranking2.CreateGlobalRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.create_global_ranking_received_reward(
        ranking2.CreateGlobalRankingReceivedRewardRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.create_global_ranking_received_reward({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.create_global_ranking_received_reward_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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;

createGlobalRankingReceivedRewardByUserId

Record global ranking reward receipt history specifying User ID

Records a reward receipt history for the specified global ranking on behalf of the specified user.

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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
season long 0 ~ 9223372036854775805 Season
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item GlobalRankingReceivedReward Global Ranking Reward Received History

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateGlobalRankingReceivedRewardByUserId(
    &ranking2.CreateGlobalRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateGlobalRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createGlobalRankingReceivedRewardByUserId(
        (new CreateGlobalRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateGlobalRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.CreateGlobalRankingReceivedRewardByUserIdResult;

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

try {
    CreateGlobalRankingReceivedRewardByUserIdResult result = client.createGlobalRankingReceivedRewardByUserId(
        new CreateGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    GlobalRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateGlobalRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.CreateGlobalRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.CreateGlobalRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createGlobalRankingReceivedRewardByUserId(
        new Gs2Ranking2.CreateGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.create_global_ranking_received_reward_by_user_id(
        ranking2.CreateGlobalRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.create_global_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.create_global_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

receiveGlobalRankingReceivedReward

Receive Global Ranking Reward

Receives the ranking reward for the specified global ranking and season. The reward is determined by the user’s ranking position and the ranking model’s reward configuration. A transaction is issued to grant the reward items.

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
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long 0 ~ 9223372036854775805 Season
config List<Config> [] 0 ~ 32 items Configuration values applied to transaction variables

Result

Type Description
item GlobalRankingModel Global Ranking Model
acquireActions List<AcquireAction> List of Acquire Actions to be performed when rewards are received
transactionId string Issued transaction ID
stampSheet string Stamp sheet used to execute the exchange process
stampSheetEncryptionKeyId string Cryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheet bool? Whether automatic transaction execution is enabled
atomicCommit bool? Whether to commit the transaction atomically
transaction string Issued transaction
transactionResult TransactionResult Transaction execution result

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.ReceiveGlobalRankingReceivedReward(
    &ranking2.ReceiveGlobalRankingReceivedRewardRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: pointy.Int64(0),
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
acquireActions := result.AcquireActions
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\ReceiveGlobalRankingReceivedRewardRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->receiveGlobalRankingReceivedReward(
        (new ReceiveGlobalRankingReceivedRewardRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(0)
            ->withConfig(null)
    );
    $item = $result->getItem();
    $acquireActions = $result->getAcquireActions();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
} 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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.ReceiveGlobalRankingReceivedRewardRequest;
import io.gs2.ranking2.result.ReceiveGlobalRankingReceivedRewardResult;

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

try {
    ReceiveGlobalRankingReceivedRewardResult result = client.receiveGlobalRankingReceivedReward(
        new ReceiveGlobalRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(0L)
            .withConfig(null)
    );
    GlobalRankingModel item = result.getItem();
    List<AcquireAction> acquireActions = result.getAcquireActions();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
} 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.ReceiveGlobalRankingReceivedRewardResult> asyncResult = null;
yield return client.ReceiveGlobalRankingReceivedReward(
    new Gs2.Gs2Ranking2.Request.ReceiveGlobalRankingReceivedRewardRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(0L)
        .WithConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var acquireActions = result.AcquireActions;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.receiveGlobalRankingReceivedReward(
        new Gs2Ranking2.ReceiveGlobalRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(0)
            .withConfig(null)
    );
    const item = result.getItem();
    const acquireActions = result.getAcquireActions();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.receive_global_ranking_received_reward(
        ranking2.ReceiveGlobalRankingReceivedRewardRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_season(0)
            .with_config(None)
    )
    item = result.item
    acquire_actions = result.acquire_actions
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.receive_global_ranking_received_reward({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=0,
    config=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
client = gs2('ranking2')

api_result_handler = client.receive_global_ranking_received_reward_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=0,
    config=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;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

receiveGlobalRankingReceivedRewardByUserId

Receive Global Ranking Reward specifying User ID

Receives the ranking reward for the specified global ranking and season on behalf of the specified user. A transaction is issued to grant the reward items.

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
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long 0 ~ 9223372036854775805 Season
config List<Config> [] 0 ~ 32 items Configuration values applied to transaction variables
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item GlobalRankingModel Global Ranking Model
acquireActions List<AcquireAction> List of Acquire Actions to be performed when rewards are received
transactionId string Issued transaction ID
stampSheet string Stamp sheet used to execute the exchange process
stampSheetEncryptionKeyId string Cryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheet bool? Whether automatic transaction execution is enabled
atomicCommit bool? Whether to commit the transaction atomically
transaction string Issued transaction
transactionResult TransactionResult Transaction execution result

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.ReceiveGlobalRankingReceivedRewardByUserId(
    &ranking2.ReceiveGlobalRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: pointy.Int64(0),
        Config: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
acquireActions := result.AcquireActions
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\ReceiveGlobalRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->receiveGlobalRankingReceivedRewardByUserId(
        (new ReceiveGlobalRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(0)
            ->withConfig(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $acquireActions = $result->getAcquireActions();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
} 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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.ReceiveGlobalRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.ReceiveGlobalRankingReceivedRewardByUserIdResult;

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

try {
    ReceiveGlobalRankingReceivedRewardByUserIdResult result = client.receiveGlobalRankingReceivedRewardByUserId(
        new ReceiveGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(0L)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    GlobalRankingModel item = result.getItem();
    List<AcquireAction> acquireActions = result.getAcquireActions();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
} 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.ReceiveGlobalRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.ReceiveGlobalRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.ReceiveGlobalRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(0L)
        .WithConfig(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var acquireActions = result.AcquireActions;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.receiveGlobalRankingReceivedRewardByUserId(
        new Gs2Ranking2.ReceiveGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(0)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const acquireActions = result.getAcquireActions();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.receive_global_ranking_received_reward_by_user_id(
        ranking2.ReceiveGlobalRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_season(0)
            .with_config(None)
            .with_time_offset_token(None)
    )
    item = result.item
    acquire_actions = result.acquire_actions
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.receive_global_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    season=0,
    config=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;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
client = gs2('ranking2')

api_result_handler = client.receive_global_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    season=0,
    config=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;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

getGlobalRankingReceivedReward

Get Global Ranking Reward Received History

Retrieves the reward receipt history for the specified global ranking. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
season long 0 ~ 9223372036854775805 Season

Result

Type Description
item GlobalRankingReceivedReward Global Ranking Reward Received History

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRankingReceivedReward(
    &ranking2.GetGlobalRankingReceivedRewardRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: pointy.Int64(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingReceivedRewardRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRankingReceivedReward(
        (new GetGlobalRankingReceivedRewardRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingReceivedRewardRequest;
import io.gs2.ranking2.result.GetGlobalRankingReceivedRewardResult;

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

try {
    GetGlobalRankingReceivedRewardResult result = client.getGlobalRankingReceivedReward(
        new GetGlobalRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0L)
    );
    GlobalRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingReceivedRewardResult> asyncResult = null;
yield return client.GetGlobalRankingReceivedReward(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingReceivedRewardRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(0L),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRankingReceivedReward(
        new Gs2Ranking2.GetGlobalRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking_received_reward(
        ranking2.GetGlobalRankingReceivedRewardRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_global_ranking_received_reward({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.get_global_ranking_received_reward_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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;

getGlobalRankingReceivedRewardByUserId

Get Global Ranking Reward Received History specifying User ID

Retrieves the reward receipt history for the specified global ranking for the specified user. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
season long 0 ~ 9223372036854775805 Season
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item GlobalRankingReceivedReward Global Ranking Reward Received History

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRankingReceivedRewardByUserId(
    &ranking2.GetGlobalRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRankingReceivedRewardByUserId(
        (new GetGlobalRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.GetGlobalRankingReceivedRewardByUserIdResult;

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

try {
    GetGlobalRankingReceivedRewardByUserIdResult result = client.getGlobalRankingReceivedRewardByUserId(
        new GetGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    GlobalRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.GetGlobalRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRankingReceivedRewardByUserId(
        new Gs2Ranking2.GetGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking_received_reward_by_user_id(
        ranking2.GetGlobalRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_global_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.get_global_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

deleteGlobalRankingReceivedRewardByUserId

Delete Global Ranking Reward Received History specifying User ID

Deletes the global ranking reward receipt history for the specified user, ranking, and season.

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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
season long
0 ~ 9223372036854775805 Season
The season number corresponding to the GS2-Schedule event repeat count. Increments with each new ranking period.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item GlobalRankingReceivedReward Global Ranking Reward Received History deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteGlobalRankingReceivedRewardByUserId(
    &ranking2.DeleteGlobalRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteGlobalRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteGlobalRankingReceivedRewardByUserId(
        (new DeleteGlobalRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteGlobalRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.DeleteGlobalRankingReceivedRewardByUserIdResult;

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

try {
    DeleteGlobalRankingReceivedRewardByUserIdResult result = client.deleteGlobalRankingReceivedRewardByUserId(
        new DeleteGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    GlobalRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteGlobalRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.DeleteGlobalRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.DeleteGlobalRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteGlobalRankingReceivedRewardByUserId(
        new Gs2Ranking2.DeleteGlobalRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_global_ranking_received_reward_by_user_id(
        ranking2.DeleteGlobalRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.delete_global_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.delete_global_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

describeGlobalRankings

Get a list of Global Rankings

Retrieves a paginated list of global ranking data for the specified ranking. Ranking data includes rank, score, and user information. Can optionally specify a season.

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
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long 0 ~ 9223372036854775805 Season
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<GlobalRankingData> List of Global Rankings
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankings(
    &ranking2.DescribeGlobalRankingsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankings(
        (new DescribeGlobalRankingsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingsRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingsResult;

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

try {
    DescribeGlobalRankingsResult result = client.describeGlobalRankings(
        new DescribeGlobalRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<GlobalRankingData> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingsResult> asyncResult = null;
yield return client.DescribeGlobalRankings(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankings(
        new Gs2Ranking2.DescribeGlobalRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(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 ranking2

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

try:
    result = client.describe_global_rankings(
        ranking2.DescribeGlobalRankingsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_season(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('ranking2')

api_result = client.describe_global_rankings({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=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('ranking2')

api_result_handler = client.describe_global_rankings_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=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;

describeGlobalRankingsByUserId

Get a list of Global Rankings by specifying a user ID

Retrieves a paginated list of global ranking data for the specified ranking on behalf of the specified user. Can optionally specify a season.

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
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long 0 ~ 9223372036854775805 Season
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<GlobalRankingData> List of Global Rankings
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankingsByUserId(
    &ranking2.DescribeGlobalRankingsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingsByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankingsByUserId(
        (new DescribeGlobalRankingsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(null)
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingsByUserIdRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingsByUserIdResult;

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

try {
    DescribeGlobalRankingsByUserIdResult result = client.describeGlobalRankingsByUserId(
        new DescribeGlobalRankingsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<GlobalRankingData> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingsByUserIdResult> asyncResult = null;
yield return client.DescribeGlobalRankingsByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(null)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankingsByUserId(
        new Gs2Ranking2.DescribeGlobalRankingsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .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 ranking2

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

try:
    result = client.describe_global_rankings_by_user_id(
        ranking2.DescribeGlobalRankingsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_season(None)
            .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('ranking2')

api_result = client.describe_global_rankings_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    season=nil,
    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('ranking2')

api_result_handler = client.describe_global_rankings_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    season=nil,
    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;

getGlobalRanking

Get Global Ranking

Retrieves the ranking position and score of the requesting user for the specified global ranking. The ranking data is calculated from registered scores. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
season long 0 ~ 9223372036854775805 Season

Result

Type Description
item GlobalRankingData Global Ranking

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRanking(
    &ranking2.GetGlobalRankingRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRanking(
        (new GetGlobalRankingRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingRequest;
import io.gs2.ranking2.result.GetGlobalRankingResult;

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

try {
    GetGlobalRankingResult result = client.getGlobalRanking(
        new GetGlobalRankingRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(null)
    );
    GlobalRankingData 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingResult> asyncResult = null;
yield return client.GetGlobalRanking(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRanking(
        new Gs2Ranking2.GetGlobalRankingRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking(
        ranking2.GetGlobalRankingRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_season(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_global_ranking({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.get_global_ranking_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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;

getGlobalRankingByUserId

Get Global Ranking by specifying the user ID

Retrieves the ranking position and score of the specified user for the specified global ranking. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
season long 0 ~ 9223372036854775805 Season
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item GlobalRankingData Global Ranking

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRankingByUserId(
    &ranking2.GetGlobalRankingByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRankingByUserId(
        (new GetGlobalRankingByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingByUserIdRequest;
import io.gs2.ranking2.result.GetGlobalRankingByUserIdResult;

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

try {
    GetGlobalRankingByUserIdResult result = client.getGlobalRankingByUserId(
        new GetGlobalRankingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    GlobalRankingData 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingByUserIdResult> asyncResult = null;
yield return client.GetGlobalRankingByUserId(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRankingByUserId(
        new Gs2Ranking2.GetGlobalRankingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking_by_user_id(
        ranking2.GetGlobalRankingByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_global_ranking_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.get_global_ranking_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

describeClusterRankingScores

Get a list of Cluster Ranking Scores

Retrieves a paginated list of cluster ranking scores registered by the requesting user. Can filter by ranking name, cluster name, and season.

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
rankingName string ~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string ~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or arbitrary group) that this score belongs to. Verified against the cluster type setting to ensure the user is a member.
season long 0 ~ 9223372036854775805 Season
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<ClusterRankingScore> List of Cluster Ranking Scores
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankingScores(
    &ranking2.DescribeClusterRankingScoresRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        Season: pointy.Int64(0),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingScoresRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankingScores(
        (new DescribeClusterRankingScoresRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withSeason(0)
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingScoresRequest;
import io.gs2.ranking2.result.DescribeClusterRankingScoresResult;

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

try {
    DescribeClusterRankingScoresResult result = client.describeClusterRankingScores(
        new DescribeClusterRankingScoresRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0L)
            .withPageToken(null)
            .withLimit(null)
    );
    List<ClusterRankingScore> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingScoresResult> asyncResult = null;
yield return client.DescribeClusterRankingScores(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingScoresRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankingScores(
        new Gs2Ranking2.DescribeClusterRankingScoresRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_cluster_ranking_scores(
        ranking2.DescribeClusterRankingScoresRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_season(0)
            .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('ranking2')

api_result = client.describe_cluster_ranking_scores({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    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('ranking2')

api_result_handler = client.describe_cluster_ranking_scores_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    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;

describeClusterRankingScoresByUserId

Get a list of Cluster Ranking Scores by specifying a user ID

Retrieves a paginated list of cluster ranking scores registered by the specified user. Can filter by ranking name, cluster name, and season.

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
rankingName string ~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string ~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or arbitrary group) that this score belongs to. Verified against the cluster type setting to ensure the user is a member.
season long 0 ~ 9223372036854775805 Season
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<ClusterRankingScore> List of Cluster Ranking Scores
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankingScoresByUserId(
    &ranking2.DescribeClusterRankingScoresByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: nil,
        ClusterName: pointy.String("cluster-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingScoresByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankingScoresByUserId(
        (new DescribeClusterRankingScoresByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName(null)
            ->withClusterName("cluster-0001")
            ->withSeason(null)
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingScoresByUserIdRequest;
import io.gs2.ranking2.result.DescribeClusterRankingScoresByUserIdResult;

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

try {
    DescribeClusterRankingScoresByUserIdResult result = client.describeClusterRankingScoresByUserId(
        new DescribeClusterRankingScoresByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName(null)
            .withClusterName("cluster-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<ClusterRankingScore> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingScoresByUserIdResult> asyncResult = null;
yield return client.DescribeClusterRankingScoresByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingScoresByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName(null)
        .WithClusterName("cluster-0001")
        .WithSeason(null)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankingScoresByUserId(
        new Gs2Ranking2.DescribeClusterRankingScoresByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName(null)
            .withClusterName("cluster-0001")
            .withSeason(null)
            .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 ranking2

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

try:
    result = client.describe_cluster_ranking_scores_by_user_id(
        ranking2.DescribeClusterRankingScoresByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name(None)
            .with_cluster_name('cluster-0001')
            .with_season(None)
            .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('ranking2')

api_result = client.describe_cluster_ranking_scores_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName=nil,
    clusterName="cluster-0001",
    season=nil,
    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('ranking2')

api_result_handler = client.describe_cluster_ranking_scores_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName=nil,
    clusterName="cluster-0001",
    season=nil,
    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;

putClusterRankingScore

Register Cluster Ranking Score

Registers a score for the specified cluster ranking. The user must belong to the specified cluster (guild or matchmaking gathering). The score must be within the range defined by the ranking model.

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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or arbitrary group) that this score belongs to. Verified against the cluster type setting to ensure the user is a member.
accessToken string
~ 128 chars Access token
score long
0 ~ 9223372036854775805 Score
The score value submitted by the user within this cluster.
metadata string ~ 512 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.

Result

Type Description
item ClusterRankingScore Registered Cluster Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PutClusterRankingScore(
    &ranking2.PutClusterRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Score: pointy.Int64(100),
        Metadata: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PutClusterRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->putClusterRankingScore(
        (new PutClusterRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withAccessToken("accessToken-0001")
            ->withScore(100)
            ->withMetadata(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PutClusterRankingScoreRequest;
import io.gs2.ranking2.result.PutClusterRankingScoreResult;

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

try {
    PutClusterRankingScoreResult result = client.putClusterRankingScore(
        new PutClusterRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withScore(100L)
            .withMetadata(null)
    );
    ClusterRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PutClusterRankingScoreResult> asyncResult = null;
yield return client.PutClusterRankingScore(
    new Gs2.Gs2Ranking2.Request.PutClusterRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithAccessToken("accessToken-0001")
        .WithScore(100L)
        .WithMetadata(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.putClusterRankingScore(
        new Gs2Ranking2.PutClusterRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withScore(100)
            .withMetadata(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.put_cluster_ranking_score(
        ranking2.PutClusterRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_access_token('accessToken-0001')
            .with_score(100)
            .with_metadata(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.put_cluster_ranking_score({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    score=100,
    metadata=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('ranking2')

api_result_handler = client.put_cluster_ranking_score_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    score=100,
    metadata=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;

putClusterRankingScoreByUserId

Register Cluster Ranking Score specifying User ID

Registers a score for the specified cluster ranking on behalf of the specified user. The user must belong to the specified cluster.

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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or arbitrary group) that this score belongs to. Verified against the cluster type setting to ensure the user is a member.
userId string
~ 128 chars User ID
score long
0 ~ 9223372036854775805 Score
The score value submitted by the user within this cluster.
metadata string ~ 512 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.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item ClusterRankingScore Registered Cluster Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PutClusterRankingScoreByUserId(
    &ranking2.PutClusterRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        UserId: pointy.String("user-0001"),
        Score: nil,
        Metadata: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PutClusterRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->putClusterRankingScoreByUserId(
        (new PutClusterRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withUserId("user-0001")
            ->withScore(null)
            ->withMetadata(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PutClusterRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.PutClusterRankingScoreByUserIdResult;

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

try {
    PutClusterRankingScoreByUserIdResult result = client.putClusterRankingScoreByUserId(
        new PutClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withScore(null)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    ClusterRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PutClusterRankingScoreByUserIdResult> asyncResult = null;
yield return client.PutClusterRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.PutClusterRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithUserId("user-0001")
        .WithScore(null)
        .WithMetadata(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.putClusterRankingScoreByUserId(
        new Gs2Ranking2.PutClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withScore(null)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.put_cluster_ranking_score_by_user_id(
        ranking2.PutClusterRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_user_id('user-0001')
            .with_score(None)
            .with_metadata(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.put_cluster_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    score=nil,
    metadata=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('ranking2')

api_result_handler = client.put_cluster_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    score=nil,
    metadata=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;

getClusterRankingScore

Get Cluster Ranking Score

Retrieves the cluster ranking score registered by the requesting user for the specified ranking and cluster. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or arbitrary group) that this score belongs to. Verified against the cluster type setting to ensure the user is a member.
accessToken string
~ 128 chars Access token
season long 0 ~ 9223372036854775805 Season

Result

Type Description
item ClusterRankingScore Cluster Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRankingScore(
    &ranking2.GetClusterRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: pointy.Int64(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRankingScore(
        (new GetClusterRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingScoreRequest;
import io.gs2.ranking2.result.GetClusterRankingScoreResult;

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

try {
    GetClusterRankingScoreResult result = client.getClusterRankingScore(
        new GetClusterRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0L)
    );
    ClusterRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingScoreResult> asyncResult = null;
yield return client.GetClusterRankingScore(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(0L),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRankingScore(
        new Gs2Ranking2.GetClusterRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking_score(
        ranking2.GetClusterRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_access_token('accessToken-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_cluster_ranking_score({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.get_cluster_ranking_score_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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;

getClusterRankingScoreByUserId

Get Cluster Ranking Score specifying User ID

Retrieves the cluster ranking score registered by the specified user for the specified ranking and cluster. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or arbitrary group) that this score belongs to. Verified against the cluster type setting to ensure the user is a member.
userId string
~ 128 chars User ID
season long 0 ~ 9223372036854775805 Season
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item ClusterRankingScore Cluster Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRankingScoreByUserId(
    &ranking2.GetClusterRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        UserId: pointy.String("user-0001"),
        Season: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRankingScoreByUserId(
        (new GetClusterRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.GetClusterRankingScoreByUserIdResult;

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

try {
    GetClusterRankingScoreByUserIdResult result = client.getClusterRankingScoreByUserId(
        new GetClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    ClusterRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingScoreByUserIdResult> asyncResult = null;
yield return client.GetClusterRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithUserId("user-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRankingScoreByUserId(
        new Gs2Ranking2.GetClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking_score_by_user_id(
        ranking2.GetClusterRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_user_id('user-0001')
            .with_season(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_cluster_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.get_cluster_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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;

deleteClusterRankingScoreByUserId

Delete Cluster Ranking Score specifying User ID

Deletes the cluster ranking score registered by the specified user for the specified ranking, cluster, and season.

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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or arbitrary group) that this score belongs to. Verified against the cluster type setting to ensure the user is a member.
userId string
~ 128 chars User ID
season long 0 ~ 9223372036854775805 Season
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item ClusterRankingScore Cluster Ranking Score deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteClusterRankingScoreByUserId(
    &ranking2.DeleteClusterRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteClusterRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteClusterRankingScoreByUserId(
        (new DeleteClusterRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteClusterRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.DeleteClusterRankingScoreByUserIdResult;

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

try {
    DeleteClusterRankingScoreByUserIdResult result = client.deleteClusterRankingScoreByUserId(
        new DeleteClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    ClusterRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteClusterRankingScoreByUserIdResult> asyncResult = null;
yield return client.DeleteClusterRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.DeleteClusterRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteClusterRankingScoreByUserId(
        new Gs2Ranking2.DeleteClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_cluster_ranking_score_by_user_id(
        ranking2.DeleteClusterRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.delete_cluster_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.delete_cluster_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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;

verifyClusterRankingScore

Verify the score of the cluster ranking

Verifies the cluster ranking score against a specified value using comparison operators (less, lessEqual, greater, greaterEqual, equal, notEqual). Can optionally specify a season.

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
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or arbitrary group) that this score belongs to. Verified against the cluster type setting to ensure the user is a member.
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Score is less than the specified value
“lessEqual”Score is less than or equal to the specified value
“greater”Score is greater than the specified value
“greaterEqual”Score is greater than or equal to the specified value
“equal”Score is equal to the specified value
“notEqual”Score is not equal to the specified value
season long 0 ~ 9223372036854775805 Season
score long
0 ~ 9223372036854775805 Score
The score value submitted by the user within this cluster.
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity

Result

Type Description
item ClusterRankingScore Cluster Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.VerifyClusterRankingScore(
    &ranking2.VerifyClusterRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        VerifyType: pointy.String("less"),
        Season: nil,
        Score: pointy.Int64(100),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\VerifyClusterRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->verifyClusterRankingScore(
        (new VerifyClusterRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withVerifyType("less")
            ->withSeason(null)
            ->withScore(100)
            ->withMultiplyValueSpecifyingQuantity(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.VerifyClusterRankingScoreRequest;
import io.gs2.ranking2.result.VerifyClusterRankingScoreResult;

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

try {
    VerifyClusterRankingScoreResult result = client.verifyClusterRankingScore(
        new VerifyClusterRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100L)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    ClusterRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.VerifyClusterRankingScoreResult> asyncResult = null;
yield return client.VerifyClusterRankingScore(
    new Gs2.Gs2Ranking2.Request.VerifyClusterRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithVerifyType("less")
        .WithSeason(null)
        .WithScore(100L)
        .WithMultiplyValueSpecifyingQuantity(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.verifyClusterRankingScore(
        new Gs2Ranking2.VerifyClusterRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.verify_cluster_ranking_score(
        ranking2.VerifyClusterRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_verify_type('less')
            .with_season(None)
            .with_score(100)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.verify_cluster_ranking_score({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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('ranking2')

api_result_handler = client.verify_cluster_ranking_score_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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;

verifyClusterRankingScoreByUserId

Verify the score of the cluster ranking specifying User ID

Verifies the cluster ranking score of the specified user against a specified value using comparison operators (less, lessEqual, greater, greaterEqual, equal, notEqual).

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
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or arbitrary group) that this score belongs to. Verified against the cluster type setting to ensure the user is a member.
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Score is less than the specified value
“lessEqual”Score is less than or equal to the specified value
“greater”Score is greater than the specified value
“greaterEqual”Score is greater than or equal to the specified value
“equal”Score is equal to the specified value
“notEqual”Score is not equal to the specified value
season long 0 ~ 9223372036854775805 Season
score long
0 ~ 9223372036854775805 Score
The score value submitted by the user within this cluster.
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item ClusterRankingScore Cluster Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.VerifyClusterRankingScoreByUserId(
    &ranking2.VerifyClusterRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        VerifyType: pointy.String("less"),
        Season: nil,
        Score: pointy.Int64(100),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\VerifyClusterRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->verifyClusterRankingScoreByUserId(
        (new VerifyClusterRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withVerifyType("less")
            ->withSeason(null)
            ->withScore(100)
            ->withMultiplyValueSpecifyingQuantity(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.VerifyClusterRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.VerifyClusterRankingScoreByUserIdResult;

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

try {
    VerifyClusterRankingScoreByUserIdResult result = client.verifyClusterRankingScoreByUserId(
        new VerifyClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100L)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    ClusterRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.VerifyClusterRankingScoreByUserIdResult> asyncResult = null;
yield return client.VerifyClusterRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.VerifyClusterRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithVerifyType("less")
        .WithSeason(null)
        .WithScore(100L)
        .WithMultiplyValueSpecifyingQuantity(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.verifyClusterRankingScoreByUserId(
        new Gs2Ranking2.VerifyClusterRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.verify_cluster_ranking_score_by_user_id(
        ranking2.VerifyClusterRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_verify_type('less')
            .with_season(None)
            .with_score(100)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.verify_cluster_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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('ranking2')

api_result_handler = client.verify_cluster_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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;

describeClusterRankingReceivedRewards

Get a list of Cluster Ranking Rewards Received

Retrieves a paginated list of cluster ranking reward receipt history for the requesting user. Can filter by ranking name, cluster name, and season.

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
rankingName string ~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string ~ 1024 chars Cluster Name
The name of the cluster for which the ranking reward was received.
season long 0 ~ 9223372036854775805 Season
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<ClusterRankingReceivedReward> List of Cluster Ranking Rewards Received
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankingReceivedRewards(
    &ranking2.DescribeClusterRankingReceivedRewardsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        Season: pointy.Int64(0),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingReceivedRewardsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankingReceivedRewards(
        (new DescribeClusterRankingReceivedRewardsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withSeason(0)
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingReceivedRewardsRequest;
import io.gs2.ranking2.result.DescribeClusterRankingReceivedRewardsResult;

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

try {
    DescribeClusterRankingReceivedRewardsResult result = client.describeClusterRankingReceivedRewards(
        new DescribeClusterRankingReceivedRewardsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0L)
            .withPageToken(null)
            .withLimit(null)
    );
    List<ClusterRankingReceivedReward> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingReceivedRewardsResult> asyncResult = null;
yield return client.DescribeClusterRankingReceivedRewards(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingReceivedRewardsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankingReceivedRewards(
        new Gs2Ranking2.DescribeClusterRankingReceivedRewardsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0)
            .withPageToken(null)
            .withLimit(null)
    );
    const items = result.getItems();
    const nextPageToken = result.getNextPageToken();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_cluster_ranking_received_rewards(
        ranking2.DescribeClusterRankingReceivedRewardsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_season(0)
            .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('ranking2')

api_result = client.describe_cluster_ranking_received_rewards({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    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('ranking2')

api_result_handler = client.describe_cluster_ranking_received_rewards_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    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;

describeClusterRankingReceivedRewardsByUserId

Get a list of Cluster Ranking Rewards Received by specifying a User ID

Retrieves a paginated list of cluster ranking reward receipt history for the specified user. Can filter by ranking name, cluster name, and season.

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
rankingName string ~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string ~ 1024 chars Cluster Name
The name of the cluster for which the ranking reward was received.
season long 0 ~ 9223372036854775805 Season
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<ClusterRankingReceivedReward> List of Cluster Ranking Rewards Received
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankingReceivedRewardsByUserId(
    &ranking2.DescribeClusterRankingReceivedRewardsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingReceivedRewardsByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankingReceivedRewardsByUserId(
        (new DescribeClusterRankingReceivedRewardsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withSeason(null)
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingReceivedRewardsByUserIdRequest;
import io.gs2.ranking2.result.DescribeClusterRankingReceivedRewardsByUserIdResult;

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

try {
    DescribeClusterRankingReceivedRewardsByUserIdResult result = client.describeClusterRankingReceivedRewardsByUserId(
        new DescribeClusterRankingReceivedRewardsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<ClusterRankingReceivedReward> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingReceivedRewardsByUserIdResult> asyncResult = null;
yield return client.DescribeClusterRankingReceivedRewardsByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingReceivedRewardsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithSeason(null)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankingReceivedRewardsByUserId(
        new Gs2Ranking2.DescribeClusterRankingReceivedRewardsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(null)
            .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 ranking2

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

try:
    result = client.describe_cluster_ranking_received_rewards_by_user_id(
        ranking2.DescribeClusterRankingReceivedRewardsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_season(None)
            .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('ranking2')

api_result = client.describe_cluster_ranking_received_rewards_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=nil,
    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('ranking2')

api_result_handler = client.describe_cluster_ranking_received_rewards_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=nil,
    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;

createClusterRankingReceivedReward

Record Cluster Ranking Reward Received History

Records a reward receipt history for the specified cluster ranking and cluster. This must be done before actually receiving the reward. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster for which the ranking reward was received.
accessToken string
~ 128 chars Access token
season long 0 ~ 9223372036854775805 Season

Result

Type Description
item ClusterRankingReceivedReward Cluster Ranking Reward Received History

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateClusterRankingReceivedReward(
    &ranking2.CreateClusterRankingReceivedRewardRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: pointy.Int64(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateClusterRankingReceivedRewardRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createClusterRankingReceivedReward(
        (new CreateClusterRankingReceivedRewardRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateClusterRankingReceivedRewardRequest;
import io.gs2.ranking2.result.CreateClusterRankingReceivedRewardResult;

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

try {
    CreateClusterRankingReceivedRewardResult result = client.createClusterRankingReceivedReward(
        new CreateClusterRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0L)
    );
    ClusterRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateClusterRankingReceivedRewardResult> asyncResult = null;
yield return client.CreateClusterRankingReceivedReward(
    new Gs2.Gs2Ranking2.Request.CreateClusterRankingReceivedRewardRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(0L),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createClusterRankingReceivedReward(
        new Gs2Ranking2.CreateClusterRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.create_cluster_ranking_received_reward(
        ranking2.CreateClusterRankingReceivedRewardRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_access_token('accessToken-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.create_cluster_ranking_received_reward({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.create_cluster_ranking_received_reward_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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;

createClusterRankingReceivedRewardByUserId

Record Cluster Ranking Reward Received History by specifying a user ID

Records a reward receipt history for the specified cluster ranking and cluster on behalf of the specified user.

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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster for which the ranking reward was received.
userId string
~ 128 chars User ID
season long 0 ~ 9223372036854775805 Season
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item ClusterRankingReceivedReward Cluster Ranking Reward Received History

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateClusterRankingReceivedRewardByUserId(
    &ranking2.CreateClusterRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateClusterRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createClusterRankingReceivedRewardByUserId(
        (new CreateClusterRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateClusterRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.CreateClusterRankingReceivedRewardByUserIdResult;

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

try {
    CreateClusterRankingReceivedRewardByUserIdResult result = client.createClusterRankingReceivedRewardByUserId(
        new CreateClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    ClusterRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateClusterRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.CreateClusterRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.CreateClusterRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createClusterRankingReceivedRewardByUserId(
        new Gs2Ranking2.CreateClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.create_cluster_ranking_received_reward_by_user_id(
        ranking2.CreateClusterRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.create_cluster_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.create_cluster_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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;

receiveClusterRankingReceivedReward

Receive Cluster Ranking Reward

Receives the ranking reward for the specified cluster ranking, cluster, and season. The reward is determined by the user’s ranking position and the ranking model’s reward configuration. A transaction is issued to grant the reward items.

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
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster for which the ranking reward was received.
season long 0 ~ 9223372036854775805 Season
config List<Config> [] 0 ~ 32 items Configuration values applied to transaction variables

Result

Type Description
item ClusterRankingModel Cluster Ranking Model
acquireActions List<AcquireAction> List of Acquire Actions to be performed when rewards are received
transactionId string Issued transaction ID
stampSheet string Stamp sheet used to execute the exchange process
stampSheetEncryptionKeyId string Cryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheet bool? Whether automatic transaction execution is enabled
atomicCommit bool? Whether to commit the transaction atomically
transaction string Issued transaction
transactionResult TransactionResult Transaction execution result

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.ReceiveClusterRankingReceivedReward(
    &ranking2.ReceiveClusterRankingReceivedRewardRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        Season: pointy.Int64(0),
        Config: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
acquireActions := result.AcquireActions
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\ReceiveClusterRankingReceivedRewardRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->receiveClusterRankingReceivedReward(
        (new ReceiveClusterRankingReceivedRewardRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withSeason(0)
            ->withConfig(null)
    );
    $item = $result->getItem();
    $acquireActions = $result->getAcquireActions();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
} 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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.ReceiveClusterRankingReceivedRewardRequest;
import io.gs2.ranking2.result.ReceiveClusterRankingReceivedRewardResult;

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

try {
    ReceiveClusterRankingReceivedRewardResult result = client.receiveClusterRankingReceivedReward(
        new ReceiveClusterRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0L)
            .withConfig(null)
    );
    ClusterRankingModel item = result.getItem();
    List<AcquireAction> acquireActions = result.getAcquireActions();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
} 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.ReceiveClusterRankingReceivedRewardResult> asyncResult = null;
yield return client.ReceiveClusterRankingReceivedReward(
    new Gs2.Gs2Ranking2.Request.ReceiveClusterRankingReceivedRewardRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithSeason(0L)
        .WithConfig(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var acquireActions = result.AcquireActions;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.receiveClusterRankingReceivedReward(
        new Gs2Ranking2.ReceiveClusterRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0)
            .withConfig(null)
    );
    const item = result.getItem();
    const acquireActions = result.getAcquireActions();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.receive_cluster_ranking_received_reward(
        ranking2.ReceiveClusterRankingReceivedRewardRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_season(0)
            .with_config(None)
    )
    item = result.item
    acquire_actions = result.acquire_actions
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.receive_cluster_ranking_received_reward({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    config=nil,
})

if(api_result.isError) then
    -- When error occurs
    fail(api_result['statusCode'], api_result['errorMessage'])
end

result = api_result.result
item = result.item;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
client = gs2('ranking2')

api_result_handler = client.receive_cluster_ranking_received_reward_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    config=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;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

receiveClusterRankingReceivedRewardByUserId

Receive Cluster Ranking Reward specifying User ID

Receives the ranking reward for the specified cluster ranking, cluster, and season on behalf of the specified user. A transaction is issued to grant the reward items.

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
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster for which the ranking reward was received.
season long 0 ~ 9223372036854775805 Season
config List<Config> [] 0 ~ 32 items Configuration values applied to transaction variables
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item ClusterRankingModel Cluster Ranking Model
acquireActions List<AcquireAction> List of Acquire Actions to be performed when rewards are received
transactionId string Issued transaction ID
stampSheet string Stamp sheet used to execute the exchange process
stampSheetEncryptionKeyId string Cryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheet bool? Whether automatic transaction execution is enabled
atomicCommit bool? Whether to commit the transaction atomically
transaction string Issued transaction
transactionResult TransactionResult Transaction execution result

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.ReceiveClusterRankingReceivedRewardByUserId(
    &ranking2.ReceiveClusterRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        Season: pointy.Int64(0),
        Config: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
acquireActions := result.AcquireActions
transactionId := result.TransactionId
stampSheet := result.StampSheet
stampSheetEncryptionKeyId := result.StampSheetEncryptionKeyId
autoRunStampSheet := result.AutoRunStampSheet
atomicCommit := result.AtomicCommit
transaction := result.Transaction
transactionResult := result.TransactionResult
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\ReceiveClusterRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->receiveClusterRankingReceivedRewardByUserId(
        (new ReceiveClusterRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withSeason(0)
            ->withConfig(null)
            ->withTimeOffsetToken(null)
    );
    $item = $result->getItem();
    $acquireActions = $result->getAcquireActions();
    $transactionId = $result->getTransactionId();
    $stampSheet = $result->getStampSheet();
    $stampSheetEncryptionKeyId = $result->getStampSheetEncryptionKeyId();
    $autoRunStampSheet = $result->getAutoRunStampSheet();
    $atomicCommit = $result->getAtomicCommit();
    $transaction = $result->getTransaction();
    $transactionResult = $result->getTransactionResult();
} 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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.ReceiveClusterRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.ReceiveClusterRankingReceivedRewardByUserIdResult;

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

try {
    ReceiveClusterRankingReceivedRewardByUserIdResult result = client.receiveClusterRankingReceivedRewardByUserId(
        new ReceiveClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0L)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    ClusterRankingModel item = result.getItem();
    List<AcquireAction> acquireActions = result.getAcquireActions();
    String transactionId = result.getTransactionId();
    String stampSheet = result.getStampSheet();
    String stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    boolean autoRunStampSheet = result.getAutoRunStampSheet();
    boolean atomicCommit = result.getAtomicCommit();
    String transaction = result.getTransaction();
    TransactionResult transactionResult = result.getTransactionResult();
} 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.ReceiveClusterRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.ReceiveClusterRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.ReceiveClusterRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithSeason(0L)
        .WithConfig(null)
        .WithTimeOffsetToken(null),
    r => asyncResult = r
);
if (asyncResult.Error != null) {
    throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var acquireActions = result.AcquireActions;
var transactionId = result.TransactionId;
var stampSheet = result.StampSheet;
var stampSheetEncryptionKeyId = result.StampSheetEncryptionKeyId;
var autoRunStampSheet = result.AutoRunStampSheet;
var atomicCommit = result.AtomicCommit;
var transaction = result.Transaction;
var transactionResult = result.TransactionResult;
import Gs2Core from '@/gs2/core';
import * as Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.receiveClusterRankingReceivedRewardByUserId(
        new Gs2Ranking2.ReceiveClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(0)
            .withConfig(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
    const acquireActions = result.getAcquireActions();
    const transactionId = result.getTransactionId();
    const stampSheet = result.getStampSheet();
    const stampSheetEncryptionKeyId = result.getStampSheetEncryptionKeyId();
    const autoRunStampSheet = result.getAutoRunStampSheet();
    const atomicCommit = result.getAtomicCommit();
    const transaction = result.getTransaction();
    const transactionResult = result.getTransactionResult();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.receive_cluster_ranking_received_reward_by_user_id(
        ranking2.ReceiveClusterRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_season(0)
            .with_config(None)
            .with_time_offset_token(None)
    )
    item = result.item
    acquire_actions = result.acquire_actions
    transaction_id = result.transaction_id
    stamp_sheet = result.stamp_sheet
    stamp_sheet_encryption_key_id = result.stamp_sheet_encryption_key_id
    auto_run_stamp_sheet = result.auto_run_stamp_sheet
    atomic_commit = result.atomic_commit
    transaction = result.transaction
    transaction_result = result.transaction_result
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.receive_cluster_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    config=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;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;
client = gs2('ranking2')

api_result_handler = client.receive_cluster_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=0,
    config=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;
acquireActions = result.acquireActions;
transactionId = result.transactionId;
stampSheet = result.stampSheet;
stampSheetEncryptionKeyId = result.stampSheetEncryptionKeyId;
autoRunStampSheet = result.autoRunStampSheet;
atomicCommit = result.atomicCommit;
transaction = result.transaction;
transactionResult = result.transactionResult;

getClusterRankingReceivedReward

Get Cluster Ranking Reward Received History

Retrieves the reward receipt history for the specified cluster ranking and cluster. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster for which the ranking reward was received.
accessToken string
~ 128 chars Access token
season long 0 ~ 9223372036854775805 Season

Result

Type Description
item ClusterRankingReceivedReward Cluster Ranking Reward Received History

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRankingReceivedReward(
    &ranking2.GetClusterRankingReceivedRewardRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: pointy.Int64(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingReceivedRewardRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRankingReceivedReward(
        (new GetClusterRankingReceivedRewardRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingReceivedRewardRequest;
import io.gs2.ranking2.result.GetClusterRankingReceivedRewardResult;

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

try {
    GetClusterRankingReceivedRewardResult result = client.getClusterRankingReceivedReward(
        new GetClusterRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0L)
    );
    ClusterRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingReceivedRewardResult> asyncResult = null;
yield return client.GetClusterRankingReceivedReward(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingReceivedRewardRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(0L),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRankingReceivedReward(
        new Gs2Ranking2.GetClusterRankingReceivedRewardRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking_received_reward(
        ranking2.GetClusterRankingReceivedRewardRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_access_token('accessToken-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_cluster_ranking_received_reward({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.get_cluster_ranking_received_reward_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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;

getClusterRankingReceivedRewardByUserId

Get Cluster Ranking Reward Received History specifying User ID

Retrieves the reward receipt history for the specified cluster ranking and cluster for the specified user. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster for which the ranking reward was received.
userId string
~ 128 chars User ID
season long 0 ~ 9223372036854775805 Season
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item ClusterRankingReceivedReward Cluster Ranking Reward Received History

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRankingReceivedRewardByUserId(
    &ranking2.GetClusterRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRankingReceivedRewardByUserId(
        (new GetClusterRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.GetClusterRankingReceivedRewardByUserIdResult;

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

try {
    GetClusterRankingReceivedRewardByUserIdResult result = client.getClusterRankingReceivedRewardByUserId(
        new GetClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    ClusterRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.GetClusterRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRankingReceivedRewardByUserId(
        new Gs2Ranking2.GetClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking_received_reward_by_user_id(
        ranking2.GetClusterRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_cluster_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.get_cluster_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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;

deleteClusterRankingReceivedRewardByUserId

Delete Cluster Ranking Reward Received History specifying User ID

Deletes the cluster ranking reward receipt history for the specified user, ranking, cluster, and season.

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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster for which the ranking reward was received.
userId string
~ 128 chars User ID
season long
0 ~ 9223372036854775805 Season
The season number corresponding to the GS2-Schedule event repeat count.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item ClusterRankingReceivedReward Cluster Ranking Reward Received History deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteClusterRankingReceivedRewardByUserId(
    &ranking2.DeleteClusterRankingReceivedRewardByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteClusterRankingReceivedRewardByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteClusterRankingReceivedRewardByUserId(
        (new DeleteClusterRankingReceivedRewardByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteClusterRankingReceivedRewardByUserIdRequest;
import io.gs2.ranking2.result.DeleteClusterRankingReceivedRewardByUserIdResult;

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

try {
    DeleteClusterRankingReceivedRewardByUserIdResult result = client.deleteClusterRankingReceivedRewardByUserId(
        new DeleteClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    ClusterRankingReceivedReward 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteClusterRankingReceivedRewardByUserIdResult> asyncResult = null;
yield return client.DeleteClusterRankingReceivedRewardByUserId(
    new Gs2.Gs2Ranking2.Request.DeleteClusterRankingReceivedRewardByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteClusterRankingReceivedRewardByUserId(
        new Gs2Ranking2.DeleteClusterRankingReceivedRewardByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_cluster_ranking_received_reward_by_user_id(
        ranking2.DeleteClusterRankingReceivedRewardByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.delete_cluster_ranking_received_reward_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.delete_cluster_ranking_received_reward_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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;

describeClusterRankings

Get a list of Cluster Rankings

Retrieves a paginated list of cluster ranking data for the specified ranking and cluster. Ranking data includes rank, score, and user information. Can optionally specify a season.

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
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or group) that this season belongs to.
season long 0 ~ 9223372036854775805 Season
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<ClusterRankingData> List of Cluster Rankings
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankings(
    &ranking2.DescribeClusterRankingsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankings(
        (new DescribeClusterRankingsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingsRequest;
import io.gs2.ranking2.result.DescribeClusterRankingsResult;

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

try {
    DescribeClusterRankingsResult result = client.describeClusterRankings(
        new DescribeClusterRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<ClusterRankingData> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingsResult> asyncResult = null;
yield return client.DescribeClusterRankings(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankings(
        new Gs2Ranking2.DescribeClusterRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(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 ranking2

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

try:
    result = client.describe_cluster_rankings(
        ranking2.DescribeClusterRankingsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_season(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('ranking2')

api_result = client.describe_cluster_rankings({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=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('ranking2')

api_result_handler = client.describe_cluster_rankings_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=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;

describeClusterRankingsByUserId

Get a list of Cluster Rankings by specifying a user ID

Retrieves a paginated list of cluster ranking data for the specified ranking and cluster on behalf of the specified user. Can optionally specify a season.

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
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or group) that this season belongs to.
season long 0 ~ 9223372036854775805 Season
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<ClusterRankingData> List of Cluster Rankings
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankingsByUserId(
    &ranking2.DescribeClusterRankingsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingsByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankingsByUserId(
        (new DescribeClusterRankingsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withSeason(null)
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingsByUserIdRequest;
import io.gs2.ranking2.result.DescribeClusterRankingsByUserIdResult;

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

try {
    DescribeClusterRankingsByUserIdResult result = client.describeClusterRankingsByUserId(
        new DescribeClusterRankingsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<ClusterRankingData> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingsByUserIdResult> asyncResult = null;
yield return client.DescribeClusterRankingsByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithSeason(null)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankingsByUserId(
        new Gs2Ranking2.DescribeClusterRankingsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withSeason(null)
            .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 ranking2

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

try:
    result = client.describe_cluster_rankings_by_user_id(
        ranking2.DescribeClusterRankingsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_season(None)
            .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('ranking2')

api_result = client.describe_cluster_rankings_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=nil,
    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('ranking2')

api_result_handler = client.describe_cluster_rankings_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    season=nil,
    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;

getClusterRanking

Get Cluster Ranking

Retrieves the ranking position and score of the requesting user for the specified cluster ranking. The ranking data is calculated from registered scores within the cluster. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or group) that this season belongs to.
accessToken string
~ 128 chars Access token
season long 0 ~ 9223372036854775805 Season

Result

Type Description
item ClusterRankingData Cluster Ranking

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRanking(
    &ranking2.GetClusterRankingRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRanking(
        (new GetClusterRankingRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingRequest;
import io.gs2.ranking2.result.GetClusterRankingResult;

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

try {
    GetClusterRankingResult result = client.getClusterRanking(
        new GetClusterRankingRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(null)
    );
    ClusterRankingData 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingResult> asyncResult = null;
yield return client.GetClusterRanking(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRanking(
        new Gs2Ranking2.GetClusterRankingRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking(
        ranking2.GetClusterRankingRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_access_token('accessToken-0001')
            .with_season(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_cluster_ranking({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.get_cluster_ranking_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    accessToken="accessToken-0001",
    season=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;

getClusterRankingByUserId

Get Cluster Ranking by specifying the user ID

Retrieves the ranking position and score of the specified user for the specified cluster ranking. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
clusterName string
~ 1024 chars Cluster Name
The name of the cluster (guild, gathering, or group) that this season belongs to.
userId string
~ 128 chars User ID
season long 0 ~ 9223372036854775805 Season
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item ClusterRankingData Cluster Ranking

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRankingByUserId(
    &ranking2.GetClusterRankingByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        ClusterName: pointy.String("cluster-0001"),
        UserId: pointy.String("user-0001"),
        Season: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRankingByUserId(
        (new GetClusterRankingByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withClusterName("cluster-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingByUserIdRequest;
import io.gs2.ranking2.result.GetClusterRankingByUserIdResult;

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

try {
    GetClusterRankingByUserIdResult result = client.getClusterRankingByUserId(
        new GetClusterRankingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    ClusterRankingData 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingByUserIdResult> asyncResult = null;
yield return client.GetClusterRankingByUserId(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithClusterName("cluster-0001")
        .WithUserId("user-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRankingByUserId(
        new Gs2Ranking2.GetClusterRankingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withClusterName("cluster-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking_by_user_id(
        ranking2.GetClusterRankingByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_cluster_name('cluster-0001')
            .with_user_id('user-0001')
            .with_season(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_cluster_ranking_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.get_cluster_ranking_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    clusterName="cluster-0001",
    userId="user-0001",
    season=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;

describeSubscribes

Get a list of Subscribed User Information

Retrieves a paginated list of users that the requesting user has subscribed to for subscribe rankings. Can filter by ranking name.

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
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-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<SubscribeUser> List of Subscribed User Information
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribes(
    &ranking2.DescribeSubscribesRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribesRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribes(
        (new DescribeSubscribesRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribesRequest;
import io.gs2.ranking2.result.DescribeSubscribesResult;

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

try {
    DescribeSubscribesResult result = client.describeSubscribes(
        new DescribeSubscribesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SubscribeUser> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribesResult> asyncResult = null;
yield return client.DescribeSubscribes(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribesRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribes(
        new Gs2Ranking2.DescribeSubscribesRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-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 ranking2

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

try:
    result = client.describe_subscribes(
        ranking2.DescribeSubscribesRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-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('ranking2')

api_result = client.describe_subscribes({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-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('ranking2')

api_result_handler = client.describe_subscribes_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-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;

describeSubscribesByUserId

Get a list of Subscribed User Information by specifying a user ID

Retrieves a paginated list of users that the specified user has subscribed to for subscribe rankings. Can filter by ranking name.

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
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-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
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
items List<SubscribeUser> List of Subscribed User Information
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribesByUserId(
    &ranking2.DescribeSubscribesByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribesByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribesByUserId(
        (new DescribeSubscribesByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribesByUserIdRequest;
import io.gs2.ranking2.result.DescribeSubscribesByUserIdResult;

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

try {
    DescribeSubscribesByUserIdResult result = client.describeSubscribesByUserId(
        new DescribeSubscribesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<SubscribeUser> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribesByUserIdResult> asyncResult = null;
yield return client.DescribeSubscribesByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribesByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribesByUserId(
        new Gs2Ranking2.DescribeSubscribesByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-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 ranking2

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

try:
    result = client.describe_subscribes_by_user_id(
        ranking2.DescribeSubscribesByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-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('ranking2')

api_result = client.describe_subscribes_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-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('ranking2')

api_result_handler = client.describe_subscribes_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-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;

addSubscribe

Register Subscribe Target User ID

Subscribes to the specified target user for the specified subscribe ranking. The target user’s scores will be included in the requesting user’s subscribe ranking. When a subscription is added, existing scores of the target user are synced to the subscriber’s ranking 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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
targetUserId string
~ 128 chars Subscribe Target User ID

Result

Type Description
item SubscribeUser Registered Subscribe Target User ID

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.AddSubscribe(
    &ranking2.AddSubscribeRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        TargetUserId: pointy.String("user-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\AddSubscribeRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->addSubscribe(
        (new AddSubscribeRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withTargetUserId("user-0002")
    );
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.AddSubscribeRequest;
import io.gs2.ranking2.result.AddSubscribeResult;

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

try {
    AddSubscribeResult result = client.addSubscribe(
        new AddSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    SubscribeUser 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.AddSubscribeResult> asyncResult = null;
yield return client.AddSubscribe(
    new Gs2.Gs2Ranking2.Request.AddSubscribeRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithTargetUserId("user-0002"),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.addSubscribe(
        new Gs2Ranking2.AddSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.add_subscribe(
        ranking2.AddSubscribeRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_target_user_id('user-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.add_subscribe({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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('ranking2')

api_result_handler = client.add_subscribe_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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;

addSubscribeByUserId

Register Subscribe Target User ID specifying User ID

Subscribes to the specified target user for the specified subscribe ranking on behalf of the specified user. Existing scores are synced to the subscriber’s ranking 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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
targetUserId string
~ 128 chars Subscribe Target User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item SubscribeUser Registered Subscribe Target User ID

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.AddSubscribeByUserId(
    &ranking2.AddSubscribeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        TargetUserId: pointy.String("user-0002"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\AddSubscribeByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->addSubscribeByUserId(
        (new AddSubscribeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withTargetUserId("user-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.AddSubscribeByUserIdRequest;
import io.gs2.ranking2.result.AddSubscribeByUserIdResult;

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

try {
    AddSubscribeByUserIdResult result = client.addSubscribeByUserId(
        new AddSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    SubscribeUser 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.AddSubscribeByUserIdResult> asyncResult = null;
yield return client.AddSubscribeByUserId(
    new Gs2.Gs2Ranking2.Request.AddSubscribeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithTargetUserId("user-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.addSubscribeByUserId(
        new Gs2Ranking2.AddSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.add_subscribe_by_user_id(
        ranking2.AddSubscribeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_target_user_id('user-0002')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.add_subscribe_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    targetUserId="user-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('ranking2')

api_result_handler = client.add_subscribe_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    targetUserId="user-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;

describeSubscribeRankingScores

Get a list of Subscribe Ranking Scores

Retrieves a paginated list of subscribe ranking scores registered by the requesting user. Can filter by ranking name.

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
rankingName string ~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-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<SubscribeRankingScore> List of Subscribe Ranking Scores
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribeRankingScores(
    &ranking2.DescribeSubscribeRankingScoresRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribeRankingScoresRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribeRankingScores(
        (new DescribeSubscribeRankingScoresRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribeRankingScoresRequest;
import io.gs2.ranking2.result.DescribeSubscribeRankingScoresResult;

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

try {
    DescribeSubscribeRankingScoresResult result = client.describeSubscribeRankingScores(
        new DescribeSubscribeRankingScoresRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withPageToken(null)
            .withLimit(null)
    );
    List<SubscribeRankingScore> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribeRankingScoresResult> asyncResult = null;
yield return client.DescribeSubscribeRankingScores(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribeRankingScoresRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribeRankingScores(
        new Gs2Ranking2.DescribeSubscribeRankingScoresRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-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 ranking2

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

try:
    result = client.describe_subscribe_ranking_scores(
        ranking2.DescribeSubscribeRankingScoresRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-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('ranking2')

api_result = client.describe_subscribe_ranking_scores({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-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('ranking2')

api_result_handler = client.describe_subscribe_ranking_scores_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-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;

describeSubscribeRankingScoresByUserId

Get a list of Subscribe Ranking Scores by specifying a User ID

Retrieves a paginated list of subscribe ranking scores registered by the specified user. Can filter by ranking name.

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
rankingName string ~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-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
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
items List<SubscribeRankingScore> List of Subscribe Ranking Scores
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribeRankingScoresByUserId(
    &ranking2.DescribeSubscribeRankingScoresByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribeRankingScoresByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribeRankingScoresByUserId(
        (new DescribeSubscribeRankingScoresByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName(null)
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribeRankingScoresByUserIdRequest;
import io.gs2.ranking2.result.DescribeSubscribeRankingScoresByUserIdResult;

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

try {
    DescribeSubscribeRankingScoresByUserIdResult result = client.describeSubscribeRankingScoresByUserId(
        new DescribeSubscribeRankingScoresByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<SubscribeRankingScore> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribeRankingScoresByUserIdResult> asyncResult = null;
yield return client.DescribeSubscribeRankingScoresByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribeRankingScoresByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName(null)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribeRankingScoresByUserId(
        new Gs2Ranking2.DescribeSubscribeRankingScoresByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName(null)
            .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 ranking2

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

try:
    result = client.describe_subscribe_ranking_scores_by_user_id(
        ranking2.DescribeSubscribeRankingScoresByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name(None)
            .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('ranking2')

api_result = client.describe_subscribe_ranking_scores_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName=nil,
    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('ranking2')

api_result_handler = client.describe_subscribe_ranking_scores_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName=nil,
    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;

putSubscribeRankingScore

Register Subscribe Ranking Score

Registers a score for the specified subscribe ranking. The score is propagated to all subscribers’ ranking data. The score must be within the range defined by the ranking model.

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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
score long
0 ~ 9223372036854775805 Score
metadata string ~ 512 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.

Result

Type Description
item SubscribeRankingScore Registered Subscribe Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PutSubscribeRankingScore(
    &ranking2.PutSubscribeRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Score: pointy.Int64(100),
        Metadata: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PutSubscribeRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->putSubscribeRankingScore(
        (new PutSubscribeRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withScore(100)
            ->withMetadata(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PutSubscribeRankingScoreRequest;
import io.gs2.ranking2.result.PutSubscribeRankingScoreResult;

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

try {
    PutSubscribeRankingScoreResult result = client.putSubscribeRankingScore(
        new PutSubscribeRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withScore(100L)
            .withMetadata(null)
    );
    SubscribeRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PutSubscribeRankingScoreResult> asyncResult = null;
yield return client.PutSubscribeRankingScore(
    new Gs2.Gs2Ranking2.Request.PutSubscribeRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithScore(100L)
        .WithMetadata(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.putSubscribeRankingScore(
        new Gs2Ranking2.PutSubscribeRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withScore(100)
            .withMetadata(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.put_subscribe_ranking_score(
        ranking2.PutSubscribeRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_score(100)
            .with_metadata(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.put_subscribe_ranking_score({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    score=100,
    metadata=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('ranking2')

api_result_handler = client.put_subscribe_ranking_score_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    score=100,
    metadata=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;

putSubscribeRankingScoreByUserId

Register Subscribe Ranking Score specifying User ID

Registers a score for the specified subscribe ranking on behalf of the specified user. The score is propagated to all subscribers’ ranking 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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
score long
0 ~ 9223372036854775805 Score
metadata string ~ 512 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.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item SubscribeRankingScore Registered Subscribe Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PutSubscribeRankingScoreByUserId(
    &ranking2.PutSubscribeRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Score: nil,
        Metadata: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PutSubscribeRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->putSubscribeRankingScoreByUserId(
        (new PutSubscribeRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withScore(null)
            ->withMetadata(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PutSubscribeRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.PutSubscribeRankingScoreByUserIdResult;

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

try {
    PutSubscribeRankingScoreByUserIdResult result = client.putSubscribeRankingScoreByUserId(
        new PutSubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withScore(null)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    SubscribeRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PutSubscribeRankingScoreByUserIdResult> asyncResult = null;
yield return client.PutSubscribeRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.PutSubscribeRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithScore(null)
        .WithMetadata(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.putSubscribeRankingScoreByUserId(
        new Gs2Ranking2.PutSubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withScore(null)
            .withMetadata(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.put_subscribe_ranking_score_by_user_id(
        ranking2.PutSubscribeRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_score(None)
            .with_metadata(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.put_subscribe_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    score=nil,
    metadata=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('ranking2')

api_result_handler = client.put_subscribe_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    score=nil,
    metadata=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;

getSubscribeRankingScore

Get Subscribe Ranking Score

Retrieves the subscribe ranking score registered by the requesting user for the specified ranking. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
season long 0 ~ 9223372036854775805 Season

Result

Type Description
item SubscribeRankingScore Subscribe Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribeRankingScore(
    &ranking2.GetSubscribeRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: pointy.Int64(0),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribeRankingScore(
        (new GetSubscribeRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeRankingScoreRequest;
import io.gs2.ranking2.result.GetSubscribeRankingScoreResult;

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

try {
    GetSubscribeRankingScoreResult result = client.getSubscribeRankingScore(
        new GetSubscribeRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0L)
    );
    SubscribeRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeRankingScoreResult> asyncResult = null;
yield return client.GetSubscribeRankingScore(
    new Gs2.Gs2Ranking2.Request.GetSubscribeRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(0L),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribeRankingScore(
        new Gs2Ranking2.GetSubscribeRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(0)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe_ranking_score(
        ranking2.GetSubscribeRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_season(0)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_subscribe_ranking_score({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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('ranking2')

api_result_handler = client.get_subscribe_ranking_score_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=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;

getSubscribeRankingScoreByUserId

Get Subscribe Ranking Score specifying User ID

Retrieves the subscribe ranking score registered by the specified user for the specified ranking. Can optionally specify a season.

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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
season long 0 ~ 9223372036854775805 Season
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item SubscribeRankingScore Subscribe Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribeRankingScoreByUserId(
    &ranking2.GetSubscribeRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribeRankingScoreByUserId(
        (new GetSubscribeRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.GetSubscribeRankingScoreByUserIdResult;

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

try {
    GetSubscribeRankingScoreByUserIdResult result = client.getSubscribeRankingScoreByUserId(
        new GetSubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    SubscribeRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeRankingScoreByUserIdResult> asyncResult = null;
yield return client.GetSubscribeRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.GetSubscribeRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribeRankingScoreByUserId(
        new Gs2Ranking2.GetSubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe_ranking_score_by_user_id(
        ranking2.GetSubscribeRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_subscribe_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.get_subscribe_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

deleteSubscribeRankingScoreByUserId

Delete Subscribe Ranking Score specifying User ID

Deletes the subscribe ranking score registered by the specified user for the specified ranking and season.

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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
season long 0 ~ 9223372036854775805 Season
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item SubscribeRankingScore Subscribe Ranking Score deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteSubscribeRankingScoreByUserId(
    &ranking2.DeleteSubscribeRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: pointy.Int64(0),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteSubscribeRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteSubscribeRankingScoreByUserId(
        (new DeleteSubscribeRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteSubscribeRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.DeleteSubscribeRankingScoreByUserIdResult;

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

try {
    DeleteSubscribeRankingScoreByUserIdResult result = client.deleteSubscribeRankingScoreByUserId(
        new DeleteSubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0L)
            .withTimeOffsetToken(null)
    );
    SubscribeRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteSubscribeRankingScoreByUserIdResult> asyncResult = null;
yield return client.DeleteSubscribeRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.DeleteSubscribeRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(0L)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteSubscribeRankingScoreByUserId(
        new Gs2Ranking2.DeleteSubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(0)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_subscribe_ranking_score_by_user_id(
        ranking2.DeleteSubscribeRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(0)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.delete_subscribe_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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('ranking2')

api_result_handler = client.delete_subscribe_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=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;

verifySubscribeRankingScore

Verify the score of the subscribe ranking

Verifies the subscribe ranking score against a specified value using comparison operators (less, lessEqual, greater, greaterEqual, equal, notEqual). Can optionally specify a season.

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
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Score is less than the specified value
“lessEqual”Score is less than or equal to the specified value
“greater”Score is greater than the specified value
“greaterEqual”Score is greater than or equal to the specified value
“equal”Score is equal to the specified value
“notEqual”Score is not equal to the specified value
season long 0 ~ 9223372036854775805 Season
score long
0 ~ 9223372036854775805 Score
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity

Result

Type Description
item SubscribeRankingScore Subscribe Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.VerifySubscribeRankingScore(
    &ranking2.VerifySubscribeRankingScoreRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        VerifyType: pointy.String("less"),
        Season: nil,
        Score: pointy.Int64(100),
        MultiplyValueSpecifyingQuantity: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\VerifySubscribeRankingScoreRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->verifySubscribeRankingScore(
        (new VerifySubscribeRankingScoreRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withVerifyType("less")
            ->withSeason(null)
            ->withScore(100)
            ->withMultiplyValueSpecifyingQuantity(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.VerifySubscribeRankingScoreRequest;
import io.gs2.ranking2.result.VerifySubscribeRankingScoreResult;

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

try {
    VerifySubscribeRankingScoreResult result = client.verifySubscribeRankingScore(
        new VerifySubscribeRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100L)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    SubscribeRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.VerifySubscribeRankingScoreResult> asyncResult = null;
yield return client.VerifySubscribeRankingScore(
    new Gs2.Gs2Ranking2.Request.VerifySubscribeRankingScoreRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithVerifyType("less")
        .WithSeason(null)
        .WithScore(100L)
        .WithMultiplyValueSpecifyingQuantity(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.verifySubscribeRankingScore(
        new Gs2Ranking2.VerifySubscribeRankingScoreRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100)
            .withMultiplyValueSpecifyingQuantity(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.verify_subscribe_ranking_score(
        ranking2.VerifySubscribeRankingScoreRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_verify_type('less')
            .with_season(None)
            .with_score(100)
            .with_multiply_value_specifying_quantity(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.verify_subscribe_ranking_score({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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('ranking2')

api_result_handler = client.verify_subscribe_ranking_score_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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;

verifySubscribeRankingScoreByUserId

Verify the score of the subscribe ranking specifying User ID

Verifies the subscribe ranking score of the specified user against a specified value using comparison operators (less, lessEqual, greater, greaterEqual, equal, notEqual).

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
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
verifyType string (enum)
enum {
  “less”,
  “lessEqual”,
  “greater”,
  “greaterEqual”,
  “equal”,
  “notEqual”
}
Type of verification
DefinitionDescription
“less”Score is less than the specified value
“lessEqual”Score is less than or equal to the specified value
“greater”Score is greater than the specified value
“greaterEqual”Score is greater than or equal to the specified value
“equal”Score is equal to the specified value
“notEqual”Score is not equal to the specified value
season long 0 ~ 9223372036854775805 Season
score long
0 ~ 9223372036854775805 Score
multiplyValueSpecifyingQuantity bool true Whether to multiply the value used for verification when specifying the quantity
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item SubscribeRankingScore Subscribe Ranking Score

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.VerifySubscribeRankingScoreByUserId(
    &ranking2.VerifySubscribeRankingScoreByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        VerifyType: pointy.String("less"),
        Season: nil,
        Score: pointy.Int64(100),
        MultiplyValueSpecifyingQuantity: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\VerifySubscribeRankingScoreByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->verifySubscribeRankingScoreByUserId(
        (new VerifySubscribeRankingScoreByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withVerifyType("less")
            ->withSeason(null)
            ->withScore(100)
            ->withMultiplyValueSpecifyingQuantity(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.VerifySubscribeRankingScoreByUserIdRequest;
import io.gs2.ranking2.result.VerifySubscribeRankingScoreByUserIdResult;

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

try {
    VerifySubscribeRankingScoreByUserIdResult result = client.verifySubscribeRankingScoreByUserId(
        new VerifySubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100L)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    SubscribeRankingScore 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.VerifySubscribeRankingScoreByUserIdResult> asyncResult = null;
yield return client.VerifySubscribeRankingScoreByUserId(
    new Gs2.Gs2Ranking2.Request.VerifySubscribeRankingScoreByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithVerifyType("less")
        .WithSeason(null)
        .WithScore(100L)
        .WithMultiplyValueSpecifyingQuantity(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.verifySubscribeRankingScoreByUserId(
        new Gs2Ranking2.VerifySubscribeRankingScoreByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withVerifyType("less")
            .withSeason(null)
            .withScore(100)
            .withMultiplyValueSpecifyingQuantity(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.verify_subscribe_ranking_score_by_user_id(
        ranking2.VerifySubscribeRankingScoreByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_verify_type('less')
            .with_season(None)
            .with_score(100)
            .with_multiply_value_specifying_quantity(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.verify_subscribe_ranking_score_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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('ranking2')

api_result_handler = client.verify_subscribe_ranking_score_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    verifyType="less",
    season=nil,
    score=100,
    multiplyValueSpecifyingQuantity=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;

describeSubscribeRankings

Get a list of Subscribe Rankings

Retrieves a paginated list of subscribe ranking data for the specified ranking. The ranking only includes scores from users that the requesting user has subscribed to. Can optionally specify a season.

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
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long 0 ~ 9223372036854775805 Season
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<SubscribeRankingData> List of Subscribe Rankings
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribeRankings(
    &ranking2.DescribeSubscribeRankingsRequest {
        NamespaceName: pointy.String("namespace-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribeRankingsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribeRankings(
        (new DescribeSubscribeRankingsRequest())
            ->withNamespaceName("namespace-0001")
            ->withAccessToken("accessToken-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribeRankingsRequest;
import io.gs2.ranking2.result.DescribeSubscribeRankingsResult;

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

try {
    DescribeSubscribeRankingsResult result = client.describeSubscribeRankings(
        new DescribeSubscribeRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<SubscribeRankingData> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribeRankingsResult> asyncResult = null;
yield return client.DescribeSubscribeRankings(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribeRankingsRequest()
        .WithNamespaceName("namespace-0001")
        .WithAccessToken("accessToken-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribeRankings(
        new Gs2Ranking2.DescribeSubscribeRankingsRequest()
            .withNamespaceName("namespace-0001")
            .withAccessToken("accessToken-0001")
            .withRankingName("ranking-0001")
            .withSeason(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 ranking2

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

try:
    result = client.describe_subscribe_rankings(
        ranking2.DescribeSubscribeRankingsRequest()
            .with_namespace_name('namespace-0001')
            .with_access_token('accessToken-0001')
            .with_ranking_name('ranking-0001')
            .with_season(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('ranking2')

api_result = client.describe_subscribe_rankings({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=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('ranking2')

api_result_handler = client.describe_subscribe_rankings_async({
    namespaceName="namespace-0001",
    accessToken="accessToken-0001",
    rankingName="ranking-0001",
    season=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;

describeSubscribeRankingsByUserId

Get a list of Subscribe Rankings by specifying a user ID

Retrieves a paginated list of subscribe ranking data for the specified ranking on behalf of the specified user. The ranking only includes scores from users that the specified user has subscribed to.

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
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
season long 0 ~ 9223372036854775805 Season
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<SubscribeRankingData> List of Subscribe Rankings
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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribeRankingsByUserId(
    &ranking2.DescribeSubscribeRankingsByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        UserId: pointy.String("user-0001"),
        RankingName: pointy.String("ranking-0001"),
        Season: nil,
        PageToken: nil,
        Limit: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribeRankingsByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribeRankingsByUserId(
        (new DescribeSubscribeRankingsByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withUserId("user-0001")
            ->withRankingName("ranking-0001")
            ->withSeason(null)
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribeRankingsByUserIdRequest;
import io.gs2.ranking2.result.DescribeSubscribeRankingsByUserIdResult;

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

try {
    DescribeSubscribeRankingsByUserIdResult result = client.describeSubscribeRankingsByUserId(
        new DescribeSubscribeRankingsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .withPageToken(null)
            .withLimit(null)
            .withTimeOffsetToken(null)
    );
    List<SubscribeRankingData> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribeRankingsByUserIdResult> asyncResult = null;
yield return client.DescribeSubscribeRankingsByUserId(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribeRankingsByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithUserId("user-0001")
        .WithRankingName("ranking-0001")
        .WithSeason(null)
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribeRankingsByUserId(
        new Gs2Ranking2.DescribeSubscribeRankingsByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withUserId("user-0001")
            .withRankingName("ranking-0001")
            .withSeason(null)
            .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 ranking2

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

try:
    result = client.describe_subscribe_rankings_by_user_id(
        ranking2.DescribeSubscribeRankingsByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_user_id('user-0001')
            .with_ranking_name('ranking-0001')
            .with_season(None)
            .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('ranking2')

api_result = client.describe_subscribe_rankings_by_user_id({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    season=nil,
    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('ranking2')

api_result_handler = client.describe_subscribe_rankings_by_user_id_async({
    namespaceName="namespace-0001",
    userId="user-0001",
    rankingName="ranking-0001",
    season=nil,
    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;

getSubscribeRanking

Get Subscribe Ranking

Retrieves the ranking position and score of the requesting user (or a specified scorer) within the subscribe ranking. Can optionally specify a season and scorer user 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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
season long 0 ~ 9223372036854775805 Season
scorerUserId string ~ 128 chars Scorer User ID
The user ID of the player who achieved this score. In a subscribe ranking, entries come from subscribed users, so this field identifies which friend’s score this entry represents.

Result

Type Description
item SubscribeRankingData Subscribe Ranking

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribeRanking(
    &ranking2.GetSubscribeRankingRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        Season: nil,
        ScorerUserId: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeRankingRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribeRanking(
        (new GetSubscribeRankingRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withSeason(null)
            ->withScorerUserId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeRankingRequest;
import io.gs2.ranking2.result.GetSubscribeRankingResult;

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

try {
    GetSubscribeRankingResult result = client.getSubscribeRanking(
        new GetSubscribeRankingRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(null)
            .withScorerUserId(null)
    );
    SubscribeRankingData 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeRankingResult> asyncResult = null;
yield return client.GetSubscribeRanking(
    new Gs2.Gs2Ranking2.Request.GetSubscribeRankingRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithSeason(null)
        .WithScorerUserId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribeRanking(
        new Gs2Ranking2.GetSubscribeRankingRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withSeason(null)
            .withScorerUserId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe_ranking(
        ranking2.GetSubscribeRankingRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_season(None)
            .with_scorer_user_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_subscribe_ranking({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=nil,
    scorerUserId=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('ranking2')

api_result_handler = client.get_subscribe_ranking_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    season=nil,
    scorerUserId=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;

getSubscribeRankingByUserId

Get Subscribe Ranking by specifying the user ID

Retrieves the ranking position and score of the specified user (or a specified scorer) within the subscribe ranking. Can optionally specify a season and scorer user 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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
season long 0 ~ 9223372036854775805 Season
scorerUserId string ~ 128 chars Scorer User ID
The user ID of the player who achieved this score. In a subscribe ranking, entries come from subscribed users, so this field identifies which friend’s score this entry represents.
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item SubscribeRankingData Subscribe Ranking

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribeRankingByUserId(
    &ranking2.GetSubscribeRankingByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        Season: nil,
        ScorerUserId: nil,
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeRankingByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribeRankingByUserId(
        (new GetSubscribeRankingByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withSeason(null)
            ->withScorerUserId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeRankingByUserIdRequest;
import io.gs2.ranking2.result.GetSubscribeRankingByUserIdResult;

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

try {
    GetSubscribeRankingByUserIdResult result = client.getSubscribeRankingByUserId(
        new GetSubscribeRankingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withScorerUserId(null)
            .withTimeOffsetToken(null)
    );
    SubscribeRankingData 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeRankingByUserIdResult> asyncResult = null;
yield return client.GetSubscribeRankingByUserId(
    new Gs2.Gs2Ranking2.Request.GetSubscribeRankingByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithSeason(null)
        .WithScorerUserId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribeRankingByUserId(
        new Gs2Ranking2.GetSubscribeRankingByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withSeason(null)
            .withScorerUserId(null)
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe_ranking_by_user_id(
        ranking2.GetSubscribeRankingByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_season(None)
            .with_scorer_user_id(None)
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_subscribe_ranking_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=nil,
    scorerUserId=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('ranking2')

api_result_handler = client.get_subscribe_ranking_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    season=nil,
    scorerUserId=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;

getSubscribe

Get Subscribe Target User ID

Retrieves the subscription information for the specified target user in the specified subscribe ranking.

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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
targetUserId string
~ 128 chars Subscribe Target User ID

Result

Type Description
item SubscribeUser Subscribed User Information

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribe(
    &ranking2.GetSubscribeRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        TargetUserId: pointy.String("user-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribe(
        (new GetSubscribeRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withTargetUserId("user-0002")
    );
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeRequest;
import io.gs2.ranking2.result.GetSubscribeResult;

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

try {
    GetSubscribeResult result = client.getSubscribe(
        new GetSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    SubscribeUser 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeResult> asyncResult = null;
yield return client.GetSubscribe(
    new Gs2.Gs2Ranking2.Request.GetSubscribeRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithTargetUserId("user-0002"),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribe(
        new Gs2Ranking2.GetSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe(
        ranking2.GetSubscribeRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_target_user_id('user-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_subscribe({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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('ranking2')

api_result_handler = client.get_subscribe_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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;

getSubscribeByUserId

Get Subscribe Target User ID specifying User ID

Retrieves the subscription information for the specified target user in the specified subscribe ranking for the specified user.

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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
targetUserId string
~ 128 chars Subscribe Target User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item SubscribeUser Subscribed User Information

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribeByUserId(
    &ranking2.GetSubscribeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        TargetUserId: pointy.String("user-0002"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribeByUserId(
        (new GetSubscribeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withTargetUserId("user-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeByUserIdRequest;
import io.gs2.ranking2.result.GetSubscribeByUserIdResult;

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

try {
    GetSubscribeByUserIdResult result = client.getSubscribeByUserId(
        new GetSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    SubscribeUser 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeByUserIdResult> asyncResult = null;
yield return client.GetSubscribeByUserId(
    new Gs2.Gs2Ranking2.Request.GetSubscribeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithTargetUserId("user-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribeByUserId(
        new Gs2Ranking2.GetSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe_by_user_id(
        ranking2.GetSubscribeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_target_user_id('user-0002')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_subscribe_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    targetUserId="user-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('ranking2')

api_result_handler = client.get_subscribe_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    targetUserId="user-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;

deleteSubscribe

Delete Subscribe Target User ID

Removes the subscription to the specified target user for the specified subscribe ranking. The target user’s scores will no longer appear in the requesting user’s subscribe ranking.

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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
accessToken string
~ 128 chars Access token
targetUserId string
~ 128 chars Subscribe Target User ID

Result

Type Description
item SubscribeUser Subscribed User Information deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteSubscribe(
    &ranking2.DeleteSubscribeRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        AccessToken: pointy.String("accessToken-0001"),
        TargetUserId: pointy.String("user-0002"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteSubscribeRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteSubscribe(
        (new DeleteSubscribeRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withAccessToken("accessToken-0001")
            ->withTargetUserId("user-0002")
    );
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteSubscribeRequest;
import io.gs2.ranking2.result.DeleteSubscribeResult;

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

try {
    DeleteSubscribeResult result = client.deleteSubscribe(
        new DeleteSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    SubscribeUser 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteSubscribeResult> asyncResult = null;
yield return client.DeleteSubscribe(
    new Gs2.Gs2Ranking2.Request.DeleteSubscribeRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithAccessToken("accessToken-0001")
        .WithTargetUserId("user-0002"),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteSubscribe(
        new Gs2Ranking2.DeleteSubscribeRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withAccessToken("accessToken-0001")
            .withTargetUserId("user-0002")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_subscribe(
        ranking2.DeleteSubscribeRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_access_token('accessToken-0001')
            .with_target_user_id('user-0002')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.delete_subscribe({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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('ranking2')

api_result_handler = client.delete_subscribe_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    accessToken="accessToken-0001",
    targetUserId="user-0002",
})

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;

deleteSubscribeByUserId

Delete Subscribe Target User ID specifying User ID

Removes the subscription to the specified target user for the specified subscribe ranking on behalf of the specified user.

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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
targetUserId string
~ 128 chars Subscribe Target User ID
timeOffsetToken string ~ 1024 chars Time offset token

Result

Type Description
item SubscribeUser Subscribed User Information deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteSubscribeByUserId(
    &ranking2.DeleteSubscribeByUserIdRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
        UserId: pointy.String("user-0001"),
        TargetUserId: pointy.String("user-0002"),
        TimeOffsetToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteSubscribeByUserIdRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteSubscribeByUserId(
        (new DeleteSubscribeByUserIdRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-0001")
            ->withUserId("user-0001")
            ->withTargetUserId("user-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteSubscribeByUserIdRequest;
import io.gs2.ranking2.result.DeleteSubscribeByUserIdResult;

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

try {
    DeleteSubscribeByUserIdResult result = client.deleteSubscribeByUserId(
        new DeleteSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    SubscribeUser 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteSubscribeByUserIdResult> asyncResult = null;
yield return client.DeleteSubscribeByUserId(
    new Gs2.Gs2Ranking2.Request.DeleteSubscribeByUserIdRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-0001")
        .WithUserId("user-0001")
        .WithTargetUserId("user-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteSubscribeByUserId(
        new Gs2Ranking2.DeleteSubscribeByUserIdRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
            .withUserId("user-0001")
            .withTargetUserId("user-0002")
            .withTimeOffsetToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_subscribe_by_user_id(
        ranking2.DeleteSubscribeByUserIdRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
            .with_user_id('user-0001')
            .with_target_user_id('user-0002')
            .with_time_offset_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.delete_subscribe_by_user_id({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    targetUserId="user-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('ranking2')

api_result_handler = client.delete_subscribe_by_user_id_async({
    namespaceName="namespace-0001",
    rankingName="ranking-0001",
    userId="user-0001",
    targetUserId="user-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;

describeGlobalRankingModels

Get a list of Global Ranking Models

Retrieves the list of currently active global ranking models. Global ranking models define ranking configurations including score range, sort order, reward settings, and entry/access period events.

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<GlobalRankingModel> List of Global Ranking Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankingModels(
    &ranking2.DescribeGlobalRankingModelsRequest {
        NamespaceName: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingModelsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankingModels(
        (new DescribeGlobalRankingModelsRequest())
            ->withNamespaceName(null)
    );
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingModelsRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingModelsResult;

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

try {
    DescribeGlobalRankingModelsResult result = client.describeGlobalRankingModels(
        new DescribeGlobalRankingModelsRequest()
            .withNamespaceName(null)
    );
    List<GlobalRankingModel> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingModelsResult> asyncResult = null;
yield return client.DescribeGlobalRankingModels(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingModelsRequest()
        .WithNamespaceName(null),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankingModels(
        new Gs2Ranking2.DescribeGlobalRankingModelsRequest()
            .withNamespaceName(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_global_ranking_models(
        ranking2.DescribeGlobalRankingModelsRequest()
            .with_namespace_name(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.describe_global_ranking_models({
    namespaceName=nil,
})

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('ranking2')

api_result_handler = client.describe_global_ranking_models_async({
    namespaceName=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;

getGlobalRankingModel

Get Global Ranking Model

Retrieves the specified global ranking model including its score range, sort order, ranking rewards, and entry/access period event configurations.

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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item GlobalRankingModel Global Ranking Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRankingModel(
    &ranking2.GetGlobalRankingModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingModelRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRankingModel(
        (new GetGlobalRankingModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingModelRequest;
import io.gs2.ranking2.result.GetGlobalRankingModelResult;

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

try {
    GetGlobalRankingModelResult result = client.getGlobalRankingModel(
        new GetGlobalRankingModelRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
    );
    GlobalRankingModel 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingModelResult> asyncResult = null;
yield return client.GetGlobalRankingModel(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRankingModel(
        new Gs2Ranking2.GetGlobalRankingModelRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking_model(
        ranking2.GetGlobalRankingModelRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_global_ranking_model({
    namespaceName="namespace-0001",
    rankingName="ranking-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('ranking2')

api_result_handler = client.get_global_ranking_model_async({
    namespaceName="namespace-0001",
    rankingName="ranking-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;

describeClusterRankingModels

Get a list of Cluster Ranking Models

Retrieves the list of currently active cluster ranking models. Cluster ranking models define ranking configurations with cluster type (guild or matchmaking gathering), score range, sort order, reward settings, and entry/access period events.

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<ClusterRankingModel> List of Cluster Ranking Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankingModels(
    &ranking2.DescribeClusterRankingModelsRequest {
        NamespaceName: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingModelsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankingModels(
        (new DescribeClusterRankingModelsRequest())
            ->withNamespaceName(null)
    );
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingModelsRequest;
import io.gs2.ranking2.result.DescribeClusterRankingModelsResult;

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

try {
    DescribeClusterRankingModelsResult result = client.describeClusterRankingModels(
        new DescribeClusterRankingModelsRequest()
            .withNamespaceName(null)
    );
    List<ClusterRankingModel> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingModelsResult> asyncResult = null;
yield return client.DescribeClusterRankingModels(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingModelsRequest()
        .WithNamespaceName(null),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankingModels(
        new Gs2Ranking2.DescribeClusterRankingModelsRequest()
            .withNamespaceName(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_cluster_ranking_models(
        ranking2.DescribeClusterRankingModelsRequest()
            .with_namespace_name(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.describe_cluster_ranking_models({
    namespaceName=nil,
})

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('ranking2')

api_result_handler = client.describe_cluster_ranking_models_async({
    namespaceName=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;

getClusterRankingModel

Get Cluster Ranking Model

Retrieves the specified cluster ranking model including its cluster type, score range, sort order, ranking rewards, and entry/access period event configurations.

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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item ClusterRankingModel Cluster Ranking Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRankingModel(
    &ranking2.GetClusterRankingModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingModelRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRankingModel(
        (new GetClusterRankingModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingModelRequest;
import io.gs2.ranking2.result.GetClusterRankingModelResult;

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

try {
    GetClusterRankingModelResult result = client.getClusterRankingModel(
        new GetClusterRankingModelRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
    );
    ClusterRankingModel 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingModelResult> asyncResult = null;
yield return client.GetClusterRankingModel(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRankingModel(
        new Gs2Ranking2.GetClusterRankingModelRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking_model(
        ranking2.GetClusterRankingModelRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_cluster_ranking_model({
    namespaceName="namespace-0001",
    rankingName="ranking-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('ranking2')

api_result_handler = client.get_cluster_ranking_model_async({
    namespaceName="namespace-0001",
    rankingName="ranking-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;

describeSubscribeRankingModels

Get a list of Subscribe Ranking Models

Retrieves the list of currently active subscribe ranking models. Subscribe ranking models define ranking configurations where users only compete with subscribed friends, including score range, sort order, and entry/access period events.

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<SubscribeRankingModel> List of Subscribe Ranking Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribeRankingModels(
    &ranking2.DescribeSubscribeRankingModelsRequest {
        NamespaceName: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribeRankingModelsRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribeRankingModels(
        (new DescribeSubscribeRankingModelsRequest())
            ->withNamespaceName(null)
    );
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribeRankingModelsRequest;
import io.gs2.ranking2.result.DescribeSubscribeRankingModelsResult;

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

try {
    DescribeSubscribeRankingModelsResult result = client.describeSubscribeRankingModels(
        new DescribeSubscribeRankingModelsRequest()
            .withNamespaceName(null)
    );
    List<SubscribeRankingModel> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribeRankingModelsResult> asyncResult = null;
yield return client.DescribeSubscribeRankingModels(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribeRankingModelsRequest()
        .WithNamespaceName(null),
    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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribeRankingModels(
        new Gs2Ranking2.DescribeSubscribeRankingModelsRequest()
            .withNamespaceName(null)
    );
    const items = result.getItems();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.describe_subscribe_ranking_models(
        ranking2.DescribeSubscribeRankingModelsRequest()
            .with_namespace_name(None)
    )
    items = result.items
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.describe_subscribe_ranking_models({
    namespaceName=nil,
})

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('ranking2')

api_result_handler = client.describe_subscribe_ranking_models_async({
    namespaceName=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;

getSubscribeRankingModel

Get Subscribe Ranking Model

Retrieves the specified subscribe ranking model including its score range, sort order, and entry/access period event configurations.

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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item SubscribeRankingModel Subscribe Ranking Model

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribeRankingModel(
    &ranking2.GetSubscribeRankingModelRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("ranking-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeRankingModelRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribeRankingModel(
        (new GetSubscribeRankingModelRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("ranking-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeRankingModelRequest;
import io.gs2.ranking2.result.GetSubscribeRankingModelResult;

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

try {
    GetSubscribeRankingModelResult result = client.getSubscribeRankingModel(
        new GetSubscribeRankingModelRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
    );
    SubscribeRankingModel 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeRankingModelResult> asyncResult = null;
yield return client.GetSubscribeRankingModel(
    new Gs2.Gs2Ranking2.Request.GetSubscribeRankingModelRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("ranking-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribeRankingModel(
        new Gs2Ranking2.GetSubscribeRankingModelRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("ranking-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe_ranking_model(
        ranking2.GetSubscribeRankingModelRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('ranking-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_subscribe_ranking_model({
    namespaceName="namespace-0001",
    rankingName="ranking-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('ranking2')

api_result_handler = client.get_subscribe_ranking_model_async({
    namespaceName="namespace-0001",
    rankingName="ranking-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;

exportMaster

Export Model Master in a master data format that can be activated

Exports the currently registered global, cluster, and subscribe ranking model masters in an activatable master data format.

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 CurrentRankingMaster Export Model Master in a master data format that can be activated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.ExportMaster(
    &ranking2.ExportMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\ExportMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.ExportMasterRequest;
import io.gs2.ranking2.result.ExportMasterResult;

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

try {
    ExportMasterResult result = client.exportMaster(
        new ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentRankingMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.ExportMasterResult> asyncResult = null;
yield return client.ExportMaster(
    new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.exportMaster(
        new Gs2Ranking2.ExportMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.export_master(
        ranking2.ExportMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

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('ranking2')

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;

getCurrentRankingMaster

Get currently active Ranking Model master data

Retrieves the currently active ranking model master data including global, cluster, and subscribe ranking model definitions.

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 CurrentRankingMaster Currently active Ranking Model master data

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetCurrentRankingMaster(
    &ranking2.GetCurrentRankingMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetCurrentRankingMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getCurrentRankingMaster(
        (new GetCurrentRankingMasterRequest())
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetCurrentRankingMasterRequest;
import io.gs2.ranking2.result.GetCurrentRankingMasterResult;

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

try {
    GetCurrentRankingMasterResult result = client.getCurrentRankingMaster(
        new GetCurrentRankingMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    CurrentRankingMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetCurrentRankingMasterResult> asyncResult = null;
yield return client.GetCurrentRankingMaster(
    new Gs2.Gs2Ranking2.Request.GetCurrentRankingMasterRequest()
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getCurrentRankingMaster(
        new Gs2Ranking2.GetCurrentRankingMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_current_ranking_master(
        ranking2.GetCurrentRankingMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_current_ranking_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('ranking2')

api_result_handler = client.get_current_ranking_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;

preUpdateCurrentRankingMaster

Update currently active Ranking Model master data (3-phase version)

When uploading master data larger than 1MB, the update is performed in 3 phases.

  1. Execute this API to obtain a token and URL for uploading.
  2. Upload the master data to the obtained URL.
  3. Execute UpdateCurrentModelMaster by passing the token obtained from the 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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.PreUpdateCurrentRankingMaster(
    &ranking2.PreUpdateCurrentRankingMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
uploadToken := result.UploadToken
uploadUrl := result.UploadUrl
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\PreUpdateCurrentRankingMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->preUpdateCurrentRankingMaster(
        (new PreUpdateCurrentRankingMasterRequest())
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.PreUpdateCurrentRankingMasterRequest;
import io.gs2.ranking2.result.PreUpdateCurrentRankingMasterResult;

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

try {
    PreUpdateCurrentRankingMasterResult result = client.preUpdateCurrentRankingMaster(
        new PreUpdateCurrentRankingMasterRequest()
            .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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.PreUpdateCurrentRankingMasterResult> asyncResult = null;
yield return client.PreUpdateCurrentRankingMaster(
    new Gs2.Gs2Ranking2.Request.PreUpdateCurrentRankingMasterRequest()
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.preUpdateCurrentRankingMaster(
        new Gs2Ranking2.PreUpdateCurrentRankingMasterRequest()
            .withNamespaceName("namespace-0001")
    );
    const uploadToken = result.getUploadToken();
    const uploadUrl = result.getUploadUrl();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.pre_update_current_ranking_master(
        ranking2.PreUpdateCurrentRankingMasterRequest()
            .with_namespace_name('namespace-0001')
    )
    upload_token = result.upload_token
    upload_url = result.upload_url
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.pre_update_current_ranking_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('ranking2')

api_result_handler = client.pre_update_current_ranking_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;

updateCurrentRankingMaster

Update currently active Ranking Model master data

Updates the currently active ranking model master data. Supports both direct update mode and pre-upload mode for handling large 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 (.).
mode string (enum)
enum {
  “direct”,
  “preUpload”
}
“direct” Update mode
DefinitionDescription
“direct”Directly update master data
“preUpload”Upload master data and then update
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 CurrentRankingMaster Updated master data of the currently active Ranking Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.UpdateCurrentRankingMaster(
    &ranking2.UpdateCurrentRankingMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Mode: pointy.String("direct"),
        Settings: pointy.String("{\"version\": \"2024-05-30\", \"globalRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}], \"clusterRankingModels\": [{\"name\": \"ranking-0001\", \"clusterType\": \"Raw\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"clusterType\": \"Gs2Guild::Guild\", \"orderDirection\": \"desc\"}], \"subscribeRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}]}"),
        UploadToken: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\UpdateCurrentRankingMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->updateCurrentRankingMaster(
        (new UpdateCurrentRankingMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withMode("direct")
            ->withSettings("{\"version\": \"2024-05-30\", \"globalRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}], \"clusterRankingModels\": [{\"name\": \"ranking-0001\", \"clusterType\": \"Raw\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"clusterType\": \"Gs2Guild::Guild\", \"orderDirection\": \"desc\"}], \"subscribeRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}]}")
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.UpdateCurrentRankingMasterRequest;
import io.gs2.ranking2.result.UpdateCurrentRankingMasterResult;

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

try {
    UpdateCurrentRankingMasterResult result = client.updateCurrentRankingMaster(
        new UpdateCurrentRankingMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-05-30\", \"globalRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}], \"clusterRankingModels\": [{\"name\": \"ranking-0001\", \"clusterType\": \"Raw\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"clusterType\": \"Gs2Guild::Guild\", \"orderDirection\": \"desc\"}], \"subscribeRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}]}")
            .withUploadToken(null)
    );
    CurrentRankingMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.UpdateCurrentRankingMasterResult> asyncResult = null;
yield return client.UpdateCurrentRankingMaster(
    new Gs2.Gs2Ranking2.Request.UpdateCurrentRankingMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithMode("direct")
        .WithSettings("{\"version\": \"2024-05-30\", \"globalRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}], \"clusterRankingModels\": [{\"name\": \"ranking-0001\", \"clusterType\": \"Raw\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"clusterType\": \"Gs2Guild::Guild\", \"orderDirection\": \"desc\"}], \"subscribeRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}]}")
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.updateCurrentRankingMaster(
        new Gs2Ranking2.UpdateCurrentRankingMasterRequest()
            .withNamespaceName("namespace-0001")
            .withMode("direct")
            .withSettings("{\"version\": \"2024-05-30\", \"globalRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}], \"clusterRankingModels\": [{\"name\": \"ranking-0001\", \"clusterType\": \"Raw\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"clusterType\": \"Gs2Guild::Guild\", \"orderDirection\": \"desc\"}], \"subscribeRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}]}")
            .withUploadToken(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.update_current_ranking_master(
        ranking2.UpdateCurrentRankingMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_mode('direct')
            .with_settings('{"version": "2024-05-30", "globalRankingModels": [{"name": "ranking-0001", "orderDirection": "asc"}, {"name": "ranking-0002", "orderDirection": "desc"}], "clusterRankingModels": [{"name": "ranking-0001", "clusterType": "Raw", "orderDirection": "asc"}, {"name": "ranking-0002", "clusterType": "Gs2Guild::Guild", "orderDirection": "desc"}], "subscribeRankingModels": [{"name": "ranking-0001", "orderDirection": "asc"}, {"name": "ranking-0002", "orderDirection": "desc"}]}')
            .with_upload_token(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.update_current_ranking_master({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-05-30\", \"globalRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}], \"clusterRankingModels\": [{\"name\": \"ranking-0001\", \"clusterType\": \"Raw\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"clusterType\": \"Gs2Guild::Guild\", \"orderDirection\": \"desc\"}], \"subscribeRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}]}",
    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('ranking2')

api_result_handler = client.update_current_ranking_master_async({
    namespaceName="namespace-0001",
    mode="direct",
    settings="{\"version\": \"2024-05-30\", \"globalRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}], \"clusterRankingModels\": [{\"name\": \"ranking-0001\", \"clusterType\": \"Raw\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"clusterType\": \"Gs2Guild::Guild\", \"orderDirection\": \"desc\"}], \"subscribeRankingModels\": [{\"name\": \"ranking-0001\", \"orderDirection\": \"asc\"}, {\"name\": \"ranking-0002\", \"orderDirection\": \"desc\"}]}",
    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;

updateCurrentRankingMasterFromGitHub

Update currently active Ranking Model master data from GitHub

Updates the currently active ranking model master data by checking out master data from a GitHub repository using the specified checkout 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 (.).
checkoutSetting GitHubCheckoutSetting
Setting for checking out master data from GitHub

Result

Type Description
item CurrentRankingMaster Updated master data of the currently active Ranking Models

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.UpdateCurrentRankingMasterFromGitHub(
    &ranking2.UpdateCurrentRankingMasterFromGitHubRequest {
        NamespaceName: pointy.String("namespace-0001"),
        CheckoutSetting: &ranking2.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.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\UpdateCurrentRankingMasterFromGitHubRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->updateCurrentRankingMasterFromGitHub(
        (new UpdateCurrentRankingMasterFromGitHubRequest())
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.UpdateCurrentRankingMasterFromGitHubRequest;
import io.gs2.ranking2.result.UpdateCurrentRankingMasterFromGitHubResult;

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

try {
    UpdateCurrentRankingMasterFromGitHubResult result = client.updateCurrentRankingMasterFromGitHub(
        new UpdateCurrentRankingMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new GitHubCheckoutSetting()
                .withApiKeyId("apiKeyId-0001")
                .withRepositoryName("gs2io/master-data")
                .withSourcePath("path/to/file.json")
                .withReferenceType("branch")
                .withBranchName("develop")
            )
    );
    CurrentRankingMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.UpdateCurrentRankingMasterFromGitHubResult> asyncResult = null;
yield return client.UpdateCurrentRankingMasterFromGitHub(
    new Gs2.Gs2Ranking2.Request.UpdateCurrentRankingMasterFromGitHubRequest()
        .WithNamespaceName("namespace-0001")
        .WithCheckoutSetting(new Gs2.Gs2Ranking2.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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.updateCurrentRankingMasterFromGitHub(
        new Gs2Ranking2.UpdateCurrentRankingMasterFromGitHubRequest()
            .withNamespaceName("namespace-0001")
            .withCheckoutSetting(new Gs2Ranking2.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 ranking2

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

try:
    result = client.update_current_ranking_master_from_git_hub(
        ranking2.UpdateCurrentRankingMasterFromGitHubRequest()
            .with_namespace_name('namespace-0001')
            .with_checkout_setting(ranking2.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('ranking2')

api_result = client.update_current_ranking_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('ranking2')

api_result_handler = client.update_current_ranking_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;

describeGlobalRankingModelMasters

Get a list of Global Ranking Model Masters

Retrieves a paginated list of global ranking model masters. Can filter by name prefix.

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 (.).
namePrefix string ~ 64 chars Filter by global ranking model 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<GlobalRankingModelMaster> List of Global Ranking 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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeGlobalRankingModelMasters(
    &ranking2.DescribeGlobalRankingModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeGlobalRankingModelMastersRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeGlobalRankingModelMasters(
        (new DescribeGlobalRankingModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeGlobalRankingModelMastersRequest;
import io.gs2.ranking2.result.DescribeGlobalRankingModelMastersResult;

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

try {
    DescribeGlobalRankingModelMastersResult result = client.describeGlobalRankingModelMasters(
        new DescribeGlobalRankingModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<GlobalRankingModelMaster> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeGlobalRankingModelMastersResult> asyncResult = null;
yield return client.DescribeGlobalRankingModelMasters(
    new Gs2.Gs2Ranking2.Request.DescribeGlobalRankingModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeGlobalRankingModelMasters(
        new Gs2Ranking2.DescribeGlobalRankingModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .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 ranking2

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

try:
    result = client.describe_global_ranking_model_masters(
        ranking2.DescribeGlobalRankingModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .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('ranking2')

api_result = client.describe_global_ranking_model_masters({
    namespaceName="namespace-0001",
    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('ranking2')

api_result_handler = client.describe_global_ranking_model_masters_async({
    namespaceName="namespace-0001",
    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;

createGlobalRankingModelMaster

Create Global Ranking Model Master

Creates a new global ranking model master with score range, sort order, sum mode, ranking rewards, reward calculation index, and entry/access period event configurations.

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 (.).
name string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 1024 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.
minimumValue long 0 ~ 9223372036854775805 Minimum Score
The minimum allowed score value. Scores below this value will be rejected when submitted. Used to filter out invalid or unintended score values.
maximumValue long 0 ~ 9223372036854775805 Maximum Score
The maximum allowed score value. Scores above this value will be rejected when submitted. Used to prevent abnormally high scores from being registered.
sum bool false Sum Scores
When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score (highest or lowest depending on sort direction) is used for ranking.
orderDirection string (enum)
enum {
  “asc”,
  “desc”
}
Order Direction
The sort direction for ranking scores. Use “asc” for rankings where lower scores are better (e.g., time trials), or “desc” for rankings where higher scores are better (e.g., high scores).
DefinitionDescription
“asc”ascending-order
“desc”descending-order
rankingRewards List<RankingReward> {entryPeriodEventId} != null [] 0 ~ 100 items Ranking Rewards
List of rewards granted based on ranking position at the end of each season. Only available when an entry period event is configured. Each reward defines a rank threshold and the acquire actions to execute.
rewardCalculationIndex string (enum)
enum {
  “rank”,
  “index”
}
“rank” Reward Calculation Index
Determines how rewards are matched to players. “rank” uses the 1-based ranking position (players with tied scores share the same rank), while “index” uses the 0-based unique sorted position (no ties). Choose “rank” for most typical use cases.
DefinitionDescription
“rank”Determine rewards based on rank
“index”Determine rewards based on index
entryPeriodEventId string ~ 1024 chars Entry Period Event GRN
accessPeriodEventId string ~ 1024 chars Access Period Event GRN

Result

Type Description
item GlobalRankingModelMaster Global Ranking Model Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateGlobalRankingModelMaster(
    &ranking2.CreateGlobalRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("global-0001"),
        Description: nil,
        Metadata: nil,
        MinimumValue: nil,
        MaximumValue: nil,
        Sum: nil,
        OrderDirection: pointy.String("asc"),
        RankingRewards: nil,
        RewardCalculationIndex: nil,
        EntryPeriodEventId: nil,
        AccessPeriodEventId: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateGlobalRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createGlobalRankingModelMaster(
        (new CreateGlobalRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("global-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withMinimumValue(null)
            ->withMaximumValue(null)
            ->withSum(null)
            ->withOrderDirection("asc")
            ->withRankingRewards(null)
            ->withRewardCalculationIndex(null)
            ->withEntryPeriodEventId(null)
            ->withAccessPeriodEventId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateGlobalRankingModelMasterRequest;
import io.gs2.ranking2.result.CreateGlobalRankingModelMasterResult;

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

try {
    CreateGlobalRankingModelMasterResult result = client.createGlobalRankingModelMaster(
        new CreateGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("global-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMinimumValue(null)
            .withMaximumValue(null)
            .withSum(null)
            .withOrderDirection("asc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    GlobalRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateGlobalRankingModelMasterResult> asyncResult = null;
yield return client.CreateGlobalRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.CreateGlobalRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("global-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithMinimumValue(null)
        .WithMaximumValue(null)
        .WithSum(null)
        .WithOrderDirection("asc")
        .WithRankingRewards(null)
        .WithRewardCalculationIndex(null)
        .WithEntryPeriodEventId(null)
        .WithAccessPeriodEventId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createGlobalRankingModelMaster(
        new Gs2Ranking2.CreateGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("global-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMinimumValue(null)
            .withMaximumValue(null)
            .withSum(null)
            .withOrderDirection("asc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.create_global_ranking_model_master(
        ranking2.CreateGlobalRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('global-0001')
            .with_description(None)
            .with_metadata(None)
            .with_minimum_value(None)
            .with_maximum_value(None)
            .with_sum(None)
            .with_order_direction('asc')
            .with_ranking_rewards(None)
            .with_reward_calculation_index(None)
            .with_entry_period_event_id(None)
            .with_access_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.create_global_ranking_model_master({
    namespaceName="namespace-0001",
    name="global-0001",
    description=nil,
    metadata=nil,
    minimumValue=nil,
    maximumValue=nil,
    sum=nil,
    orderDirection="asc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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('ranking2')

api_result_handler = client.create_global_ranking_model_master_async({
    namespaceName="namespace-0001",
    name="global-0001",
    description=nil,
    metadata=nil,
    minimumValue=nil,
    maximumValue=nil,
    sum=nil,
    orderDirection="asc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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;

getGlobalRankingModelMaster

Get Global Ranking Model Master

Retrieves the specified global ranking 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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item GlobalRankingModelMaster Global Ranking Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetGlobalRankingModelMaster(
    &ranking2.GetGlobalRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("global-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetGlobalRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getGlobalRankingModelMaster(
        (new GetGlobalRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("global-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetGlobalRankingModelMasterRequest;
import io.gs2.ranking2.result.GetGlobalRankingModelMasterResult;

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

try {
    GetGlobalRankingModelMasterResult result = client.getGlobalRankingModelMaster(
        new GetGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("global-0001")
    );
    GlobalRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetGlobalRankingModelMasterResult> asyncResult = null;
yield return client.GetGlobalRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.GetGlobalRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("global-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getGlobalRankingModelMaster(
        new Gs2Ranking2.GetGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("global-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_global_ranking_model_master(
        ranking2.GetGlobalRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('global-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_global_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="global-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('ranking2')

api_result_handler = client.get_global_ranking_model_master_async({
    namespaceName="namespace-0001",
    rankingName="global-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;

updateGlobalRankingModelMaster

Update Global Ranking Model Master

Updates the specified global ranking model master’s score range, sort order, sum mode, ranking rewards, reward calculation index, and entry/access period event configurations.

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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 1024 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.
minimumValue long 0 ~ 9223372036854775805 Minimum Score
The minimum allowed score value. Scores below this value will be rejected when submitted. Used to filter out invalid or unintended score values.
maximumValue long 0 ~ 9223372036854775805 Maximum Score
The maximum allowed score value. Scores above this value will be rejected when submitted. Used to prevent abnormally high scores from being registered.
sum bool false Sum Scores
When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score (highest or lowest depending on sort direction) is used for ranking.
orderDirection string (enum)
enum {
  “asc”,
  “desc”
}
Order Direction
The sort direction for ranking scores. Use “asc” for rankings where lower scores are better (e.g., time trials), or “desc” for rankings where higher scores are better (e.g., high scores).
DefinitionDescription
“asc”ascending-order
“desc”descending-order
rankingRewards List<RankingReward> {entryPeriodEventId} != null [] 0 ~ 100 items Ranking Rewards
List of rewards granted based on ranking position at the end of each season. Only available when an entry period event is configured. Each reward defines a rank threshold and the acquire actions to execute.
rewardCalculationIndex string (enum)
enum {
  “rank”,
  “index”
}
“rank” Reward Calculation Index
Determines how rewards are matched to players. “rank” uses the 1-based ranking position (players with tied scores share the same rank), while “index” uses the 0-based unique sorted position (no ties). Choose “rank” for most typical use cases.
DefinitionDescription
“rank”Determine rewards based on rank
“index”Determine rewards based on index
entryPeriodEventId string ~ 1024 chars Entry Period Event GRN
accessPeriodEventId string ~ 1024 chars Access Period Event GRN

Result

Type Description
item GlobalRankingModelMaster Global Ranking Model Master updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.UpdateGlobalRankingModelMaster(
    &ranking2.UpdateGlobalRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("global-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("CATEGORY_0001"),
        MinimumValue: pointy.Int64(100),
        MaximumValue: pointy.Int64(10000),
        Sum: nil,
        OrderDirection: pointy.String("desc"),
        RankingRewards: nil,
        RewardCalculationIndex: nil,
        EntryPeriodEventId: nil,
        AccessPeriodEventId: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\UpdateGlobalRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->updateGlobalRankingModelMaster(
        (new UpdateGlobalRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("global-0001")
            ->withDescription("description1")
            ->withMetadata("CATEGORY_0001")
            ->withMinimumValue(100)
            ->withMaximumValue(10000)
            ->withSum(null)
            ->withOrderDirection("desc")
            ->withRankingRewards(null)
            ->withRewardCalculationIndex(null)
            ->withEntryPeriodEventId(null)
            ->withAccessPeriodEventId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.UpdateGlobalRankingModelMasterRequest;
import io.gs2.ranking2.result.UpdateGlobalRankingModelMasterResult;

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

try {
    UpdateGlobalRankingModelMasterResult result = client.updateGlobalRankingModelMaster(
        new UpdateGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("global-0001")
            .withDescription("description1")
            .withMetadata("CATEGORY_0001")
            .withMinimumValue(100L)
            .withMaximumValue(10000L)
            .withSum(null)
            .withOrderDirection("desc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    GlobalRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.UpdateGlobalRankingModelMasterResult> asyncResult = null;
yield return client.UpdateGlobalRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.UpdateGlobalRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("global-0001")
        .WithDescription("description1")
        .WithMetadata("CATEGORY_0001")
        .WithMinimumValue(100L)
        .WithMaximumValue(10000L)
        .WithSum(null)
        .WithOrderDirection("desc")
        .WithRankingRewards(null)
        .WithRewardCalculationIndex(null)
        .WithEntryPeriodEventId(null)
        .WithAccessPeriodEventId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.updateGlobalRankingModelMaster(
        new Gs2Ranking2.UpdateGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("global-0001")
            .withDescription("description1")
            .withMetadata("CATEGORY_0001")
            .withMinimumValue(100)
            .withMaximumValue(10000)
            .withSum(null)
            .withOrderDirection("desc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.update_global_ranking_model_master(
        ranking2.UpdateGlobalRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('global-0001')
            .with_description('description1')
            .with_metadata('CATEGORY_0001')
            .with_minimum_value(100)
            .with_maximum_value(10000)
            .with_sum(None)
            .with_order_direction('desc')
            .with_ranking_rewards(None)
            .with_reward_calculation_index(None)
            .with_entry_period_event_id(None)
            .with_access_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.update_global_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="global-0001",
    description="description1",
    metadata="CATEGORY_0001",
    minimumValue=100,
    maximumValue=10000,
    sum=nil,
    orderDirection="desc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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('ranking2')

api_result_handler = client.update_global_ranking_model_master_async({
    namespaceName="namespace-0001",
    rankingName="global-0001",
    description="description1",
    metadata="CATEGORY_0001",
    minimumValue=100,
    maximumValue=10000,
    sum=nil,
    orderDirection="desc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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;

deleteGlobalRankingModelMaster

Delete Global Ranking Model Master

Deletes the specified global ranking 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 (.).
rankingName string
~ 128 chars Global Ranking Model name
Global Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item GlobalRankingModelMaster Global Ranking Model Master deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteGlobalRankingModelMaster(
    &ranking2.DeleteGlobalRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("global-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteGlobalRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteGlobalRankingModelMaster(
        (new DeleteGlobalRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("global-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteGlobalRankingModelMasterRequest;
import io.gs2.ranking2.result.DeleteGlobalRankingModelMasterResult;

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

try {
    DeleteGlobalRankingModelMasterResult result = client.deleteGlobalRankingModelMaster(
        new DeleteGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("global-0001")
    );
    GlobalRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteGlobalRankingModelMasterResult> asyncResult = null;
yield return client.DeleteGlobalRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.DeleteGlobalRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("global-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteGlobalRankingModelMaster(
        new Gs2Ranking2.DeleteGlobalRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("global-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_global_ranking_model_master(
        ranking2.DeleteGlobalRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('global-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.delete_global_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="global-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('ranking2')

api_result_handler = client.delete_global_ranking_model_master_async({
    namespaceName="namespace-0001",
    rankingName="global-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;

describeClusterRankingModelMasters

Get a list of Cluster Ranking Model Masters

Retrieves a paginated list of cluster ranking model masters. Can filter by name prefix.

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 (.).
namePrefix string ~ 64 chars Filter by cluster ranking model 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<ClusterRankingModelMaster> List of Cluster Ranking 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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeClusterRankingModelMasters(
    &ranking2.DescribeClusterRankingModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeClusterRankingModelMastersRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeClusterRankingModelMasters(
        (new DescribeClusterRankingModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeClusterRankingModelMastersRequest;
import io.gs2.ranking2.result.DescribeClusterRankingModelMastersResult;

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

try {
    DescribeClusterRankingModelMastersResult result = client.describeClusterRankingModelMasters(
        new DescribeClusterRankingModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<ClusterRankingModelMaster> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeClusterRankingModelMastersResult> asyncResult = null;
yield return client.DescribeClusterRankingModelMasters(
    new Gs2.Gs2Ranking2.Request.DescribeClusterRankingModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeClusterRankingModelMasters(
        new Gs2Ranking2.DescribeClusterRankingModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .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 ranking2

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

try:
    result = client.describe_cluster_ranking_model_masters(
        ranking2.DescribeClusterRankingModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .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('ranking2')

api_result = client.describe_cluster_ranking_model_masters({
    namespaceName="namespace-0001",
    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('ranking2')

api_result_handler = client.describe_cluster_ranking_model_masters_async({
    namespaceName="namespace-0001",
    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;

createClusterRankingModelMaster

Create Cluster Ranking Model Master

Creates a new cluster ranking model master with cluster type, score range, sort order, sum mode, ranking rewards, reward calculation index, and entry/access period event configurations.

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 (.).
name string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 1024 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.
clusterType string (enum)
enum {
  “Raw”,
  “Gs2Guild::Guild”,
  “Gs2Matchmaking::SeasonGathering”
}
Cluster Type
Defines the type of group (cluster) used for ranking segmentation. “Raw” allows arbitrary cluster names without membership verification, “Gs2Guild::Guild” verifies the user belongs to a GS2-Guild guild, and “Gs2Matchmaking::SeasonGathering” verifies membership in a GS2-Matchmaking season gathering.
DefinitionDescription
“Raw”No verification
“Gs2Guild::Guild”GS2-Guild Guild
“Gs2Matchmaking::SeasonGathering”GS2-Matchmaking Season Gathering
minimumValue long 0 ~ 9223372036854775805 Minimum Score
The minimum allowed score value. Scores below this value will be rejected when submitted.
maximumValue long 0 ~ 9223372036854775805 Maximum Score
The maximum allowed score value. Scores above this value will be rejected when submitted.
sum bool false Sum Scores
When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score is used for ranking.
orderDirection string (enum)
enum {
  “asc”,
  “desc”
}
Order Direction
The sort direction for ranking scores. Use “asc” for lower-is-better rankings, or “desc” for higher-is-better rankings.
DefinitionDescription
“asc”ascending-order
“desc”descending-order
rankingRewards List<RankingReward> {entryPeriodEventId} != null [] 0 ~ 100 items Ranking Rewards
List of rewards granted based on ranking position at the end of each season. Only available when an entry period event is configured.
rewardCalculationIndex string (enum)
enum {
  “rank”,
  “index”
}
“rank” Reward Calculation Index
Determines how rewards are matched to players. “rank” uses the 1-based ranking position (tied scores share same rank), “index” uses the 0-based unique sorted position (no ties).
DefinitionDescription
“rank”Determine rewards based on rank
“index”Determine rewards based on index
entryPeriodEventId string ~ 1024 chars Entry Period Event GRN
accessPeriodEventId string ~ 1024 chars Access Period Event GRN

Result

Type Description
item ClusterRankingModelMaster Cluster Ranking Model Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateClusterRankingModelMaster(
    &ranking2.CreateClusterRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("cluster-0001"),
        Description: nil,
        Metadata: nil,
        ClusterType: pointy.String("Raw"),
        MinimumValue: nil,
        MaximumValue: nil,
        Sum: nil,
        OrderDirection: pointy.String("asc"),
        RankingRewards: nil,
        RewardCalculationIndex: nil,
        EntryPeriodEventId: nil,
        AccessPeriodEventId: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateClusterRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createClusterRankingModelMaster(
        (new CreateClusterRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("cluster-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withClusterType("Raw")
            ->withMinimumValue(null)
            ->withMaximumValue(null)
            ->withSum(null)
            ->withOrderDirection("asc")
            ->withRankingRewards(null)
            ->withRewardCalculationIndex(null)
            ->withEntryPeriodEventId(null)
            ->withAccessPeriodEventId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateClusterRankingModelMasterRequest;
import io.gs2.ranking2.result.CreateClusterRankingModelMasterResult;

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

try {
    CreateClusterRankingModelMasterResult result = client.createClusterRankingModelMaster(
        new CreateClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("cluster-0001")
            .withDescription(null)
            .withMetadata(null)
            .withClusterType("Raw")
            .withMinimumValue(null)
            .withMaximumValue(null)
            .withSum(null)
            .withOrderDirection("asc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    ClusterRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateClusterRankingModelMasterResult> asyncResult = null;
yield return client.CreateClusterRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.CreateClusterRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("cluster-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithClusterType("Raw")
        .WithMinimumValue(null)
        .WithMaximumValue(null)
        .WithSum(null)
        .WithOrderDirection("asc")
        .WithRankingRewards(null)
        .WithRewardCalculationIndex(null)
        .WithEntryPeriodEventId(null)
        .WithAccessPeriodEventId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createClusterRankingModelMaster(
        new Gs2Ranking2.CreateClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("cluster-0001")
            .withDescription(null)
            .withMetadata(null)
            .withClusterType("Raw")
            .withMinimumValue(null)
            .withMaximumValue(null)
            .withSum(null)
            .withOrderDirection("asc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.create_cluster_ranking_model_master(
        ranking2.CreateClusterRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('cluster-0001')
            .with_description(None)
            .with_metadata(None)
            .with_cluster_type('Raw')
            .with_minimum_value(None)
            .with_maximum_value(None)
            .with_sum(None)
            .with_order_direction('asc')
            .with_ranking_rewards(None)
            .with_reward_calculation_index(None)
            .with_entry_period_event_id(None)
            .with_access_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.create_cluster_ranking_model_master({
    namespaceName="namespace-0001",
    name="cluster-0001",
    description=nil,
    metadata=nil,
    clusterType="Raw",
    minimumValue=nil,
    maximumValue=nil,
    sum=nil,
    orderDirection="asc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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('ranking2')

api_result_handler = client.create_cluster_ranking_model_master_async({
    namespaceName="namespace-0001",
    name="cluster-0001",
    description=nil,
    metadata=nil,
    clusterType="Raw",
    minimumValue=nil,
    maximumValue=nil,
    sum=nil,
    orderDirection="asc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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;

getClusterRankingModelMaster

Get Cluster Ranking Model Master

Retrieves the specified cluster ranking 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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item ClusterRankingModelMaster Cluster Ranking Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetClusterRankingModelMaster(
    &ranking2.GetClusterRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("cluster-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetClusterRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getClusterRankingModelMaster(
        (new GetClusterRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("cluster-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetClusterRankingModelMasterRequest;
import io.gs2.ranking2.result.GetClusterRankingModelMasterResult;

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

try {
    GetClusterRankingModelMasterResult result = client.getClusterRankingModelMaster(
        new GetClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("cluster-0001")
    );
    ClusterRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetClusterRankingModelMasterResult> asyncResult = null;
yield return client.GetClusterRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.GetClusterRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("cluster-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getClusterRankingModelMaster(
        new Gs2Ranking2.GetClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("cluster-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_cluster_ranking_model_master(
        ranking2.GetClusterRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('cluster-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_cluster_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="cluster-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('ranking2')

api_result_handler = client.get_cluster_ranking_model_master_async({
    namespaceName="namespace-0001",
    rankingName="cluster-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;

updateClusterRankingModelMaster

Update Cluster Ranking Model Master

Updates the specified cluster ranking model master’s cluster type, score range, sort order, sum mode, ranking rewards, reward calculation index, and entry/access period event configurations.

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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 1024 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.
clusterType string (enum)
enum {
  “Raw”,
  “Gs2Guild::Guild”,
  “Gs2Matchmaking::SeasonGathering”
}
Cluster Type
Defines the type of group (cluster) used for ranking segmentation. “Raw” allows arbitrary cluster names without membership verification, “Gs2Guild::Guild” verifies the user belongs to a GS2-Guild guild, and “Gs2Matchmaking::SeasonGathering” verifies membership in a GS2-Matchmaking season gathering.
DefinitionDescription
“Raw”No verification
“Gs2Guild::Guild”GS2-Guild Guild
“Gs2Matchmaking::SeasonGathering”GS2-Matchmaking Season Gathering
minimumValue long 0 ~ 9223372036854775805 Minimum Score
The minimum allowed score value. Scores below this value will be rejected when submitted.
maximumValue long 0 ~ 9223372036854775805 Maximum Score
The maximum allowed score value. Scores above this value will be rejected when submitted.
sum bool false Sum Scores
When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score is used for ranking.
orderDirection string (enum)
enum {
  “asc”,
  “desc”
}
Order Direction
The sort direction for ranking scores. Use “asc” for lower-is-better rankings, or “desc” for higher-is-better rankings.
DefinitionDescription
“asc”ascending-order
“desc”descending-order
rankingRewards List<RankingReward> {entryPeriodEventId} != null [] 0 ~ 100 items Ranking Rewards
List of rewards granted based on ranking position at the end of each season. Only available when an entry period event is configured.
rewardCalculationIndex string (enum)
enum {
  “rank”,
  “index”
}
“rank” Reward Calculation Index
Determines how rewards are matched to players. “rank” uses the 1-based ranking position (tied scores share same rank), “index” uses the 0-based unique sorted position (no ties).
DefinitionDescription
“rank”Determine rewards based on rank
“index”Determine rewards based on index
entryPeriodEventId string ~ 1024 chars Entry Period Event GRN
accessPeriodEventId string ~ 1024 chars Access Period Event GRN

Result

Type Description
item ClusterRankingModelMaster Cluster Ranking Model Master updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.UpdateClusterRankingModelMaster(
    &ranking2.UpdateClusterRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("cluster-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("CATEGORY_0001"),
        ClusterType: pointy.String("Gs2Guild::Guild"),
        MinimumValue: pointy.Int64(100),
        MaximumValue: pointy.Int64(10000),
        Sum: nil,
        OrderDirection: pointy.String("desc"),
        RankingRewards: nil,
        RewardCalculationIndex: nil,
        EntryPeriodEventId: nil,
        AccessPeriodEventId: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\UpdateClusterRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->updateClusterRankingModelMaster(
        (new UpdateClusterRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("cluster-0001")
            ->withDescription("description1")
            ->withMetadata("CATEGORY_0001")
            ->withClusterType("Gs2Guild::Guild")
            ->withMinimumValue(100)
            ->withMaximumValue(10000)
            ->withSum(null)
            ->withOrderDirection("desc")
            ->withRankingRewards(null)
            ->withRewardCalculationIndex(null)
            ->withEntryPeriodEventId(null)
            ->withAccessPeriodEventId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.UpdateClusterRankingModelMasterRequest;
import io.gs2.ranking2.result.UpdateClusterRankingModelMasterResult;

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

try {
    UpdateClusterRankingModelMasterResult result = client.updateClusterRankingModelMaster(
        new UpdateClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("cluster-0001")
            .withDescription("description1")
            .withMetadata("CATEGORY_0001")
            .withClusterType("Gs2Guild::Guild")
            .withMinimumValue(100L)
            .withMaximumValue(10000L)
            .withSum(null)
            .withOrderDirection("desc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    ClusterRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.UpdateClusterRankingModelMasterResult> asyncResult = null;
yield return client.UpdateClusterRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.UpdateClusterRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("cluster-0001")
        .WithDescription("description1")
        .WithMetadata("CATEGORY_0001")
        .WithClusterType("Gs2Guild::Guild")
        .WithMinimumValue(100L)
        .WithMaximumValue(10000L)
        .WithSum(null)
        .WithOrderDirection("desc")
        .WithRankingRewards(null)
        .WithRewardCalculationIndex(null)
        .WithEntryPeriodEventId(null)
        .WithAccessPeriodEventId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.updateClusterRankingModelMaster(
        new Gs2Ranking2.UpdateClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("cluster-0001")
            .withDescription("description1")
            .withMetadata("CATEGORY_0001")
            .withClusterType("Gs2Guild::Guild")
            .withMinimumValue(100)
            .withMaximumValue(10000)
            .withSum(null)
            .withOrderDirection("desc")
            .withRankingRewards(null)
            .withRewardCalculationIndex(null)
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.update_cluster_ranking_model_master(
        ranking2.UpdateClusterRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('cluster-0001')
            .with_description('description1')
            .with_metadata('CATEGORY_0001')
            .with_cluster_type('Gs2Guild::Guild')
            .with_minimum_value(100)
            .with_maximum_value(10000)
            .with_sum(None)
            .with_order_direction('desc')
            .with_ranking_rewards(None)
            .with_reward_calculation_index(None)
            .with_entry_period_event_id(None)
            .with_access_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.update_cluster_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="cluster-0001",
    description="description1",
    metadata="CATEGORY_0001",
    clusterType="Gs2Guild::Guild",
    minimumValue=100,
    maximumValue=10000,
    sum=nil,
    orderDirection="desc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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('ranking2')

api_result_handler = client.update_cluster_ranking_model_master_async({
    namespaceName="namespace-0001",
    rankingName="cluster-0001",
    description="description1",
    metadata="CATEGORY_0001",
    clusterType="Gs2Guild::Guild",
    minimumValue=100,
    maximumValue=10000,
    sum=nil,
    orderDirection="desc",
    rankingRewards=nil,
    rewardCalculationIndex=nil,
    entryPeriodEventId=nil,
    accessPeriodEventId=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;

deleteClusterRankingModelMaster

Delete Cluster Ranking Model Master

Deletes the specified cluster ranking 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 (.).
rankingName string
~ 128 chars Cluster Ranking Model name
Cluster Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item ClusterRankingModelMaster Cluster Ranking Model Master deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteClusterRankingModelMaster(
    &ranking2.DeleteClusterRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("cluster-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteClusterRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteClusterRankingModelMaster(
        (new DeleteClusterRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("cluster-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteClusterRankingModelMasterRequest;
import io.gs2.ranking2.result.DeleteClusterRankingModelMasterResult;

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

try {
    DeleteClusterRankingModelMasterResult result = client.deleteClusterRankingModelMaster(
        new DeleteClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("cluster-0001")
    );
    ClusterRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteClusterRankingModelMasterResult> asyncResult = null;
yield return client.DeleteClusterRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.DeleteClusterRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("cluster-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteClusterRankingModelMaster(
        new Gs2Ranking2.DeleteClusterRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("cluster-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_cluster_ranking_model_master(
        ranking2.DeleteClusterRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('cluster-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.delete_cluster_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="cluster-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('ranking2')

api_result_handler = client.delete_cluster_ranking_model_master_async({
    namespaceName="namespace-0001",
    rankingName="cluster-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;

describeSubscribeRankingModelMasters

Get a list of Subscribe Ranking Model Masters

Retrieves a paginated list of subscribe ranking model masters. Can filter by name prefix.

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 (.).
namePrefix string ~ 64 chars Filter by subscribe ranking model 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<SubscribeRankingModelMaster> List of Subscribe Ranking 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/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DescribeSubscribeRankingModelMasters(
    &ranking2.DescribeSubscribeRankingModelMastersRequest {
        NamespaceName: pointy.String("namespace-0001"),
        NamePrefix: nil,
        PageToken: nil,
        Limit: nil,
    }
)
if err != nil {
    panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DescribeSubscribeRankingModelMastersRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->describeSubscribeRankingModelMasters(
        (new DescribeSubscribeRankingModelMastersRequest())
            ->withNamespaceName("namespace-0001")
            ->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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DescribeSubscribeRankingModelMastersRequest;
import io.gs2.ranking2.result.DescribeSubscribeRankingModelMastersResult;

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

try {
    DescribeSubscribeRankingModelMastersResult result = client.describeSubscribeRankingModelMasters(
        new DescribeSubscribeRankingModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .withNamePrefix(null)
            .withPageToken(null)
            .withLimit(null)
    );
    List<SubscribeRankingModelMaster> 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DescribeSubscribeRankingModelMastersResult> asyncResult = null;
yield return client.DescribeSubscribeRankingModelMasters(
    new Gs2.Gs2Ranking2.Request.DescribeSubscribeRankingModelMastersRequest()
        .WithNamespaceName("namespace-0001")
        .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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.describeSubscribeRankingModelMasters(
        new Gs2Ranking2.DescribeSubscribeRankingModelMastersRequest()
            .withNamespaceName("namespace-0001")
            .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 ranking2

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

try:
    result = client.describe_subscribe_ranking_model_masters(
        ranking2.DescribeSubscribeRankingModelMastersRequest()
            .with_namespace_name('namespace-0001')
            .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('ranking2')

api_result = client.describe_subscribe_ranking_model_masters({
    namespaceName="namespace-0001",
    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('ranking2')

api_result_handler = client.describe_subscribe_ranking_model_masters_async({
    namespaceName="namespace-0001",
    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;

createSubscribeRankingModelMaster

Create Subscribe Ranking Model Master

Creates a new subscribe ranking model master with score range, sort order, sum mode, and entry/access period event configurations.

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 (.).
name string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 1024 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.
minimumValue long 0 ~ 9223372036854775805 Minimum Score
The minimum allowed score value. Scores below this value will be rejected when submitted.
maximumValue long 0 ~ 9223372036854775805 Maximum Score
The maximum allowed score value. Scores above this value will be rejected when submitted.
sum bool false Sum Scores
When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score is used for ranking.
orderDirection string (enum)
enum {
  “asc”,
  “desc”
}
Order Direction
The sort direction for ranking scores. Use “asc” for lower-is-better rankings, or “desc” for higher-is-better rankings.
DefinitionDescription
“asc”ascending-order
“desc”descending-order
entryPeriodEventId string ~ 1024 chars Entry Period Event GRN
accessPeriodEventId string ~ 1024 chars Access Period Event GRN

Result

Type Description
item SubscribeRankingModelMaster Subscribe Ranking Model Master created

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.CreateSubscribeRankingModelMaster(
    &ranking2.CreateSubscribeRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        Name: pointy.String("subscribe-0001"),
        Description: nil,
        Metadata: nil,
        MinimumValue: nil,
        MaximumValue: nil,
        Sum: nil,
        OrderDirection: pointy.String("asc"),
        EntryPeriodEventId: nil,
        AccessPeriodEventId: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\CreateSubscribeRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->createSubscribeRankingModelMaster(
        (new CreateSubscribeRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withName("subscribe-0001")
            ->withDescription(null)
            ->withMetadata(null)
            ->withMinimumValue(null)
            ->withMaximumValue(null)
            ->withSum(null)
            ->withOrderDirection("asc")
            ->withEntryPeriodEventId(null)
            ->withAccessPeriodEventId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.CreateSubscribeRankingModelMasterRequest;
import io.gs2.ranking2.result.CreateSubscribeRankingModelMasterResult;

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

try {
    CreateSubscribeRankingModelMasterResult result = client.createSubscribeRankingModelMaster(
        new CreateSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("subscribe-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMinimumValue(null)
            .withMaximumValue(null)
            .withSum(null)
            .withOrderDirection("asc")
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    SubscribeRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.CreateSubscribeRankingModelMasterResult> asyncResult = null;
yield return client.CreateSubscribeRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.CreateSubscribeRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithName("subscribe-0001")
        .WithDescription(null)
        .WithMetadata(null)
        .WithMinimumValue(null)
        .WithMaximumValue(null)
        .WithSum(null)
        .WithOrderDirection("asc")
        .WithEntryPeriodEventId(null)
        .WithAccessPeriodEventId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.createSubscribeRankingModelMaster(
        new Gs2Ranking2.CreateSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withName("subscribe-0001")
            .withDescription(null)
            .withMetadata(null)
            .withMinimumValue(null)
            .withMaximumValue(null)
            .withSum(null)
            .withOrderDirection("asc")
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.create_subscribe_ranking_model_master(
        ranking2.CreateSubscribeRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_name('subscribe-0001')
            .with_description(None)
            .with_metadata(None)
            .with_minimum_value(None)
            .with_maximum_value(None)
            .with_sum(None)
            .with_order_direction('asc')
            .with_entry_period_event_id(None)
            .with_access_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.create_subscribe_ranking_model_master({
    namespaceName="namespace-0001",
    name="subscribe-0001",
    description=nil,
    metadata=nil,
    minimumValue=nil,
    maximumValue=nil,
    sum=nil,
    orderDirection="asc",
    entryPeriodEventId=nil,
    accessPeriodEventId=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('ranking2')

api_result_handler = client.create_subscribe_ranking_model_master_async({
    namespaceName="namespace-0001",
    name="subscribe-0001",
    description=nil,
    metadata=nil,
    minimumValue=nil,
    maximumValue=nil,
    sum=nil,
    orderDirection="asc",
    entryPeriodEventId=nil,
    accessPeriodEventId=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;

getSubscribeRankingModelMaster

Get Subscribe Ranking Model Master

Retrieves the specified subscribe ranking 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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item SubscribeRankingModelMaster Subscribe Ranking Model Master

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.GetSubscribeRankingModelMaster(
    &ranking2.GetSubscribeRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("subscribe-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\GetSubscribeRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->getSubscribeRankingModelMaster(
        (new GetSubscribeRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("subscribe-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.GetSubscribeRankingModelMasterRequest;
import io.gs2.ranking2.result.GetSubscribeRankingModelMasterResult;

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

try {
    GetSubscribeRankingModelMasterResult result = client.getSubscribeRankingModelMaster(
        new GetSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("subscribe-0001")
    );
    SubscribeRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.GetSubscribeRankingModelMasterResult> asyncResult = null;
yield return client.GetSubscribeRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.GetSubscribeRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("subscribe-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.getSubscribeRankingModelMaster(
        new Gs2Ranking2.GetSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("subscribe-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.get_subscribe_ranking_model_master(
        ranking2.GetSubscribeRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('subscribe-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.get_subscribe_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="subscribe-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('ranking2')

api_result_handler = client.get_subscribe_ranking_model_master_async({
    namespaceName="namespace-0001",
    rankingName="subscribe-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;

updateSubscribeRankingModelMaster

Update Subscribe Ranking Model Master

Updates the specified subscribe ranking model master’s score range, sort order, sum mode, and entry/access period event configurations.

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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
description string ~ 1024 chars Description
metadata string ~ 1024 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.
minimumValue long 0 ~ 9223372036854775805 Minimum Score
The minimum allowed score value. Scores below this value will be rejected when submitted.
maximumValue long 0 ~ 9223372036854775805 Maximum Score
The maximum allowed score value. Scores above this value will be rejected when submitted.
sum bool false Sum Scores
When enabled, all submitted scores are accumulated and the ranking is determined by the total value. When disabled, only the best score is used for ranking.
orderDirection string (enum)
enum {
  “asc”,
  “desc”
}
Order Direction
The sort direction for ranking scores. Use “asc” for lower-is-better rankings, or “desc” for higher-is-better rankings.
DefinitionDescription
“asc”ascending-order
“desc”descending-order
entryPeriodEventId string ~ 1024 chars Entry Period Event GRN
accessPeriodEventId string ~ 1024 chars Access Period Event GRN

Result

Type Description
item SubscribeRankingModelMaster Subscribe Ranking Model Master updated

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.UpdateSubscribeRankingModelMaster(
    &ranking2.UpdateSubscribeRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("subscribe-0001"),
        Description: pointy.String("description1"),
        Metadata: pointy.String("CATEGORY_0001"),
        MinimumValue: pointy.Int64(100),
        MaximumValue: pointy.Int64(10000),
        Sum: nil,
        OrderDirection: pointy.String("desc"),
        EntryPeriodEventId: nil,
        AccessPeriodEventId: nil,
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\UpdateSubscribeRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->updateSubscribeRankingModelMaster(
        (new UpdateSubscribeRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("subscribe-0001")
            ->withDescription("description1")
            ->withMetadata("CATEGORY_0001")
            ->withMinimumValue(100)
            ->withMaximumValue(10000)
            ->withSum(null)
            ->withOrderDirection("desc")
            ->withEntryPeriodEventId(null)
            ->withAccessPeriodEventId(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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.UpdateSubscribeRankingModelMasterRequest;
import io.gs2.ranking2.result.UpdateSubscribeRankingModelMasterResult;

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

try {
    UpdateSubscribeRankingModelMasterResult result = client.updateSubscribeRankingModelMaster(
        new UpdateSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("subscribe-0001")
            .withDescription("description1")
            .withMetadata("CATEGORY_0001")
            .withMinimumValue(100L)
            .withMaximumValue(10000L)
            .withSum(null)
            .withOrderDirection("desc")
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    SubscribeRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.UpdateSubscribeRankingModelMasterResult> asyncResult = null;
yield return client.UpdateSubscribeRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.UpdateSubscribeRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("subscribe-0001")
        .WithDescription("description1")
        .WithMetadata("CATEGORY_0001")
        .WithMinimumValue(100L)
        .WithMaximumValue(10000L)
        .WithSum(null)
        .WithOrderDirection("desc")
        .WithEntryPeriodEventId(null)
        .WithAccessPeriodEventId(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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.updateSubscribeRankingModelMaster(
        new Gs2Ranking2.UpdateSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("subscribe-0001")
            .withDescription("description1")
            .withMetadata("CATEGORY_0001")
            .withMinimumValue(100)
            .withMaximumValue(10000)
            .withSum(null)
            .withOrderDirection("desc")
            .withEntryPeriodEventId(null)
            .withAccessPeriodEventId(null)
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.update_subscribe_ranking_model_master(
        ranking2.UpdateSubscribeRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('subscribe-0001')
            .with_description('description1')
            .with_metadata('CATEGORY_0001')
            .with_minimum_value(100)
            .with_maximum_value(10000)
            .with_sum(None)
            .with_order_direction('desc')
            .with_entry_period_event_id(None)
            .with_access_period_event_id(None)
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.update_subscribe_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="subscribe-0001",
    description="description1",
    metadata="CATEGORY_0001",
    minimumValue=100,
    maximumValue=10000,
    sum=nil,
    orderDirection="desc",
    entryPeriodEventId=nil,
    accessPeriodEventId=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('ranking2')

api_result_handler = client.update_subscribe_ranking_model_master_async({
    namespaceName="namespace-0001",
    rankingName="subscribe-0001",
    description="description1",
    metadata="CATEGORY_0001",
    minimumValue=100,
    maximumValue=10000,
    sum=nil,
    orderDirection="desc",
    entryPeriodEventId=nil,
    accessPeriodEventId=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;

deleteSubscribeRankingModelMaster

Delete Subscribe Ranking Model Master

Deletes the specified subscribe ranking 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 (.).
rankingName string
~ 128 chars Subscribe Ranking Model name
Subscribe Ranking Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

Type Description
item SubscribeRankingModelMaster Subscribe Ranking Model Master deleted

Implementation Example

import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/ranking2"
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 := ranking2.Gs2Ranking2RestClient{
    Session: &session,
}
result, err := client.DeleteSubscribeRankingModelMaster(
    &ranking2.DeleteSubscribeRankingModelMasterRequest {
        NamespaceName: pointy.String("namespace-0001"),
        RankingName: pointy.String("subscribe-0001"),
    }
)
if err != nil {
    panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Ranking2\Gs2Ranking2RestClient;
use Gs2\Ranking2\Request\DeleteSubscribeRankingModelMasterRequest;

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

$session->open();

$client = new Gs2Ranking2RestClient(
    $session
);

try {
    $result = $client->deleteSubscribeRankingModelMaster(
        (new DeleteSubscribeRankingModelMasterRequest())
            ->withNamespaceName("namespace-0001")
            ->withRankingName("subscribe-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.ranking2.rest.Gs2Ranking2RestClient;
import io.gs2.ranking2.request.DeleteSubscribeRankingModelMasterRequest;
import io.gs2.ranking2.result.DeleteSubscribeRankingModelMasterResult;

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

try {
    DeleteSubscribeRankingModelMasterResult result = client.deleteSubscribeRankingModelMaster(
        new DeleteSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("subscribe-0001")
    );
    SubscribeRankingModelMaster 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 Gs2Ranking2RestClient(session);

AsyncResult<Gs2.Gs2Ranking2.Result.DeleteSubscribeRankingModelMasterResult> asyncResult = null;
yield return client.DeleteSubscribeRankingModelMaster(
    new Gs2.Gs2Ranking2.Request.DeleteSubscribeRankingModelMasterRequest()
        .WithNamespaceName("namespace-0001")
        .WithRankingName("subscribe-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 Gs2Ranking2 from '@/gs2/ranking2';

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

try {
    const result = await client.deleteSubscribeRankingModelMaster(
        new Gs2Ranking2.DeleteSubscribeRankingModelMasterRequest()
            .withNamespaceName("namespace-0001")
            .withRankingName("subscribe-0001")
    );
    const item = result.getItem();
} catch (e) {
    process.exit(1);
}
from gs2 import core
from gs2 import ranking2

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

try:
    result = client.delete_subscribe_ranking_model_master(
        ranking2.DeleteSubscribeRankingModelMasterRequest()
            .with_namespace_name('namespace-0001')
            .with_ranking_name('subscribe-0001')
    )
    item = result.item
except core.Gs2Exception as e:
    exit(1)
client = gs2('ranking2')

api_result = client.delete_subscribe_ranking_model_master({
    namespaceName="namespace-0001",
    rankingName="subscribe-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('ranking2')

api_result_handler = client.delete_subscribe_ranking_model_master_async({
    namespaceName="namespace-0001",
    rankingName="subscribe-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;